I am working on classification project in python, which uses scikit-learn library. I am using Random Forest for classification. I am using UCI dataset which have 31 features. I have trained the model and saved final pickled model. Now I have a pickle file and python script for extracting features for future prediction.
Now I want to develop user interface for my trained model in android, how can I import my trained final model and feature_extraction python script in android project. I am using scikit-learn and used anaconda and spyder for developing model.
You have a couple of different options here, though none are very smooth.
A) Embed Python into your Android app
Quite complicated, especially for libraries with native C extensions like scikit-learn. However once the setup is done, you can use any Python code your want. Some tools to simplify the process are available in the Python-for-Android project. https://github.com/kivy/python-for-android Kivy is a GUI framework that allows to write Android apps in pure Python. If you don't already know Java and have an existing app, that might be easiest way to go.
B) Rewrite your ML algorithm in Java For instance using Weka framework and their RandomForests implementation. Once the rewrite is done, integration in an Android app will be pain-free.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With