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 <istream>
13 #include <ostream>
14 #include <vector>
15 #include <cstdio>
16 #include <cstdint>
17 
18 namespace treelite {
19 
22  public:
31  void Annotate(const Model& model, const DMatrix* dmat, int nthread, int verbose);
36  void Load(std::istream& fi);
41  void Save(std::ostream& fo) const;
55  inline std::vector<std::vector<uint64_t>> Get() const {
56  return counts_;
57  }
58 
59  private:
60  std::vector<std::vector<uint64_t>> counts_;
61 };
62 
63 } // namespace treelite
64 
65 #endif // TREELITE_ANNOTATOR_H_
branch annotator class
Definition: annotator.h:21
void Save(std::ostream &fo) const
save branch annotation to a JSON file
Definition: annotator.cc:264
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:237
model structure for tree ensemble
std::vector< std::vector< uint64_t > > Get() const
fetch branch annotation. Usage example:
Definition: annotator.h:55
thin wrapper for tree ensemble model
Definition: tree.h:734
void Load(std::istream &fi)
load branch annotation from a JSON file
Definition: annotator.cc:245