Public Member Functions |
| RandomTree (const size_t &nodeId, const int level, const std::vector< const Instance * > &samples, size_t numClasses, const boost::shared_ptr< RandomTree< Instance, FeatureFunction > > &parent=boost::shared_ptr< RandomTree< Instance, FeatureFunction > >()) |
| create a sub-tree at the given level and nodeId using samples provided
|
| RandomTree (const size_t &nodeId, const int level, const boost::shared_ptr< RandomTree< Instance, FeatureFunction > > &parent, const std::vector< WeightType > &histogram) |
| create a sub-tree at the given level and nodeId using the histogram provided
|
bool | hasPureHistogram () const |
| returns true iff the entropy is zero
|
size_t | getNumClasses () const |
void | collectNodeIndices (const Instance &instance, std::set< unsigned int > &nodeSet, bool includeRoot) const |
| For a given instance, collect the set of all nodes this sample traverses through.
|
void | collectLeafNodes (std::vector< size_t > &leafSet) |
| collect all leaf nodes
|
LabelType | classify (const Instance &instance) const |
| Classify an instance by traversing the tree and returning the tree leaf nodes leaf class.
|
const cuv::ndarray< double,
cuv::host_memory_space > & | classifySoft (const Instance &instance) const |
size_t | getNumTrainSamples () const |
const std::map< std::string,
double > & | getTimerValues () const |
const std::map< std::string,
std::string > & | getTimerAnnotations () const |
void | setTimerValue (const std::string &key, utils::Timer &timer) |
| set the timer value used when profiling
|
template<class V > |
void | setTimerAnnotation (const std::string &key, const V &annotation) |
| set the timer annotation
|
void | addTimerValue (const std::string &key, utils::Timer &timer) |
| add the given timer seconds
|
void | setTimerValue (const std::string &key, const double timeInSeconds) |
| set a timer to the given seconds
|
void | addTimerValue (const std::string &key, const double timeInSeconds) |
| add the given seconds to the timer
|
boost::shared_ptr< const
RandomTree< Instance,
FeatureFunction > > | getLeft () const |
boost::shared_ptr< const
RandomTree< Instance,
FeatureFunction > > | getRight () const |
int | getLevel () const |
bool | isRoot () const |
const RandomTree< Instance,
FeatureFunction > * | getRoot () const |
void | countFeatures (std::map< std::string, size_t > &featureCounts) const |
size_t | countNodes () const |
size_t | countLeafNodes () const |
size_t | getTreeDepth () const |
void | addChildren (const SplitFunction< Instance, FeatureFunction > &split, boost::shared_ptr< RandomTree< Instance, FeatureFunction > > left, boost::shared_ptr< RandomTree< Instance, FeatureFunction > > right) |
| Links the given left/right subtrees as children to this one.
|
bool | isLeaf () const |
const SplitFunction< Instance,
FeatureFunction > & | getSplit () const |
size_t | getNodeId () const |
size_t | getTreeId () const |
void | normalizeHistograms (const cuv::ndarray< WeightType, cuv::host_memory_space > &priorDistribution, const double histogramBias) |
| normalize the histograms of the tree and its branches
|
const cuv::ndarray< WeightType,
cuv::host_memory_space > & | getHistogram () const |
const cuv::ndarray< double,
cuv::host_memory_space > & | getNormalizedHistogram () const |
const std::vector< Instance > & | getTrainSamples () const |
void | setAllPixelsHistogram (size_t label, double value) |
| add the passed value to the label histogram count
|
const RandomTree< Instance,
FeatureFunction > * | setAllPixelsHistogram (const Instance &instance) |
| traverses the tree to the leaf then increments the instance label's histogram
|
void | updateHistograms () |
| copies the values of allPixelsHistgrams into histograms
|
void | recomputeHistogramNoFlipping (const std::vector< const Instance * > &samples) |
| recomputes the correct histograms, they were changed when checking for flipped features
|
template<class Instance, class FeatureFunction>
class curfil::RandomTree< Instance, FeatureFunction >
A sub-tree with histograms and pointers to the parent and children.
Definition at line 472 of file random_tree.h.