DecisionTreeBuilder.cpp 836 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * @file DecisionTreeBuilder.cpp
  3. * @brief build decision trees
  4. * @author Erik Rodner
  5. * @date 05/06/2008
  6. */
  7. #include <iostream>
  8. #include "vislearning/classifier/fpclassifier/randomforest/DecisionTreeBuilder.h"
  9. using namespace OBJREC;
  10. using namespace std;
  11. // refactor-nice.pl: check this substitution
  12. // old: using namespace ice;
  13. using namespace NICE;
  14. DecisionTreeBuilder::DecisionTreeBuilder()
  15. {
  16. }
  17. DecisionTreeBuilder::~DecisionTreeBuilder()
  18. {
  19. }
  20. void DecisionTreeBuilder::build ( DecisionTree & tree, const FeaturePool & fp,
  21. const Examples & examples, int maxClassNo )
  22. {
  23. DecisionNode *root = build ( fp, examples, maxClassNo );
  24. tree.setRoot(root);
  25. int depth, count;
  26. tree.statistics ( depth, count );
  27. fprintf (stderr, "DecisionTree: maximum depth = %d, number of nodes = %d\n", depth, count );
  28. }