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 #include <vector>
13 
14 namespace treelite {
15 
18  public:
27  void Annotate(const Model& model, const DMatrix* dmat, 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 
55  private:
56  std::vector<std::vector<size_t>> counts;
57 };
58 
59 } // namespace treelite
60 
61 #endif // TREELITE_ANNOTATOR_H_
branch annotator class
Definition: annotator.h:17
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:233
model structure for tree ensemble
std::vector< std::vector< size_t > > Get() const
fetch branch annotation. Usage example:
Definition: annotator.h:51
void Save(dmlc::Stream *fo) const
save branch annotation to a JSON file
Definition: annotator.cc:248
void Load(dmlc::Stream *fi)
load branch annotation from a JSON file
Definition: annotator.cc:241
thin wrapper for tree ensemble model
Definition: tree.h:615