/** * @file RTBMeanPostImprovement.h * @brief regression tree splitting criteria by Taylor and Jones, 1996 * @author Sven Sickert * @date 07/23/2013 */ #ifndef RTBMEANPOSTIMPROVEMENTINCLUDE #define RTBMEANPOSTIMPROVEMENTINCLUDE #include #include "core/vector/VectorT.h" #include "core/vector/VVector.h" #include "core/basics/Config.h" #include "RegressionTreeBuilder.h" namespace OBJREC { /** regression tree splitting criteria by Taylor and Jones, 1996 */ class RTBMeanPostImprovement : public RegressionTreeBuilder { protected: int random_split_tests; int random_features; int max_depth; int min_examples; double minimum_improvement; bool auto_bandwith; /** save indices in leaves */ bool save_indices; RegressionNode *buildRecursive ( const NICE::VVector & x, const NICE::Vector & y, std::vector & selection, int depth); double gaussianVal( const double input, const double bandwidth ); bool improvementLeftRight ( const std::vector< std::pair< double, int > > values, const NICE::Vector & y, double threshold, std::vector & empDist_left, std::vector & empDist_right, int & count_left, int & count_right, double& h, double& p ); public: /** simple constructor */ RTBMeanPostImprovement( const NICE::Config *conf, std::string section = "RTBMeanPostImprovement" ); /** simple destructor */ virtual ~RTBMeanPostImprovement(); RegressionNode *build ( const NICE::VVector & x, const NICE::Vector & y ); }; } // namespace #endif