Commit f08969ed authored by Gary Bradski's avatar Gary Bradski

slight bug fix, docs

parent 58ec89f7
...@@ -2,19 +2,25 @@ ...@@ -2,19 +2,25 @@
#include "opencv2/ml/ml.hpp" #include "opencv2/ml/ml.hpp"
#include <stdio.h> #include <stdio.h>
/* void help()
The sample demonstrates how to build a decision tree for classifying mushrooms. {
It uses the sample base agaricus-lepiota.data from UCI Repository, here is the link: printf("\nThis program demonstrated the use of OpenCV's decision tree function for learning and predicting data\n"
"Call:\n"
Newman, D.J. & Hettich, S. & Blake, C.L. & Merz, C.J. (1998). "./mushroom <path to agaricus-lepiota.data>\n");
UCI Repository of machine learning databases printf("\n"
[http://www.ics.uci.edu/~mlearn/MLRepository.html]. "The sample demonstrates how to build a decision tree for classifying mushrooms.\n"
Irvine, CA: University of California, Department of Information and Computer Science. "It uses the sample base agaricus-lepiota.data from UCI Repository, here is the link:\n"
*/ "\n"
"Newman, D.J. & Hettich, S. & Blake, C.L. & Merz, C.J. (1998).\n"
// loads the mushroom database, which is a text file, containing "UCI Repository of machine learning databases\n"
// one training sample per row, all the input variables and the output variable are categorical, "[http://www.ics.uci.edu/~mlearn/MLRepository.html].\n"
// the values are encoded by characters. "Irvine, CA: University of California, Department of Information and Computer Science.\n"
"\n"
"// loads the mushroom database, which is a text file, containing\n"
"// one training sample per row, all the input variables and the output variable are categorical,\n"
"// the values are encoded by characters.\n\n");
}
int mushroom_read_database( const char* filename, CvMat** data, CvMat** missing, CvMat** responses ) int mushroom_read_database( const char* filename, CvMat** data, CvMat** missing, CvMat** responses )
{ {
const int M = 1024; const int M = 1024;
...@@ -294,9 +300,8 @@ int main( int argc, char** argv ) ...@@ -294,9 +300,8 @@ int main( int argc, char** argv )
if( !mushroom_read_database( base_path, &data, &missing, &responses ) ) if( !mushroom_read_database( base_path, &data, &missing, &responses ) )
{ {
printf( "Unable to load the training database\n" printf( "\nUnable to load the training database\n\n");
"Pass it as a parameter: dtree <path to agaricus-lepiota.data>\n" ); help();
return 0;
return -1; return -1;
} }
......
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