Search in sources :

Example 6 with ClassifierLearner

use of edu.cmu.minorthird.classify.ClassifierLearner in project lucida by claritylab.

the class HierarchicalClassifierTrainer method trainClassifier.

public void trainClassifier() {
    runTime = System.currentTimeMillis();
    ClassifierLearner learner = createHierarchicalClassifierLearner(learnerNames);
    classifier = new DatasetClassifierTeacher(trainingSet).train(learner);
    runTime = System.currentTimeMillis() - runTime;
}
Also used : ClassifierLearner(edu.cmu.minorthird.classify.ClassifierLearner) DatasetClassifierTeacher(edu.cmu.minorthird.classify.DatasetClassifierTeacher)

Example 7 with ClassifierLearner

use of edu.cmu.minorthird.classify.ClassifierLearner in project lucida by claritylab.

the class HierarchicalClassifierTrainer method runExperiment.

public Evaluation runExperiment() {
    runTime = System.currentTimeMillis();
    ClassifierLearner learner = createHierarchicalClassifierLearner(learnerNames);
    if (crossValidationFolds < 0) {
        evaluation = Tester.evaluate(learner, trainingSet, testingSet);
    } else {
        Splitter splitter = new CrossValSplitter(new RandomElement(System.currentTimeMillis()), crossValidationFolds);
        cvDataset = new CrossValidatedDataset(learner, trainingSet, splitter, true);
        evaluation = cvDataset.getEvaluation();
    //remove later
    //ViewerFrame frame=new ViewerFrame(trainingFile,cvDataset.toGUI());
    //frame.setVisible(true);
    //evaluation=Tester.evaluate(learner,trainingSet,splitter);
    }
    runTime = System.currentTimeMillis() - runTime;
    return evaluation;
}
Also used : ClassifierLearner(edu.cmu.minorthird.classify.ClassifierLearner) CrossValidatedDataset(edu.cmu.minorthird.classify.experiments.CrossValidatedDataset) Splitter(edu.cmu.minorthird.classify.Splitter) CrossValSplitter(edu.cmu.minorthird.classify.experiments.CrossValSplitter) CrossValSplitter(edu.cmu.minorthird.classify.experiments.CrossValSplitter) RandomElement(edu.cmu.minorthird.classify.algorithms.random.RandomElement)

Aggregations

ClassifierLearner (edu.cmu.minorthird.classify.ClassifierLearner)7 CrossValidatedDataset (edu.cmu.minorthird.classify.experiments.CrossValidatedDataset)3 BasicDataset (edu.cmu.minorthird.classify.BasicDataset)2 Dataset (edu.cmu.minorthird.classify.Dataset)2 DatasetClassifierTeacher (edu.cmu.minorthird.classify.DatasetClassifierTeacher)2 Splitter (edu.cmu.minorthird.classify.Splitter)2 RandomElement (edu.cmu.minorthird.classify.algorithms.random.RandomElement)2 CrossValSplitter (edu.cmu.minorthird.classify.experiments.CrossValSplitter)2 CascadingBinaryLearner (edu.cmu.minorthird.classify.CascadingBinaryLearner)1 ClassLabel (edu.cmu.minorthird.classify.ClassLabel)1 Classifier (edu.cmu.minorthird.classify.Classifier)1 Example (edu.cmu.minorthird.classify.Example)1 ExampleSchema (edu.cmu.minorthird.classify.ExampleSchema)1 MostFrequentFirstLearner (edu.cmu.minorthird.classify.MostFrequentFirstLearner)1 OneVsAllLearner (edu.cmu.minorthird.classify.OneVsAllLearner)1 KnnLearner (edu.cmu.minorthird.classify.algorithms.knn.KnnLearner)1 BalancedWinnow (edu.cmu.minorthird.classify.algorithms.linear.BalancedWinnow)1 KWayMixtureLearner (edu.cmu.minorthird.classify.algorithms.linear.KWayMixtureLearner)1 MarginPerceptron (edu.cmu.minorthird.classify.algorithms.linear.MarginPerceptron)1 MaxEntLearner (edu.cmu.minorthird.classify.algorithms.linear.MaxEntLearner)1