Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

NormalBayesClassifier classifier is an abstract class

I'm trying to figure out how to use the Normal Bayes Classifier as explained here.

Mat trainingData;
Mat trainingLabels;
Mat evalData;
Mat results;

cv::ml::NormalBayesClassifier classifier;
//Train classifier...
classifier.train(trainingData, trainingLabels);

//Evaluate classifier...
classifier.predict(evalData,&results);

But I get the following build error: cv::ml::NormalBayesClassifier classifier is an abstract class

I tried making a subclass of NormalBayesClassifier and using that instead but I didn't manage.. What am I doing wrong?

click to hide/show revision 2
retagged

updated 2014-09-04 02:14:00 -0600

berak gravatar image

NormalBayesClassifier classifier is an abstract class

I'm trying to figure out how to use the Normal Bayes Classifier as explained here.

Mat trainingData;
Mat trainingLabels;
Mat evalData;
Mat results;

cv::ml::NormalBayesClassifier classifier;
//Train classifier...
classifier.train(trainingData, trainingLabels);

//Evaluate classifier...
classifier.predict(evalData,&results);

But I get the following build error: cv::ml::NormalBayesClassifier classifier is an abstract class

I tried making a subclass of NormalBayesClassifier and using that instead but I didn't manage.. What am I doing wrong?