Last change
on this file since 10 was
2,
checked in by sherbold, 10 years ago
|
|
-
Property svn:mime-type set to
text/plain
|
File size:
664 bytes
|
Line | |
---|
1 | package de.ugoe.cs.cpdp.training;
|
---|
2 |
|
---|
3 | import weka.classifiers.Classifier;
|
---|
4 | import weka.classifiers.meta.CVParameterSelection;
|
---|
5 | import weka.classifiers.trees.RandomForest;
|
---|
6 |
|
---|
7 | public class RandomForestTraining extends WekaTraining {
|
---|
8 |
|
---|
9 | @Override
|
---|
10 | protected Classifier setupClassifier() {
|
---|
11 | final CVParameterSelection ps = new CVParameterSelection();
|
---|
12 | ps.setClassifier(new RandomForest());
|
---|
13 | try {
|
---|
14 | // Parameter optimization with 5x5 CV
|
---|
15 | ps.setNumFolds(5);
|
---|
16 | ps.addCVParameter("I 5 25 5");
|
---|
17 | } catch (Exception e) {
|
---|
18 | throw new RuntimeException(e);
|
---|
19 | }
|
---|
20 | return ps;
|
---|
21 | }
|
---|
22 |
|
---|
23 | @Override
|
---|
24 | public String getName() {
|
---|
25 | return "RandomForest";
|
---|
26 | }
|
---|
27 |
|
---|
28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.