treelite
annotator.h
Go to the documentation of this file.
1 
7 #ifndef TREELITE_ANNOTATOR_H_
8 #define TREELITE_ANNOTATOR_H_
9 
10 #include <treelite/tree.h>
11 #include <treelite/data.h>
12 
13 namespace treelite {
14 
17  public:
26  void Annotate(const Model& model, const DMatrix* dmat,
27  int nthread, int verbose);
32  void Load(dmlc::Stream* fi);
37  void Save(dmlc::Stream* fo) const;
51  inline std::vector<std::vector<size_t>> Get() const {
52  return counts;
53  }
54  private:
55  std::vector<std::vector<size_t>> counts;
56 };
57 
58 } // namespace treelite
59 
60 #endif // TREELITE_ANNOTATOR_H_
branch annotator class
Definition: annotator.h:16
thin wrapper for tree ensemble model
Definition: tree.h:350
Input data structure of treelite.
void Annotate(const Model &model, const DMatrix *dmat, int nthread, int verbose)
annotate branches in a given model using frequency patterns in the training data. The annotation can ...
Definition: annotator.cc:96
model structure for tree
std::vector< std::vector< size_t > > Get() const
fetch branch annotation. Usage example:
Definition: annotator.h:51
a simple data matrix in CSR (Compressed Sparse Row) storage
Definition: data.h:15
void Load(dmlc::Stream *fi)
load branch annotation from a JSON file
Definition: annotator.cc:139
void Save(dmlc::Stream *fo) const
save branch annotation to a JSON file
Definition: annotator.cc:146