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)
| 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) |