Treelite
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
Model Class Referenceabstract

thin wrapper for tree ensemble model More...

#include <tree.h>

Inheritance diagram for Model:
Inheritance graph
[legend]
Collaboration diagram for Model:
Collaboration graph
[legend]

Public Member Functions

 Model ()
 disable copy; use default move
 
 Model (const Model &)=delete
 
Modeloperator= (const Model &)=delete
 
 Model (Model &&)=default
 
Modeloperator= (Model &&)=default
 
TypeInfo GetThresholdType () const
 
TypeInfo GetLeafOutputType () const
 
template<typename Func >
auto Dispatch (Func func)
 
template<typename Func >
auto Dispatch (Func func) const
 
virtual std::size_t GetNumTree () const =0
 
virtual void SetTreeLimit (std::size_t limit)=0
 
virtual void DumpAsJSON (std::ostream &fo, bool pretty_print) const =0
 
std::string DumpAsJSON (bool pretty_print) const
 
TREELITE_DLL_EXPORT std::vector< PyBufferFrameGetPyBuffer ()
 
void SerializeToFile (FILE *dest_fp)
 

Static Public Member Functions

template<typename ThresholdType , typename LeafOutputType >
static std::unique_ptr< ModelCreate ()
 
static std::unique_ptr< ModelCreate (TypeInfo threshold_type, TypeInfo leaf_output_type)
 
static TREELITE_DLL_EXPORT std::unique_ptr< ModelCreateFromPyBuffer (std::vector< PyBufferFrame > frames)
 
static std::unique_ptr< ModelDeserializeFromFile (FILE *src_fp)
 

Public Attributes

int32_t num_feature {0}
 number of features used for the model. It is assumed that all feature indices are between 0 and [num_feature]-1.
 
TaskType task_type
 Task type.
 
bool average_tree_output {false}
 whether to average tree outputs
 
TaskParam task_param {}
 Group of parameters that are specific to the particular task type.
 
ModelParam param {}
 extra parameters
 

Protected Attributes

uint64_t num_tree_ {0}
 
int32_t num_opt_field_per_model_ {0}
 
int32_t major_ver_
 
int32_t minor_ver_
 
int32_t patch_ver_
 

Detailed Description

thin wrapper for tree ensemble model

Definition at line 734 of file tree.h.


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