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

Method classify

JSAT/src/jsat/classifiers/linear/kernelized/DUOL.java:336–348  ·  view source on GitHub ↗
(DataPoint data)

Source from the content-addressed store, hash-verified

334 }
335
336 @Override
337 public CategoricalResults classify(DataPoint data)
338 {
339 if(alphas == null)
340 throw new UntrainedModelException("Model has not yet been trained");
341 CategoricalResults cr = new CategoricalResults(2);
342 double score = getScore(data);
343 if(score < 0)
344 cr.setProb(0, 1.0);
345 else
346 cr.setProb(1, 1.0);
347 return cr;
348 }
349
350 @Override
351 public double getScore(DataPoint dp)

Callers 1

testCloneMethod · 0.95

Calls 2

getScoreMethod · 0.95
setProbMethod · 0.95

Tested by 1

testCloneMethod · 0.76