rjmarsan / weka-for-android Goto Github PK
View Code? Open in Web Editor NEWthe Weka project with the GUI components removed so it works with Android
the Weka project with the GUI components removed so it works with Android
This is a port of weka 3 ( see http://www.cs.waikato.ac.nz/ml/weka/ ) to the Android platform. Many things were removed (aka commented out), and 100% functionality is not promised. However, it's sure better than nothing. for the lazy ones... download https://github.com/rjmarsan/Weka-for-Android/blob/master/wekaSTRIPPED.jar?raw=true and add it to your android project's build path. You may need to increase your heap size to get dx to convert it, but it will work.
Deserializing a serialized model produces the following error:
java.io.InvalidClassException:
weka.classifiers.trees.RandomForest; Incompatible class (SUID):
weka.classifiers.trees.RandomForest
I tried the following 2 methods provided in the wiki for the project:
//First Method
RandomForest rf = (RandomForest) weka.core.SerializationHelper.
read(Environment.getExternalStorageDirectory().getPath() + "/BC.model");
//Second Method
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(
Environment.getExternalStorageDirectory().getPath() + "/BC.model"));
RandomForest rf = new RandomForest();
rf = (RandomForest) ois.readObject();
Note: I use WEKAstripped.jar
This version does not contain LibSVM. I am unable to find which version of Weka this is?
Trying to load a preconfig. model with
"weka.core.SerializationHelper.read(assetManager.open("multilayer.model"));"
but getting "java.lang.ClassNotFoundException: weka.core.NominalAttributeInfo"
Should this class not be included?
Part of my research work is to classify sensor data on Android using Multilayer Perceptron (MLP) classifier.
I used WekaSTRIPPED to train (build) the MLP classifier on the phone and save the trained model on the sdcard by serializing it. This works fine in a small scale problem even with large training data. I mean by small scale problem that the MLP model to be trained consists of about 10 inputs (features) and 4 outputs (classes). However, when the MLP model increases to have 25 inputs and 10 outputs the building process fails on the phone. I tried to increase the heap size to 1024 m but unfortunately this doesn’t solve the problem. I also tried to build the classifier on a virtual machine but again this doesn’t solve the problem.
Another trial was to train the model using WEKA on the PC and then serialize the model to a specific place on the machine. I copied this saved model from the pc and pasted it on the sdcard of the phone. Then I deserialized this model using Weka for Android but unfortunately, the deserialization of the model fails.
My question here is do I really need to train (build) my classifier on the phone specially that my training data is supposed to be very large and even the model to be trained itself is going to be more and more complex?
Any help is greatly appreciated.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.