| 86 | } |
| 87 | |
| 88 | @Override |
| 89 | public CategoricalResults classify(DataPoint data) |
| 90 | { |
| 91 | CategoricalResults cr = new CategoricalResults(predicting.getNumOfCategories()); |
| 92 | for (int i = 0; i < oneVone.length; i++) |
| 93 | { |
| 94 | for (int j = 0; j < oneVone[i].length; j++) |
| 95 | { |
| 96 | CategoricalResults subRes = oneVone[i][j].classify(data); |
| 97 | int mostLikely = subRes.mostLikely(); |
| 98 | if(mostLikely == 0) |
| 99 | cr.incProb(i, 1.0); |
| 100 | else |
| 101 | cr.incProb(i+j+1, 1.0); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | cr.normalize(); |
| 106 | return cr; |
| 107 | } |
| 108 | |
| 109 | @Override |
| 110 | public void trainC(final ClassificationDataSet dataSet, final ExecutorService threadPool) |