1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef REGRESSIONNODEINCLUDE
- #define REGRESSIONNODEINCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include <map>
- #include <limits>
- namespace OBJREC {
-
- class RegressionNode
- {
- protected:
-
- public:
-
-
- double threshold;
-
-
- double counter;
-
-
- int f;
-
-
- double lsError;
-
-
- double predVal;
-
- RegressionNode *left;
-
- RegressionNode *right;
-
-
- std::vector<int> trainExamplesIndices;
-
- RegressionNode ();
-
-
- virtual ~RegressionNode();
-
-
- RegressionNode *getLeafNode ( const NICE::Vector & x,
- int depth = std::numeric_limits<int>::max() );
-
- void traverse ( const NICE::Vector & x,
- double & predVal );
-
-
- void statistics ( int & depth, int & count ) const;
-
-
- void indexDescendants ( std::map<RegressionNode *,
- std::pair<long, int> > & index,
- long & maxindex,
- int depth ) const;
-
- void nodePrediction( const NICE::Vector & y,
- const std::vector<int> & selection);
-
-
- void resetCounters ();
-
- void copy ( RegressionNode *node );
-
- bool isLeaf () const;
- };
-
-
- }
- #endif
|