How to implement machine learning models on mobile phones? - android

I've built Machine Learning Models Random Forest and XGBOOST on Python or R
How can I implement that my model work in mobile phone IOS / Android? Not for training, just to predict the probability for users by properties and events.

You can expose your machine learning model as a REST API endpoint. Essentially, the client (mobile) will be making requests at a specific endpoint, which will then be triggering your model.
There quite a few examples available in the Web for you to read but for your convenience you may take a look at this one.

I think I'm qualified to answer this because it was yesterday that I viewed Google's "DevFestOnAir 2018". There was an "End to End Machine Learning" talk where the speaker mentioned what TensorFlow(TF) has to support AI in mobile devices.
Now, TF is available for JS , Java and many other languages, so this captures the entirety of the model that runs on your PC, uses other functionalities to make it run on lesser RAM and Processors. Do check this out. If I'm not wrong TF has a feature that would do the conversion for you.

Related

Is the API for exercise machines (like NordicTrack iFit) open? Can I write an app to control my bluetooth-enabled machine?

I've written standalone apps that construct workouts that I can build to vary time, resistance, etc., but they don't communicate with a dedicated exercise machine. I recently bought a NordicTrack elliptical machine which uses their iFit framework (using their iFit Bluetooth app) to control the machine's resistance and incline. Is this an open Bluetooth-accessible API that I can access to have my app connect to the machine and manipulate the resistance and incline myself? Anyone?
It's not open because the companies (ProForm, NordicTrack) want to earn extra money besides the one time purchase price through constantly flowing subscription money via the iFit service. They need to somehow make it an exclusive option to use iFit, otherwise they'd lose another cash cow, I'd even say maybe the constant subscription flow is more important than the MSRP.
On fitness forums (like slowtwitch forum https://forum.slowtwitch.com/forum/Slowtwitch_Forums_C1/Triathlon_Forum_F1/Treadmill_iFit_%22hack%22_/_tweak_P6851409/) people were figuring out how to get into admin mode and access the Android tablet as it is. Lately Nordictrack moved and tries to block the users from accessing privileged mode condescendingly in the name of safety: https://www.extremetech.com/extreme/329275-owners-resort-to-hacking-smart-treadmills-after-nordictrack-locks-them-out. This is similar what Peloton pulled: https://www.makeuseof.com/peloton-treadmills-lose-free-just-run/
However when communication happens with apps there always be a possibility to reverse engineer protocols, although that's tedious and sometimes result in fragile code, and condescending companies could always push updates which intentionally interfere with hack solutions.
According to forums the https://github.com/belden/iFitController web protocol based solution (mentioned by #papahouss, I found another repo which exists) only works with 2017 and earlier devices. The later models switched to Bluetooth (it sounds like you have such machine) so the HTTP project won't work for you most probably.
There are a few projects trying to integrate iFit devices with Zwift, and some other extra projects. This one particularly looks very promising, but I haven't got to study it in details yet: https://github.com/dawsontoth/zwifit/blob/master/src/ble/ifit/_request.js
Maybe you should have a look at this project : https://github.com/jamesdotcuff/iFitController
You can communicate with the machine via websock. It works for treadmill but not too sure about elliptical machine.
Good luck

Any (rough) equivalent to iOS NSLinguisticTagger for android?

In iOS, you can use the NSLinguisticTagger to do things like part-of-speech tagging, and even lemmatizing a word (like recognizing that "went" is a form of the verb "to go") for several different languages.
Is there anything like this for use with android development, that's available for several different languages, as is the case for iOS? I'm aware of stuff like the Stanford NLP, but it seems to only work with a limited number of languages (English + 5 others), which is not sufficient for my purposes. Plus, I'm not even sure if it could work on android. (but correct me if I'm wrong)
It would need to work without accessing the network, so it must do everything on the device without connecting to a service.
I'm afraid the answer is "no"...but asking anyway just in case, before I spend a huge amount of time trying to develop my own workaround.
You can use any java-based nlp toolkits in android applications. Here is a list of popular ones with a simple description :
Stanford CoreNLP
I don't know exactly how many you mean by several but if you ever want to make a toolkit you can train coreNLP with a corpus.
Apache OpenNLP
Apache Lucene and Solr
Apache's toolkits and analyzers do support more languages and you can also train models with openNLP as well.
You can see a list of languages supported here :
Languages supported by Solr.
GATE

Building Peer to Peer photo sharing on Android

I am planning to do a project on Peer to Peer photo sharing on Android. My professor wants me to do that using some language other than Java or C/C++. Is any of Erlang, Haskell, Ocaml,
Scala, Go helpful to build an android app with following functionality?
Ability to design a GUI for android to view the pictures to be shared
Support for socket communications to transfer the pictures?
Since Android relies heavily on Java, Scala would be a good choice here. Scala makes interoperating with Java code easy and runs on the JVM. On top of this, it is a nice functional language with an interesting type system, so it will be a good learning experience. (So will your other languages, but Scala is probably easier to use on Android.)
Check out Scala Programming for Android, which describes how you can make Android applications in Scala.
You can compile and execute Go programs on Android (or ARM in general), but you can't actually use the Android libraries. So, writing services or GUI applications for Android in Go is currently not that easy. I am not sure about the other languages, but I think Erlang, Haskell, Ocaml, etc. have similar problems (if they even provide an ARM compiler).
Therefore it's probably best to focus on a JVM based language. Most of the examples and other applications are written in Java, but Scala is also able to access all those APIs. So, I would either use Java or Scala.
There's also this JVM-based functional, dynamic, lisp-like language Clojure, which some people seem to like a lot. It should be possible to use it to write Android Apps.
Well, in my view, it depends on what you want to really use the language for as regards your project. Photo Sharing: are you planning on using Web based tools for the client, i.e. JavaScript, HTML5, CSS3, JQuery Mobile (http://jquerymobile.com/), sencha Touch (http://www.sencha.com/products/touch), Phone Gap (http://phonegap.com/),Titanium Appcelerator OR you want to use native stuff like Java, J2ME, e.t.c. Then if its web based (which would make things easier in my view), the language you are referring to in this case would be on the Server side. So in my view if you just need the language to web-serve photos and stuff, then it would not matter which one you use: really depends on your liking. I am pretty sure that Erlang, Scala, Java and the others all have capability for developing great web services. However, the conditions you put as below:
1) Ability to design a GUI for android to view the pictures to be shared 2) Support for socket communications to transfer the pictures?
Suggest that you were referring to a Front-End technology to use. You cannot use Erlang to create GUIs on Android, if i am right, you may not also be able to use Haskell and OcamL as well because these technologies cannot run on the device. For GUIs on Android, you can only use Java, OR you can use Widget Technologies like Opera Widgets OR you use Web based stuff like i mentioned above. However, you should know that using JavaScript Libraries, HTML5, CSS3, e.t.c. is the quickest and more manageable way of developing Apps on any Device. I even wonder why you are talking of Socket Communications !! Am i getting you right ? you want to develop a Photo Sharing App which transfers Photos over raw Socket Communications ? Well, i am NOT sure how many apps out there for Android are doing raw Socket stuff, but i am pretty sure that many (http://androidapplications.com/) are using HTTP Protocol, as in Web Services. Consider looking into web services than raw Sockets. I am pretty sure that even apps developed using native Java, uses HTTP (Web Services like SOAP) to communicate with a remote Server, be it weather apps, location-based stuff e.t.c. Otherwise i guess you should concentrate on Java, for now.

Best back end for data intensive Android, iOS app: Drupal or Django or Rails or something else?

We are starting from scratch to develop a couple sophisticated mobile apps. We anticipate supporting iPad, iPhone, Android tablet and Android phones. However, our initial focus will be Android only.
The applications will be used to collect data and send that data to the backend. The whole scope of this project is data collection, data analysis, and data presentation. It's all about data.
What is the right backend technology?
EDIT: Sorry for not providing this info initially. The attraction of Python is the SciPy / NumPy libraries for data presentation and data analysis. I don't think any other platform has libraries that can match these. So Python/Django would seem ideal if there is no problem interfacing with mobile apps...
It will also be nice to use the same technology for the general website and I guess Python/Django is good in that regard too.
I don't see any difference between PHP, Python and Ruby in this case. As I understand, backend is going to be used as a database access layer and for nothing more complex. Am I right? If yes, go with technology you know better.
Why do you want to use Drupal for this task? From my point of view, it is better to use something more oriented on high performance and database interaction. Try Yii, Codeigniter or Fat Free PHP frameworks for example.
Django is a good choise as well because it has wonderful administration interface which is being generated by framework automatically. The only thing you should do is to set up models in your app and enable admin module.
Unfortunatelly, I have no RoR experience so I can say nothing about it except that a lot of people say that it is great.
Python/Django plus SciPy/NumPy proved to be the best option for our project.
The attraction of Python is the SciPy / NumPy libraries for data
presentation and data analysis. I don't think any other platform has
libraries that can match these.
Seriously: Java. You've got ease of use, statefulness and many very very good frameworks. And performance for large datasets is still very very good.
I'd especially recommend the Spring framework and hibernate.

What are the key differences between Android, iOS and Blackberry OS?

What are the key differences between Android, iOS and Blackberry OS in terms of level of accessibility by application developers (i.e. access to the video input, sound input, phone functionalities, to which extent, etc.)?
PS: Assume latest version of each OS.
EDIT: Can someone turn this into a wiki so we can compile answers from people that don"t necessarily have experience in all 3 plaforms.
I'm not familiar with BlackBerry, but on Android and iOS you can access just about anything. Until recently iOS had some restrictions about camera access (see this), but I belive those have been solved. Because Android is open-source, you can theoretically go as deep as you want as far as accessing the hardware, but you may or may not be able to get any deeper through the standard Android API than you can through the iOS API.
On Android, you can do a lot more to override default functionality. For example, you can create your own launcher screen or phone application. The iOS approval process wouldn't allow these kinds of applications.
API hardware access really isn't an issue on either platform, the bigger concern is overriding default software (almost never possible in iOS) and what types of applications iOS allows.
Each platform has its own nice and bad parts. I have been working on both Android and BB. I wish I could take only nice parts from both to create a platform of a dev dream! :)
For instance, I could take these features from BB:
The greates feature I like in BB is the simplicity of the application architecture - you can always count on your main UIApplication instance - OS never kills it.
Also I do like the simplicity the Dialog class provides - it is very easy to implement business logic related to user choice - while Dialog screen is shown the code execution just stops and waits for user input.
From Android I'd take the following:
Network communication. On BB this is a real nightmare (BES, BIS, WIFI, Direct TCP without APN, Direct TCP with APN, WAP, WAP2, Unite - who's next? :)).
For file manipulations you just use a native/usual Java API.
Nice looking UI components are available right out of the box.
I should add I'm not happy with GPS related stuff on both platforms, however maybe it is due to GPS hardware limitations rather than API creators.
Thanks!
BlackBerry is a pain, once I made a project for it (the JDE version was 4.7 back then) and it didn't had an ArrayList. WTF?

Categories

Resources