pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::SurrogateTree Struct Reference

A fitted tree. nodes[0] is the root. More...

#include <surrogate_tree.hpp>

Public Member Functions

int leaf (const std::vector< float > &x) const
 The leaf x falls in.
 
double predict (const std::vector< float > &x) const
 The leaf's value: a class index, or the predicted target.
 
int depth () const
 
int64_t leaves () const
 

Public Attributes

SurrogateTask task = SurrogateTask::Classification
 
int64_t num_features = 0
 
int64_t num_classes = 0
 Classification: the number of classes (the model's output size).
 
std::vector< SurrogateNode > nodes
 

Detailed Description

A fitted tree. nodes[0] is the root.

Member Function Documentation

◆ depth()

int pulsatrix::SurrogateTree::depth ( ) const

◆ leaf()

int pulsatrix::SurrogateTree::leaf ( const std::vector< float > &  x) const

The leaf x falls in.

Exceptions
std::invalid_argumentif x has the wrong size.

◆ leaves()

int64_t pulsatrix::SurrogateTree::leaves ( ) const

◆ predict()

double pulsatrix::SurrogateTree::predict ( const std::vector< float > &  x) const

The leaf's value: a class index, or the predicted target.

Member Data Documentation

◆ nodes

std::vector<SurrogateNode> pulsatrix::SurrogateTree::nodes

◆ num_classes

int64_t pulsatrix::SurrogateTree::num_classes = 0

Classification: the number of classes (the model's output size).

◆ num_features

int64_t pulsatrix::SurrogateTree::num_features = 0

◆ task

SurrogateTask pulsatrix::SurrogateTree::task = SurrogateTask::Classification

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