|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef MVAUtils_Forest_H
6 #define MVAUtils_Forest_H
34 inline std::vector<index_t>
computeRight(
const std::vector<int>& vars);
52 template<
typename Node_t>
57 unsigned int itree)
const override final;
59 unsigned int itree)
const override final;
63 virtual float GetOffset()
const override {
return 0.; }
68 const std::vector<float>&
values)
const override final;
70 const std::vector<float*>&
pointers)
const override final;
76 const std::vector<float>&
values)
const override;
78 const std::vector<float*>&
pointers)
const override;
87 const std::vector<float>&
values,
88 unsigned int numClasses)
const override;
92 unsigned int numClasses)
const override;
101 virtual void PrintTree(
unsigned int itree)
const override;
104 std::vector<Node_t>
GetTree(
unsigned int itree)
const;
114 void newTree(
const std::vector<Node_t>& nodes);
float GetTreeResponseFromNode(const std::vector< float > &values, index_t index) const
Get the response of a tree.
virtual float GetRawResponse(const std::vector< float > &values) const override final
Return the response of the whole Forest.
virtual float GetResponse(const std::vector< float > &values) const override
Compute the prediction for regression.
virtual float GetOffset() const override
Return the offset of the forest.
std::vector< Node_t > GetTree(unsigned int itree) const
Return the vector of nodes for the tree itree.
bool const RAWDATA *ch2 const
std::vector< index_t > computeRight(const std::vector< int > &vars)
Compute the offsets between the nodes to their right children from a serialized representation of the...
float GetTreeResponseFromNode(const std::vector< float * > &pointers, index_t index) const
virtual std::vector< float > GetMultiResponse(const std::vector< float * > &pointers, unsigned int numClasses) const override
virtual unsigned int GetNTrees() const override final
std::vector< index_t > m_forest
indices of the top-level nodes of each tree
void newTree(const std::vector< Node_t > &nodes)
append a new tree (defined by a vector of nodes serialized in preorder) to the forest
virtual float GetTreeResponse(const std::vector< float * > &pointers, unsigned int itree) const override final
Generic Forest base class.
int32_t index_t
The index type of the node in the vector.
virtual void PrintForest() const override
void applySoftmax(Container_t &x)
apply softmax to the input: {exp[xi] / sum(exp[xj]) for xi in x}
virtual std::vector< float > GetMultiResponse(const std::vector< float > &values, unsigned int numClasses) const override
Compute the prediction for multiclassification (a score for each class).
Compute the response from the binary trees in the forest.
virtual float GetRawResponse(const std::vector< float * > &pointers) const override final
std::vector< T * > pointers(std::vector< T > &v)
std::vector< Node_t > m_nodes
where the nodes of the forest are stored
virtual float GetResponse(const std::vector< float * > &pointers) const override
virtual float GetTreeResponse(const std::vector< float > &values, unsigned int itree) const override final
Return the response of one tree Must pass the features in a std::vector<float> values and the index o...
virtual void PrintTree(unsigned int itree) const override