nok / sklearn-porter

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generating probabilities instead of categorical results

tejas9090 opened this issue · comments

  1. Is there some way to generate C code which would give me floating point probabilities for every prediction category instead of a binary result? I am using the ExtraTreeModel from sklearn (code snippet shown below).

  2. My model is almost 1Gb in size, the C code generated is about the same size, which will take forever to compile, is there a way to compress this model or split up the files?

Training Code Snippet

from sklearn.ensemble import ExtraTreesClassifier
from joblib import dump, load

clf = ExtraTreesClassifier(n_estimators=250, random_state=0,verbose=True)
clf.fit(train_x, train_y)
prob_test_data = clf.predict_proba(test_x)

Thanks in advance