Search in sources :

Example 1 with DatasetClassifierTeacher

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

the class ScoreNormalizationFilter method train.

/**
	 * Trains a classifier using the given training data, features and model.
	 * 
	 * @param serializedDir directory containing serialized results
	 * @param features selected features
	 * @param model selected model
	 * @return trained classifier
	 */
public static Classifier train(String serializedDir, String[] features, String model) {
    // create training set with given features from serialized results
    Dataset trainingSet = createDataset(features, serializedDir);
    // create learner for given model
    ClassifierLearner learner = createLearner(model);
    // train classifier
    Classifier classifier = new DatasetClassifierTeacher(trainingSet).train(learner);
    return classifier;
}
Also used : ClassifierLearner(edu.cmu.minorthird.classify.ClassifierLearner) BasicDataset(edu.cmu.minorthird.classify.BasicDataset) CrossValidatedDataset(edu.cmu.minorthird.classify.experiments.CrossValidatedDataset) Dataset(edu.cmu.minorthird.classify.Dataset) Classifier(edu.cmu.minorthird.classify.Classifier) DatasetClassifierTeacher(edu.cmu.minorthird.classify.DatasetClassifierTeacher)

Example 2 with DatasetClassifierTeacher

use of edu.cmu.minorthird.classify.DatasetClassifierTeacher 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)

Aggregations

ClassifierLearner (edu.cmu.minorthird.classify.ClassifierLearner)2 DatasetClassifierTeacher (edu.cmu.minorthird.classify.DatasetClassifierTeacher)2 BasicDataset (edu.cmu.minorthird.classify.BasicDataset)1 Classifier (edu.cmu.minorthird.classify.Classifier)1 Dataset (edu.cmu.minorthird.classify.Dataset)1 CrossValidatedDataset (edu.cmu.minorthird.classify.experiments.CrossValidatedDataset)1