public void testGetLabelAtRank () { assertTrue (lv.getLabelAtRank(1) == ld.lookupLabel ("a")); }
public void testGetLabelAtRank () { assertTrue (lv.getLabelAtRank(1) == ld.lookupLabel ("a")); }
/** * * @param neighbors * @return An array containing a score for each of the elements of <code>neighbors</code>. */ public double[] evaluate (Neighbor[] neighbors) { double[] scores = new double[neighbors.length]; LabelVector ranks = classifier.classify(neighbors).getLabelVector(); for (int i = 0; i < ranks.numLocations(); i++) { int idx = ((Integer)ranks.getLabelAtRank(i).getEntry()).intValue(); scores[idx] = ranks.getValueAtRank(i); } return scores; }
/** * * @param neighbors * @return An array containing a score for each of the elements of <code>neighbors</code>. */ public double[] evaluate (Neighbor[] neighbors) { double[] scores = new double[neighbors.length]; LabelVector ranks = classifier.classify(neighbors).getLabelVector(); for (int i = 0; i < ranks.numLocations(); i++) { int idx = ((Integer)ranks.getLabelAtRank(i).getEntry()).intValue(); scores[idx] = ranks.getValueAtRank(i); } return scores; }
/** * * @param neighbors * @return An array containing a score for each of the elements of <code>neighbors</code>. */ public double[] evaluate (Neighbor[] neighbors) { double[] scores = new double[neighbors.length]; LabelVector ranks = classifier.classify(neighbors).getLabelVector(); for (int i = 0; i < ranks.numLocations(); i++) { int idx = ((Integer)ranks.getLabelAtRank(i).getEntry()).intValue(); scores[idx] = ranks.getValueAtRank(i); } return scores; }
for(int i=0; i<lv.numLocations(); i++) { features = PropertyList.add (lv.getLabelAtRank(i).toString() +"HasValue", lv.valueAtLocation (i), features); features = PropertyList.add (bestLabel.toString() + "IsFirst-" + lv.getLabelAtRank(1).toString()+"IsSecond", 1.0, features); features = PropertyList.add ("Range", winningScore - lv.getValueAtRank(lv.numLocations()-1), features); features = PropertyList.add (bestLabel.toString()+"IsFirst", 1.0, features); features = PropertyList.add (lv.getLabelAtRank(1).toString() + "IsSecond", 1.0, features);
for(int i=0; i<lv.numLocations(); i++) { features = PropertyList.add (lv.getLabelAtRank(i).toString() +"HasValue", lv.valueAtLocation (i), features); features = PropertyList.add (bestLabel.toString() + "IsFirst-" + lv.getLabelAtRank(1).toString()+"IsSecond", 1.0, features); features = PropertyList.add ("Range", winningScore - lv.getValueAtRank(lv.numLocations()-1), features); features = PropertyList.add (bestLabel.toString()+"IsFirst", 1.0, features); features = PropertyList.add (lv.getLabelAtRank(1).toString() + "IsSecond", 1.0, features);
for(int i=0; i<lv.numLocations(); i++) { features = PropertyList.add (lv.getLabelAtRank(i).toString() +"HasValue", lv.valueAtLocation (i), features); features = PropertyList.add (bestLabel.toString() + "IsFirst-" + lv.getLabelAtRank(1).toString()+"IsSecond", 1.0, features); features = PropertyList.add ("Range", winningScore - lv.getValueAtRank(lv.numLocations()-1), features); features = PropertyList.add (bestLabel.toString()+"IsFirst", 1.0, features); features = PropertyList.add (lv.getLabelAtRank(1).toString() + "IsSecond", 1.0, features);
Label label = lv.getLabelAtRank(m_predRanks2add[j]); int idx = m_dataAlphabet.lookupIndex("TOK_PRED=" + label.toString() + "_@_RANK_" + m_predRanks2add[j]);
Label label = lv.getLabelAtRank(m_predRanks2add[j]); int idx = m_dataAlphabet.lookupIndex("TOK_PRED=" + label.toString() + "_@_RANK_" + m_predRanks2add[j]);
Label label = lv.getLabelAtRank(m_predRanks2add[j]); int idx = m_dataAlphabet.lookupIndex("TOK_PRED=" + label.toString() + "_@_RANK_" + m_predRanks2add[j]);