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

Method classify

JSAT/src/jsat/classifiers/boosting/Bagging.java:190–206  ·  view source on GitHub ↗
(DataPoint data)

Source from the content-addressed store, hash-verified

188 }
189
190 @Override
191 public CategoricalResults classify(DataPoint data)
192 {
193 if(baseClassifier == null)
194 throw new RuntimeException("Bagging instance created for regression, not classification");
195 else if(learners == null || learners.isEmpty())
196 throw new RuntimeException("Classifier has not yet been trained");
197 CategoricalResults totalResult = new CategoricalResults(predicting.getNumOfCategories());
198 for(int i = 0; i < learners.size(); i++)
199 {
200 CategoricalResults result = ((Classifier) learners.get(i)).classify(data);
201 totalResult.incProb(result.mostLikely(), 1.0);
202 }
203
204 totalResult.normalize();
205 return totalResult;
206 }
207
208 @Override
209 public void trainC(final ClassificationDataSet dataSet, final ExecutorService threadPool)

Callers 1

testCloneMethod · 0.95

Calls 7

incProbMethod · 0.95
mostLikelyMethod · 0.95
normalizeMethod · 0.95
getNumOfCategoriesMethod · 0.80
sizeMethod · 0.65
classifyMethod · 0.65
getMethod · 0.45

Tested by 1

testCloneMethod · 0.76