Search in sources :

Example 1 with NaiveBayes

use of weka.classifiers.bayes.NaiveBayes in project dkpro-tc by dkpro.

the class WekaArffTest method main.

/**
 * @param args
 * @throws Exception
 */
public static void main(String[] args) throws Exception {
    File train = new File("src/main/resources/arff/manyInstances/train.arff.gz");
    File test = new File("src/main/resources/arff/manyInstances/test.arff.gz");
    Instances trainData = WekaUtils.getInstances(train, false);
    Instances testData = WekaUtils.getInstances(test, false);
    Classifier cl = new NaiveBayes();
    // no problems until here
    Evaluation eval = new Evaluation(trainData);
    eval.evaluateModel(cl, testData);
}
Also used : Instances(weka.core.Instances) NaiveBayes(weka.classifiers.bayes.NaiveBayes) Evaluation(weka.classifiers.Evaluation) Classifier(weka.classifiers.Classifier) File(java.io.File)

Aggregations

File (java.io.File)1 Classifier (weka.classifiers.Classifier)1 Evaluation (weka.classifiers.Evaluation)1 NaiveBayes (weka.classifiers.bayes.NaiveBayes)1 Instances (weka.core.Instances)1