/** * @file RTBRandom.h * @brief random regression tree * @author Sven Sickert * @date 06/19/2013 */ #ifndef RTBRANDOMINCLUDE #define RTBRANDOMINCLUDE #include #include "core/vector/VectorT.h" #include "core/vector/VVector.h" #include "core/basics/Config.h" #include "RegressionTreeBuilder.h" namespace OBJREC { /** random regression tree */ class RTBRandom : public RegressionTreeBuilder { protected: int random_split_tests; int random_features; int max_depth; int min_examples; double minimum_error_reduction; int random_split_mode; /** save indices in leaves */ bool save_indices; enum { RANDOM_SPLIT_INDEX = 0, RANDOM_SPLIT_UNIFORM }; RegressionNode *buildRecursive ( const NICE::VVector & x, const NICE::Vector & y, std::vector & selection, int depth); bool errorReductionLeftRight ( const std::vector< std::pair< double, int > > values, const NICE::Vector & y, double threshold, double & error_left, double & error_right, int & count_left, int & count_right ); public: /** simple constructor */ RTBRandom( const NICE::Config *conf, std::string section = "RTBRandom" ); /** simple destructor */ virtual ~RTBRandom(); RegressionNode *build ( const NICE::VVector & x, const NICE::Vector & y ); }; } // namespace #endif