|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.classification.TrainingSet
public final class TrainingSet
A TrainingSet contains a set of types, and for each type a corresponding set of positive and negative examples. It used to train a TrainableClassifier.
Constructor Summary | |
---|---|
TrainingSet()
Construct an empty training set. |
Method Summary | |
---|---|
void |
addExample(String t,
FeatureSet s,
int which)
Add a example to this training set for the given type (either positive or negative, denoted by the "which" argument). |
void |
addNegativeExample(String t,
FeatureSet s)
Add a negative example to this training set for the given type. |
void |
addPositiveExample(String t,
FeatureSet s)
Add a positive example to this training set for the given type. |
boolean |
containsType(String t)
Return true if the training type with the specified name is in the set, or false otherwise. |
int |
getTypeCount()
Return how many types are contained in this training set. |
int |
negativeExampleCount(String t)
Returns the number of negative examples for the given type. |
Iterator |
negativeExamples(String t)
An iterator over the negative examples for the given type. |
int |
positiveExampleCount(String t)
Returns the number of positive examples for the given type. |
Iterator |
positiveExamples(String t)
An iterator over the positive examples for the given type. |
String |
toString()
|
Iterator |
types()
An iterator over the types contained in this training set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TrainingSet()
Method Detail |
---|
public final void addNegativeExample(String t, FeatureSet s)
public final void addPositiveExample(String t, FeatureSet s)
public final void addExample(String t, FeatureSet s, int which)
public final boolean containsType(String t)
public final int getTypeCount()
public final int negativeExampleCount(String t)
public final Iterator negativeExamples(String t)
public final int positiveExampleCount(String t)
public final Iterator positiveExamples(String t)
public Iterator types()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |