edu.stanford.nlp.classify
Class CrossValidator
java.lang.Object
edu.stanford.nlp.classify.CrossValidator
public class CrossValidator
- extends Object
This class is meant to simplify performing cross validation on
classifiers for hyper-parameters. It has the ability to save
state for each fold (for instance, the weights for a MaxEnt
classifier, and the alphas for an SVM).
- Author:
- Aria Haghighi, Jenny Finkel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CrossValidator
public CrossValidator(GeneralDataset trainData)
CrossValidator
public CrossValidator(GeneralDataset trainData,
int kfold)
computeAverage
public double computeAverage(Function<Triple<GeneralDataset,GeneralDataset,CrossValidator.SavedState>,Double> function)
- This computes the average over all folds of the function we're trying to optimize.
The input triple contains, in order, the train set, the test set, and the saved state.
You don't have to use the saved state if you don't want to.
main
public static void main(String[] args)
Stanford NLP Group