nok / sklearn-porter

Transpile trained scikit-learn estimators to C, Java, JavaScript and others.
BSD 3-Clause "New" or "Revised" License
1.28k stars 170 forks source link

Fails with big dataset #63

Closed mmhobi7 closed 4 years ago

mmhobi7 commented 4 years ago

train_X, val_X, train_y, val_y = train_test_split(X, y, random_state=1, train_size=0.0001) clf = DecisionTreeClassifier() clf.fit(train_X, train_y)

Export:

porter = Porter(clf, language='java') output = porter.export(embed_data=True) print(output)

fails with bigger train sizespython3.7/site-packages/sklearn_porter/estimator/classifier/DecisionTreeClassifier/init.py", line 308, in create_branches out += temp.format(features[node], '<=', self.repr(threshold[node])) IndexError: list index out of range

mmhobi7 commented 4 years ago

Context is that with a massive dataset, it fails.

mmhobi7 commented 4 years ago

I'm having major issues, I'll investigate later