Commit 108ab940 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

improved naive bayes robustness in the case of singular data

parent 51d03994
......@@ -259,7 +259,7 @@ bool CvNormalBayesClassifier::train( const CvMat* _train_data, const CvMat* _res
det *= w->data.db[j];
CV_CALL( cvDiv( NULL, w, w ));
c->data.db[cls] = log( det );
c->data.db[cls] = det > 0 ? log(det) : -700;
}
result = true;
......
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