Skip to content
Java
Branch: master
Clone or download
sztyler Update README.md
update example
Latest commit 7fb6304 Jan 20, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data add comment header and example Sep 29, 2016
src/de/unima/classifiers adapt arff class Jan 19, 2017
LICENSE Initial commit Sep 28, 2016
README.md

README.md

Online Random Forest Classifier (Java)

This is a Java implementation of an online random forest classifier. Online machine learning enables to update an existing classification model continuously without keeping the processed data available or knowing all data a-priori. This implementation relies on the implementation of Amir Saffari (C++). We reimplemented this classifier to use it also on wearable devices, e.g., android platforms.

Releases

Download: latest build (JAR, Build190117)

Usage

DataSet dsTrain = new ARFF();
dsTrain.load(new FileInputStream(new File("data/data_train.arff")));
DataSet dsTest = new ARFF();
dsTest.load(new FileInputStream(new File("data/data_test.arff")));

Config config = new Config();
RandomForest rf = new RandomForest(config, dsTrain.getNumOfClasses(), dsTrain.getNumOfFeatures(), dsTrain.getMinFeatRange(), dsTrain.getMaxFeatRange());

for (int nEpoch = 0; nEpoch < config.numEpochs; nEpoch++) { // train
  dsTrain.randomize();
  for (Sample sample : dsTrain.getSamples()) {
    rf.update(sample);
  }
}

for (Sample sample : dsTest.getSamples()) { // test
  Result result = new Result(dsTrain.getNumOfClasses());
  rf.eval(sample, result);
  results.put(result, sample.getLabel());
}

Please also consider the complete example

Documentation

Documentation (JavaDoc) is coming soon . If you have any issues, feel free to contact me

You can’t perform that action at this time.