21 #ifndef _INDIRECT_DECISION_TREE_H
22 #define _INDIRECT_DECISION_TREE_H
32 template<
class DataType>
64 static std::string signature() {
65 return "x-decision-tree";
89 for(
int i =0; i<depth; ++i) std::cout <<
"| ";
92 std::cout <<
"* f[" <<
classifier <<
"] > " <<
th <<
"?\n";
93 right->print(depth+1);
97 std::cout <<
"# " <<
category << std::endl;
101 int classify(
const DataType *features,
long stride)
const {
104 return ( features[
classifier * stride] > th ) ? right->classify(features, stride) : left->
classify(features, stride);
111 inline int operator()(
const DataType *features,
long stride)
const {
Types involved in boosting.
IndirectDecisionTree< DataType > * left
sub-nodes (if null is a leaf)
Definition: IndirectDecisionTree.h:45
int category
if not a node, a category
Definition: IndirectDecisionTree.h:42
int classifier
index to a Binary Classifier
Definition: IndirectDecisionTree.h:37
int classify(const DataType *features, long stride) const
execute classification using the DecisionTree
Definition: IndirectDecisionTree.h:101
DataType th
Classifier Threshold.
Definition: IndirectDecisionTree.h:39
Definition: IndirectDecisionTree.h:33