edu.cmu.minorthird.ui
Class Recommended.KnnLearner

java.lang.Object
  extended by edu.cmu.minorthird.classify.BatchClassifierLearner
      extended by edu.cmu.minorthird.classify.transform.TransformingBatchLearner
          extended by edu.cmu.minorthird.ui.Recommended.KnnLearner
All Implemented Interfaces:
ClassifierLearner, java.lang.Cloneable
Enclosing class:
Recommended

public static class Recommended.KnnLearner
extends TransformingBatchLearner

K-NN learner following Yang and Chute. This uses a TFIDF transformation of the features, and averages the scores 30 nearest neighbors, with score weighted by TFIDF distance to the instance being classifier. Unlike many of the learners in the 'recommended' package, this is a non-binary (multi-class) learner.

Training for this learner is very fast, but classification time is rather slow.

Reference: Y. Yang and C.G. Chute, An example-based mapping method for text classification and retrieval, ACM Transactions on Information Systems, 3(12), 1994.


Field Summary
 
Fields inherited from class edu.cmu.minorthird.classify.BatchClassifierLearner
classifier, dataset
 
Constructor Summary
Recommended.KnnLearner()
           
 
Method Summary
 
Methods inherited from class edu.cmu.minorthird.classify.transform.TransformingBatchLearner
batchTrain, getClassifierLearner, getSchema, getTransformLearner, setClassifierLearner, setSchema, setTransformLearner
 
Methods inherited from class edu.cmu.minorthird.classify.BatchClassifierLearner
addExample, 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
 

Constructor Detail

Recommended.KnnLearner

public Recommended.KnnLearner()