12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #ifndef DECISIONNODEINCLUDE
- #define DECISIONNODEINCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include <map>
- #include <limits>
- #include "vislearning/cbaselib/Feature.h"
- #include "vislearning/math/mathbase/FullVector.h"
- namespace OBJREC {
- class DecisionNode
- {
- public:
-
- double threshold;
-
- double counter;
-
- Feature *f;
-
- FullVector distribution;
-
- DecisionNode *left;
-
- DecisionNode *right;
-
- std::vector<int> trainExamplesIndices;
- public:
-
- DecisionNode ();
-
-
- DecisionNode *getLeafNode ( const Example & ce, int depth = std::numeric_limits<int>::max() );
-
- void traverse ( const Example & ce, FullVector & distribution );
-
-
- void statistics ( int & depth, int & count ) const;
-
-
- virtual ~DecisionNode();
-
-
- void indexDescendants ( std::map<DecisionNode *, std::pair<long, int> > & index,
- long & maxindex,
- int depth ) const;
-
- void resetCounters ();
-
- void copy ( DecisionNode *node );
-
- bool isLeaf () const;
-
- };
- }
- #endif
|