RTBClusterRandom.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @file RTBClusterRandom.h
  3. * @brief random regression tree
  4. * @author Sven Sickert
  5. * @date 07/19/2013
  6. */
  7. #ifndef RTBCLUSTERRANDOMINCLUDE
  8. #define RTBCLUSTERRANDOMINCLUDE
  9. #include <vector>
  10. #include "core/vector/VectorT.h"
  11. #include "core/vector/VVector.h"
  12. #include "core/basics/Config.h"
  13. #include "RegressionTreeBuilder.h"
  14. namespace OBJREC {
  15. /** random regression tree */
  16. class RTBClusterRandom : public RegressionTreeBuilder
  17. {
  18. protected:
  19. int max_depth;
  20. int min_examples;
  21. /** save indices in leaves */
  22. bool save_indices;
  23. RegressionNode *buildRecursive ( const NICE::VVector & x,
  24. const NICE::Vector & y,
  25. std::vector<int> & selection,
  26. int depth);
  27. bool balancingLeftRight ( const std::vector< std::pair< double, int > > values,
  28. double threshold,
  29. int & count_left,
  30. int & count_right );
  31. public:
  32. /** simple constructor */
  33. RTBClusterRandom( const NICE::Config *conf, std::string section = "RTBClusterRandom" );
  34. /** simple destructor */
  35. virtual ~RTBClusterRandom();
  36. RegressionNode *build ( const NICE::VVector & x,
  37. const NICE::Vector & y );
  38. };
  39. }
  40. #endif