From 43a403c45c7538876df5dbe3c2f79e4aca965d47 Mon Sep 17 00:00:00 2001 From: Antti Pasanen Date: Tue, 11 Dec 2018 10:39:40 +0200 Subject: [PATCH] Fix for C RandomForestClassifier code generation. Don't apply num_format conversion in RandomForestClassifier code generation for feature indices. --- .../estimator/classifier/RandomForestClassifier/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklearn_porter/estimator/classifier/RandomForestClassifier/__init__.py b/sklearn_porter/estimator/classifier/RandomForestClassifier/__init__.py index 83bf3212..314c374a 100644 --- a/sklearn_porter/estimator/classifier/RandomForestClassifier/__init__.py +++ b/sklearn_porter/estimator/classifier/RandomForestClassifier/__init__.py @@ -275,7 +275,7 @@ def create_single_method(self, estimator_index, estimator): :return : string The created method. """ - indices = [self.repr(e) for e in estimator.tree_.feature] + indices = [str(e) for e in estimator.tree_.feature] tree_branches = self.create_branches( estimator.tree_.children_left, estimator.tree_.children_right,