smile.classification.RandomForest Java Examples
The following examples show how to use
smile.classification.RandomForest.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SmileTargetClassifierBuilder.java From ache with Apache License 2.0 | 5 votes |
private static SoftClassifier<double[]> trainModel(String learner, double[][] x, int[] y) { if (learner.equals("SVM")) { SVM<double[]> svm = new SVM<>(new LinearKernel(), 0.01); svm.learn(x, y); svm.finish(); svm.trainPlattScaling(x, y); return svm; } else if (learner.equals("RandomForest")) { RandomForest randomForest = new RandomForest(x, y, 100); return randomForest; } else { throw new IllegalArgumentException("Unknow learning algorithm: " + learner); } }