MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / classify

Method classify

JSAT/src/jsat/classifiers/OneVSOne.java:88–107  ·  view source on GitHub ↗
(DataPoint data)

Source from the content-addressed store, hash-verified

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)

Callers 1

testCloneMethod · 0.95

Calls 5

mostLikelyMethod · 0.95
incProbMethod · 0.95
normalizeMethod · 0.95
getNumOfCategoriesMethod · 0.80
classifyMethod · 0.65

Tested by 1

testCloneMethod · 0.76