How can I run python code on Mobile devices

Viewed 376

I have developed one Machine learning model in Python. I want to run it in mobile device.

This model require Xgboost machine learning algorithm few signal processing library to extract signal features.

I don't want to perform training on mobile, but just testing the model.

What I tried so far

  1. ML Kit - This is Google service. But issue is it usage tensorflow. No support for Xgboost

  2. Core ML - Specifically for iOS. But signal processing support is not available

  3. Treelite - We can convert the model into C. But C code does not have feature extraction. I have tried to do feature extraction in C, Java but required signal processing packages I could not find or implement in.

Checked out various other links and articles but no support.

If any possible way to run python packages directly on mobile device, that can save my life.

2 Answers

I would suggest you Pythonista.
It works fine and there is almost everything what you want. You can't really use every module but still many and it cost 10$...
Sadly it's only available for iOS:
Click here to open it from the App Store.
Click here to take a look for the official page.

Here are some pros and cons:

Pros:

  • Syntax highligthing
  • many modules (Probably even the full library, but I haven't tried that yet)
  • Example Files (How to use the sensors, etc.)
  • Official docs: http://omz-software.com/pythonista/docs/
  • (half-) full Autocomplete

Cons:
- not very suitable on small screens

PS:
If I missed something: Feel free to edit it :)

You can try xgboost-predictor-java, Just adding the dependencies in android studio. It takes your model as an input and uses for prediction.

Related