/** Constructs a LabelVector which is a distribution over indices of * the "positive" Instance. */ private LabelVector createLabelVector (LabelAlphabet labelAlphabet, double[] scores) { if (labelAlphabet.growthStopped()) labelAlphabet.startGrowth(); for (int i=0; i < scores.length; i++) labelAlphabet.lookupIndex(String.valueOf(i), true); double[] allScores = new double[labelAlphabet.size()]; for (int i=0; i < labelAlphabet.size(); i++) allScores[i] = 0.0; for (int i=0; i < scores.length; i++) { int index = labelAlphabet.lookupIndex(String.valueOf(i), true); allScores[index] = scores[i]; } return new LabelVector(labelAlphabet, allScores); }
/** Constructs a LabelVector which is a distribution over indices of * the "positive" Instance. */ private LabelVector createLabelVector (LabelAlphabet labelAlphabet, double[] scores) { if (labelAlphabet.growthStopped()) labelAlphabet.startGrowth(); for (int i=0; i < scores.length; i++) labelAlphabet.lookupIndex(String.valueOf(i), true); double[] allScores = new double[labelAlphabet.size()]; for (int i=0; i < labelAlphabet.size(); i++) allScores[i] = 0.0; for (int i=0; i < scores.length; i++) { int index = labelAlphabet.lookupIndex(String.valueOf(i), true); allScores[index] = scores[i]; } return new LabelVector(labelAlphabet, allScores); }
/** Constructs a LabelVector which is a distribution over indices of * the "positive" Instance. */ private LabelVector createLabelVector (LabelAlphabet labelAlphabet, double[] scores) { if (labelAlphabet.growthStopped()) labelAlphabet.startGrowth(); for (int i=0; i < scores.length; i++) labelAlphabet.lookupIndex(String.valueOf(i), true); double[] allScores = new double[labelAlphabet.size()]; for (int i=0; i < labelAlphabet.size(); i++) allScores[i] = 0.0; for (int i=0; i < scores.length; i++) { int index = labelAlphabet.lookupIndex(String.valueOf(i), true); allScores[index] = scores[i]; } return new LabelVector(labelAlphabet, allScores); }