/** Retrieves all the scores for the values this variable may take. */ public ScoreSet getScores() { if (scores == null) scores = classifier.scores(example); return scores; }
/** * Produces a set of scores indicating the degree to which each possible discrete classification * value is associated with the given example object. Learners that return a <code>real</code> * feature or more than one feature may implement this method by simply returning * <code>null</code>. * * @param example The object to make decisions about. * @return A set of scores indicating the degree to which each possible discrete classification * value is associated with the given example object. **/ public ScoreSet scores(Object example) { Object[] exampleArray = getExampleArray(example, false); ScoreSet resultS = scores((int[]) exampleArray[0], (double[]) exampleArray[1]); if (!lossFlag) return resultS; else return scoresAugmented(example, resultS); }
/** Retrieves the value this variable currently takes. */ public String getValue() { if (value == null) { if (scores == null) scores = classifier.scores(example); value = scores.highScoreValue(); } return value; }
/** Retrieves the score of the current value of this variable. */ public double getScore() { if (scores == null) scores = classifier.scores(example); return scores.get(getValue()); }
/** * 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 produced * by the multiplexed <code>Learner</code>'s <code>scores(Object)</code> method. * * @see Learner#scores(Object) * @param exampleFeatures The example's array of feature indices. * @param exampleValues The example's array of feature values. **/ public ScoreSet scores(int[] exampleFeatures, double[] exampleValues) { int[] example = new int[exampleFeatures.length - 1]; double[] values = new double[exampleFeatures.length - 1]; System.arraycopy(exampleFeatures, 1, example, 0, example.length); System.arraycopy(exampleValues, 1, values, 0, values.length); int selection = exampleFeatures[0]; Learner l = (Learner) network.get(selection); if (l == null) return new ScoreSet(new String[] {defaultPrediction}, new double[] {1}); return l.scores(example, values); }
preBIOLevel1[i] = prediction; if (prediction.startsWith("B") || prediction.startsWith("U")){ ScoreSet scores = candidates[i].scores(t); Score[] scoresArray = scores.toArray(); for (Score s : scoresArray){
preBIOLevel1[i] = prediction; if (prediction.startsWith("B") || prediction.startsWith("U")){ ScoreSet scores = candidates[i].scores(t); Score[] scoresArray = scores.toArray(); for (Score s : scoresArray){
preBIOLevel1[i] = prediction; if (prediction.startsWith("B") || prediction.startsWith("U")){ ScoreSet scores = candidates[i].scores(t); Score[] scoresArray = scores.toArray(); for (Score s : scoresArray){
/** * Produces a set of scores indicating the degree to which each possible discrete classification * value is associated with the given feature vector. Learners that return a <code>real</code> * feature or more than one feature may implement this method by simply returning * <code>null</code>. * * @param vector The vector to make decisions about. * @return A set of scores indicating the degree to which each possible discrete classification * value is associated with the given example vector. **/ public ScoreSet scores(FeatureVector vector) { Classifier saveExtractor = getExtractor(); Classifier saveLabeler = getLabeler(); setExtractor(new FeatureVectorReturner()); setLabeler(new LabelVectorReturner()); ScoreSet result = scores((Object) vector); setExtractor(saveExtractor); setLabeler(saveLabeler); return result; }