Logo ROOT  
Reference Guide
TMVA::Experimental::BranchlessTree< T > Class Template Reference

template<typename T>
class TMVA::Experimental::BranchlessTree< T >

Branchless representation of a decision tree using topological ordering.

Template Parameters
TValue type for the computation (usually floating point type)

Definition at line 62 of file BranchlessTree.hxx.

Public Member Functions

void FillSparse ()
 Fill nodes of a sparse tree forming a full tree. More...
 
std::string GetInferenceCode (const std::string &funcName, const std::string &typeName)
 Get code for compiling the inference function of the branchless tree with the current thresholds and cut variables. More...
 
Inference (const T *input, const int stride)
 Perform inference on a single input vector. More...
 

Public Attributes

std::vector< int > fInputs
 Cut variables / inputs. More...
 
std::vector< T > fThresholds
 Cut thresholds or scores if corresponding node is a leaf. More...
 
int fTreeDepth
 Depth of the tree. More...
 

#include <TMVA/TreeInference/BranchlessTree.hxx>

Member Function Documentation

◆ FillSparse()

template<typename T >
void TMVA::Experimental::BranchlessTree< T >::FillSparse
inline

Fill nodes of a sparse tree forming a full tree.

Sparse parts of the tree are marked with -1 values in the feature vector. The algorithm fills these parts up with the last threshold value so that the result of the inference stays the same but the computation always traverses the full tree, which is needed to avoid branching logic.

Definition at line 93 of file BranchlessTree.hxx.

◆ GetInferenceCode()

template<typename T >
std::string TMVA::Experimental::BranchlessTree< T >::GetInferenceCode ( const std::string &  funcName,
const std::string &  typeName 
)
inline

Get code for compiling the inference function of the branchless tree with the current thresholds and cut variables.

Parameters
[in]funcNameName of the function
[in]typeNameName of the type used for the computation
[out]Codeof the inference function as string

Definition at line 110 of file BranchlessTree.hxx.

◆ Inference()

template<typename T >
T TMVA::Experimental::BranchlessTree< T >::Inference ( const T *  input,
const int  stride 
)
inline

Perform inference on a single input vector.

Parameters
[in]inputPointer to data containing the input values
[in]strideStride to go from one input variable to the next one
[out]Treescore, result of the inference

Definition at line 77 of file BranchlessTree.hxx.

Member Data Documentation

◆ fInputs

template<typename T >
std::vector<int> TMVA::Experimental::BranchlessTree< T >::fInputs

Cut variables / inputs.

Definition at line 65 of file BranchlessTree.hxx.

◆ fThresholds

template<typename T >
std::vector<T> TMVA::Experimental::BranchlessTree< T >::fThresholds

Cut thresholds or scores if corresponding node is a leaf.

Definition at line 64 of file BranchlessTree.hxx.

◆ fTreeDepth

template<typename T >
int TMVA::Experimental::BranchlessTree< T >::fTreeDepth

Depth of the tree.

Definition at line 63 of file BranchlessTree.hxx.

Collaboration diagram for TMVA::Experimental::BranchlessTree< T >:
[legend]

The documentation for this class was generated from the following file: