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

Method classify

JSAT/src/jsat/classifiers/linear/SDCA.java:286–300  ·  view source on GitHub ↗
(DataPoint data)

Source from the content-addressed store, hash-verified

284 }
285
286 @Override
287 public CategoricalResults classify(DataPoint data)
288 {
289 Vec x = data.getNumericalValues();
290 if(ws.length == 1)
291 return ((LossC)loss).getClassification(ws[0].dot(x)+bs[0]);
292 else
293 {
294 Vec pred = new DenseVector(ws.length);
295 for(int i = 0; i < ws.length; i++)
296 pred.set(i, ws[i].dot(x)+bs[i]);
297 ((LossMC)loss).process(pred, pred);
298 return ((LossMC)loss).getClassification(pred);
299 }
300 }
301
302 @Override
303 public double regress(DataPoint data)

Calls 5

setMethod · 0.95
getNumericalValuesMethod · 0.80
getClassificationMethod · 0.65
processMethod · 0.65
dotMethod · 0.45