|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.minorthird.classify.OnlineClassifierLearner edu.cmu.minorthird.classify.algorithms.knn.KnnLearner
public class KnnLearner
Learn an Knn Classifier.
Constructor Summary | |
---|---|
KnnLearner()
|
|
KnnLearner(int k)
|
Method Summary | |
---|---|
void |
addExample(Example e)
Subclasses should use this method to perform whatever incremental update is needed after in response to a new example. |
ClassifierLearner |
copy()
Make a copy of the learner. |
Classifier |
getClassifier()
Subclasses should use this method to return the current classifier. |
int |
getK()
|
ExampleSchema |
getSchema()
Returns the ExampleSchema - constraints on what the Examples will be. |
void |
reset()
'forget' everything about the last learning task, and start a new task. |
void |
setK(int k)
|
void |
setSchema(ExampleSchema schema)
Accept an ExampleSchema - constraints on what the Examples will be. |
java.lang.String |
toString()
|
Methods inherited from class edu.cmu.minorthird.classify.OnlineClassifierLearner |
---|
completeTraining, hasNextQuery, nextQuery, setInstancePool |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KnnLearner()
public KnnLearner(int k)
Method Detail |
---|
public ClassifierLearner copy()
ClassifierLearner
copy
in interface ClassifierLearner
copy
in class OnlineClassifierLearner
public int getK()
public void setK(int k)
public void reset()
OnlineClassifierLearner
reset
in interface ClassifierLearner
reset
in class OnlineClassifierLearner
public void addExample(Example e)
OnlineClassifierLearner
addExample
in interface ClassifierLearner
addExample
in class OnlineClassifierLearner
public Classifier getClassifier()
OnlineClassifierLearner
getClassifier
in interface ClassifierLearner
getClassifier
in class OnlineClassifierLearner
public void setSchema(ExampleSchema schema)
ClassifierLearner
setSchema
in interface ClassifierLearner
public ExampleSchema getSchema()
ClassifierLearner
getSchema
in interface ClassifierLearner
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |