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

Method scoreSaveEval

JSAT/src/jsat/classifiers/linear/kernelized/OSKL.java:376–388  ·  view source on GitHub ↗

Computes the score and saves the results of the kernel computations in #inputKEvals. The first value in the list will be the self kernel product @param x the input vector @param qi the query information for the vector @return the dot product in the kernel space

(Vec x, List<Double> qi)

Source from the content-addressed store, hash-verified

374 * @return the dot product in the kernel space
375 */
376 private double scoreSaveEval(Vec x, List<Double> qi)
377 {
378 inputKEvals.clear();
379 inputKEvals.add(k.eval(0, 0, Arrays.asList(x), qi));
380 double sum = 0;
381 for(int i = 0; i < alphas.size(); i++)
382 {
383 double k_ix = k.eval(i, x, qi, vecs, accelCache);
384 inputKEvals.add(k_ix);
385 sum += alphas.getD(i)*k_ix;
386 }
387 return sum;
388 }
389
390 @Override
391 public CategoricalResults classify(DataPoint data)

Callers 1

updateMethod · 0.95

Calls 5

evalMethod · 0.65
sizeMethod · 0.65
clearMethod · 0.45
addMethod · 0.45
getDMethod · 0.45

Tested by

no test coverage detected