edu.cmu.minorthird.classify.ranking
Class BatchRankingLearner
java.lang.Object
edu.cmu.minorthird.classify.BatchClassifierLearner
edu.cmu.minorthird.classify.BatchBinaryClassifierLearner
edu.cmu.minorthird.classify.ranking.BatchRankingLearner
- All Implemented Interfaces:
- BinaryClassifierLearner, ClassifierLearner, java.lang.Cloneable
- Direct Known Subclasses:
- ListNet, RankingBoosted, RankingPerceptron
public abstract class BatchRankingLearner
- extends BatchBinaryClassifierLearner
Learns to rank sets of examples, rather than to classify individual examples.
Data is presented to a BatchRankingLearner as an ordinary binary
dataset. Examples from the same subpopulation are comparable, and
should be ranked so that positive examples have a higher score than
negative examples.
- Author:
- William Cohen
Method Summary |
static java.util.Map<java.lang.String,java.util.List<Example>> |
listsWithOneExampleEach(java.util.Map<java.lang.String,java.util.List<Example>> rankingLists)
Split a Map output by splitIntoRankings into lists that contain
exactly one positive example each. |
static void |
sortByScore(BinaryClassifier c,
java.util.List<Example> data)
Sort a List of Instances by score according to the classifier. |
static java.util.Map<java.lang.String,java.util.List<Example>> |
splitIntoRankings(Dataset data)
Sort a dataset into 'rankings'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BatchRankingLearner
public BatchRankingLearner()
splitIntoRankings
public static java.util.Map<java.lang.String,java.util.List<Example>> splitIntoRankings(Dataset data)
- Sort a dataset into 'rankings'. Each ranking is a List of
Examples such that all positive examples in the list should be
ranked above all negative examples. Returns a map so that
map.get(key) is an ArrayList of examples.
listsWithOneExampleEach
public static java.util.Map<java.lang.String,java.util.List<Example>> listsWithOneExampleEach(java.util.Map<java.lang.String,java.util.List<Example>> rankingLists)
- Split a Map output by splitIntoRankings into lists that contain
exactly one positive example each.
sortByScore
public static void sortByScore(BinaryClassifier c,
java.util.List<Example> data)
- Sort a List of Instances by score according to the classifier.