edu.cmu.minorthird.classify.ranking
Class BatchRankingLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.BatchClassifierLearner
      extended by edu.cmu.minorthird.classify.BatchBinaryClassifierLearner
          extended by 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

Field Summary
 
Fields inherited from class edu.cmu.minorthird.classify.BatchClassifierLearner
classifier, dataset
 
Constructor Summary
BatchRankingLearner()
           
 
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 edu.cmu.minorthird.classify.BatchBinaryClassifierLearner
batchTrainBinary, getBinaryClassifier, getSchema, setSchema
 
Methods inherited from class edu.cmu.minorthird.classify.BatchClassifierLearner
addExample, batchTrain, completeTraining, copy, getClassifier, hasNextQuery, nextQuery, reset, setInstancePool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.cmu.minorthird.classify.ClassifierLearner
addExample, completeTraining, copy, getClassifier, hasNextQuery, nextQuery, reset, setInstancePool
 

Constructor Detail

BatchRankingLearner

public BatchRankingLearner()
Method Detail

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.