Изменения
Нет описания правки
'''import''' java.util.Arrays;
<font color="green">// load train and test datasets</font>
'''var''' arffParser = new ArffParser();
arffParser.setResponseIndex(0);
'''var''' train = arffParser.parse(this.getClass().getResourceAsStream("train.arff"));
'''var''' test = arffParser.parse(this.getClass().getResouceAsStream("test.arff"));
<font color="green">// create adaboost classifier</font>
'''var''' forest = new AdaBoost(train.attributes(), train.x(), train.labels(), 200, 4);
<font color="green">// measure accuracy and F1-measure on test dataset</font>
'''var''' measures = new ClassificationMeasure[]{new FMeasure(), new Accuracy()};
'''var''' results = forest.test(test.x(), test.labels(), measures);