Computes the output of the summations of the input vector with the current weight vector as a recursive linear combination of all previous support vectors and their associated score values. See Remark 5 in the original paper. @param x the input vector to compute the score value @return the scor
(Vec x, boolean averaged)
| 257 | * it is on |
| 258 | */ |
| 259 | private double score(Vec x, boolean averaged) |
| 260 | { |
| 261 | /* |
| 262 | * Score for the current dot procut with the weight vector, denom for |
| 263 | * the current normalizing constant. |
| 264 | */ |
| 265 | double score = 0; |
| 266 | double denom = 0; |
| 267 | double finalScore = 0; |
| 268 | |
| 269 | for(int i = 0; i < supports.size(); i++) |
| 270 | { |
| 271 | double eta_s = signedEtas.get(i); |
| 272 | double tmp = eta_s*K.eval(supports.get(i), x)/normalizers.get(i); |
| 273 | double denom_tmp = 2*eta_s*associatedScores.get(i)+eta_s*eta_s; |
| 274 | denom += denom/Math.max(1, denom)+ denom_tmp; |
| 275 | score += tmp/Math.max(1, denom); |
| 276 | if(averaged) |
| 277 | finalScore += score*rounds.get(i); |
| 278 | } |
| 279 | if(averaged) |
| 280 | return finalScore; |
| 281 | else |
| 282 | return score; |
| 283 | } |
| 284 | |
| 285 | @Override |
| 286 | public CategoricalResults classify(DataPoint data) |