Load .sav file in android studio

Viewed 52

I have trained a model using the following code and saved the model in .sav format.

from sklearn.tree import DecisionTreeClassifier
import pickle

tree = DecisionTreeClassifier(criterion = 'entropy', random_state=0)
tree.fit(X_train, Y_train)

filename = 'DecisionTreeClassifier.sav'
pickle.dump(tree, open(filename, 'wb'))

Now I want to load the model in android studio using java code. Is it possible to load the model in Android and predict? If not how can I train a sklearn model in python and load it in android studio and predict?

0 Answers
Related