nok / sklearn-porter

Transpile trained scikit-learn estimators to C, Java, JavaScript and others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails with big dataset

mmhobi7 opened this issue · comments

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

Context is that with a massive dataset, it fails.

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