if (ltu != null) result.put(label, ltu.score(exampleFeatures, exampleValues) - ltu.getThreshold()); continue; result.put(labelLexicon.lookupKey(l).getStringValue(), ltu.score(exampleFeatures, exampleValues) - ltu.getThreshold());
/** * Produces a set of scores indicating the degree to which each possible discrete classification * value is associated with the given example object. These scores are just the scores of each * LTU's positive classification as produced by <code>LinearThresholdUnit.scores(Object)</code>. * * @see LinearThresholdUnit#scores(Object) * @param exampleFeatures The example's array of feature indices. * @param exampleValues The example's array of feature values. * @return The set of scores produced by the LTUs **/ public ScoreSet scores(int[] exampleFeatures, double[] exampleValues) { ScoreSet result = new ScoreSet(); int N = network.size(); for (int l = 0; l < N; l++) { LinearThresholdUnit ltu = (LinearThresholdUnit) network.get(l); if (ltu == null) continue; result.put(labelLexicon.lookupKey(l).getStringValue(), ltu.score(exampleFeatures, exampleValues) - ltu.getThreshold()); } return result; }