Commit cbb6aa02 authored by Adrien Dorsaz's avatar Adrien Dorsaz

Display debug info only if DEBUG is specified

parent 8b3758d6
......@@ -44,9 +44,11 @@ QString NaiveBayesClassifier::classify(QMap<double, double> *featureSet){
}
}
/*foreach(QString klass, classProbability->keys()){
qDebug()<<"Finally class "<<klass<<" has prob. "<<classProbability->value(klass)<< " and size "<<_trainedClasses->value(klass)->size();
}*/
#ifdef DEBUG
foreach(QString klass, classProbability->keys()){
qDebug()<<"NaiveBayesClassifier : Finally class "<<klass<<" has prob. "<<classProbability->value(klass)<< " and size "<<_trainedClasses->value(klass)->size();
}
#endif
QString resultClass="";
......@@ -99,7 +101,9 @@ QMap<double, double>& NaiveBayesClassifier::getTotalFeatureOccurences() const{
}
QDataStream &operator<<(QDataStream &out, const NaiveBayesClassifier &naiveBayes){
qDebug()<<"size : "<<naiveBayes._trainedClasses->size();
#ifdef DEBUG
qDebug()<<"NaiveBayesClassifier : size of _trainedClasses : "<<naiveBayes._trainedClasses->size();
#endif
out<<naiveBayes._trainedClasses->size();
foreach(QString klass, naiveBayes._trainedClasses->keys()){
......
......@@ -11,7 +11,10 @@ http://www.nils-haldenwang.de/computer-science/machine-learning/how-to-apply-nai
#include <math.h>
#include <QObject>
#include <QDataStream>
#include <QDebug>
#ifdef DEBUG
#include <QDebug>
#endif
class NaiveBayesClassifier: public QObject{
Q_OBJECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment