|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ir.classifiers.CVLearningCurve
Gives learning curves with K-fold cross validation for a classifier.
Field Summary | |
static java.lang.String[] |
CLASSES
Stores the possible class labels |
protected Classifier |
classifier
The classifier for which K-fold CV learning curve has to be generated |
protected boolean |
debug
Flag for debug display |
protected java.util.Vector[][] |
foldBins
foldBins[i][j] stores the examples for class i in fold j. |
protected int |
numClasses
Number of classes in the data |
protected int |
numFolds
Number of folds of cross validation to run |
static double[] |
POINTS
Points at which the learning curve is plotted |
double |
testTime
Total Testing time |
protected java.util.Vector[] |
totalExamples
Stores all the examples for each class |
double |
trainTime
Total Training time |
Method Summary | |
void |
binExamples()
Set the fold Bins from the total Examples -- this effectively stores the training-test split |
static int |
findClassID(java.lang.String name)
Finds the class ID from the name of the document |
Classifier |
getClassifier()
Return classifier |
java.util.Vector |
getCVPredictions()
Generate a vector of predictions ready for processing, by performing a cross-validation on the supplied dataset. |
java.util.Vector[][] |
getFoldBins()
Return the fold Bins |
java.util.Vector |
getTestCV(int foldnum)
Creates the testing set for one fold of a cross-validation on the dataset. |
java.util.Vector |
getTestPrediction(java.util.Vector train,
java.util.Vector test)
Generate a prediction vector by performing an evaluation on the test set after training on the given training set. |
java.util.Vector[] |
getTotalExamples()
Return all the examples |
java.util.Vector |
getTrainCV(int foldnum,
double percent)
Creates the training set for one fold of a cross-validation on the dataset. |
void |
setClassifier(Classifier c)
Set the classifier |
void |
setFoldBins(java.util.Vector[][] bins)
Set the fold Bins |
void |
setTotalExamples(java.lang.String dirName)
Sets the totalExamples by reading in file from directory dirName |
void |
setTotalExamples(java.util.Vector[] data)
Set all the examples |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String[] CLASSES
public static final double[] POINTS
protected java.util.Vector[] totalExamples
protected java.util.Vector[][] foldBins
protected Classifier classifier
protected int numClasses
protected int numFolds
protected boolean debug
public double trainTime
public double testTime
Method Detail |
public Classifier getClassifier()
public void setClassifier(Classifier c)
public java.util.Vector[] getTotalExamples()
public void setTotalExamples(java.util.Vector[] data)
public java.util.Vector[][] getFoldBins()
public void setFoldBins(java.util.Vector[][] bins)
public void setTotalExamples(java.lang.String dirName)
public java.util.Vector getCVPredictions()
public java.util.Vector getTestPrediction(java.util.Vector train, java.util.Vector test)
train
- The training dataset vectortest
- The testing dataset vectorpublic void binExamples()
public java.util.Vector getTrainCV(int foldnum, double percent)
foldnum
- The fold for which training set is to be constructedpercent
- Percentage of examples to use for training in this foldpublic java.util.Vector getTestCV(int foldnum)
foldnum
- The fold which is to be used as testing datapublic static int findClassID(java.lang.String name)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |