1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- #ifndef DECISIONNODEINCLUDE
- #define DECISIONNODEINCLUDE
- #include "core/vector/VectorT.h"
- #include "core/vector/MatrixT.h"
- #include "core/image/ImageT.h"
- #include "core/imagedisplay/ImageDisplay.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
|