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,
28  int nthread, int verbose);
33  void Load(dmlc::Stream* fi);
38  void Save(dmlc::Stream* fo) const;
52  inline std::vector<std::vector<size_t>> Get() const {
53  return counts;
54  }
55 
56  private:
57  std::vector<std::vector<size_t>> counts;
58 };
59 
60 } // namespace treelite
61 
62 #endif // TREELITE_ANNOTATOR_H_
branch annotator class
Definition: annotator.h:17
thin wrapper for tree ensemble model
Definition: tree.h:415
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:95
model structure for tree
std::vector< std::vector< size_t > > Get() const
fetch branch annotation. Usage example:
Definition: annotator.h:52
a simple data matrix in CSR (Compressed Sparse Row) storage
Definition: data.h:16
void Load(dmlc::Stream *fi)
load branch annotation from a JSON file
Definition: annotator.cc:138
void Save(dmlc::Stream *fo) const
save branch annotation to a JSON file
Definition: annotator.cc:145