Example usage for weka.classifiers.trees RandomForest main

List of usage examples for weka.classifiers.trees RandomForest main

Introduction

In this page you can find the example usage for weka.classifiers.trees RandomForest main.

Prototype

public static void main(String[] argv) 

Source Link

Document

Main method for this class.

Usage

From source file:focusedCrawler.target.classifier.WekaTargetClassifierBuilder.java

License:Open Source License

public static void trainModel(String trainingPath, String outputPath, String learner) {
    if (learner == null) {
        learner = "SMO";
    }/*w  w  w. ja  v  a 2  s  . c o m*/

    System.out.println("Training " + learner + " model...");
    if (learner.equals("SMO")) {
        SMO.main(new String[] { "-M", "-d", outputPath + "/pageclassifier.model", "-t",
                trainingPath + "/weka.arff", "-C", "0.01" });
    } else if (learner.equals("RandomForest")) {
        RandomForest.main(new String[] {
                //              "-K", "5", // k-fold cross validation
                "-I", "100", // Number of trees to build
                "-d", outputPath + "/pageclassifier.model", "-t", trainingPath + "/weka.arff" });
    } else {
        System.out.println("Unknow learner: " + learner);
        return;
    }
}