treelite
param.h
Go to the documentation of this file.
1 
7 #ifndef TREELITE_COMPILER_PARAM_H_
8 #define TREELITE_COMPILER_PARAM_H_
9 
10 #include <dmlc/parameter.h>
11 #include <string>
12 #include <limits>
13 
14 namespace treelite {
15 namespace compiler {
16 
18 struct CompilerParam : public dmlc::Parameter<CompilerParam> {
26  std::string annotate_in;
28  int quantize;
36  int verbose;
38  std::string native_lib_name;
47  // declare parameters
48  DMLC_DECLARE_PARAMETER(CompilerParam) {
49  DMLC_DECLARE_FIELD(annotate_in).set_default("NULL")
50  .describe("Name of model annotation file");
51  DMLC_DECLARE_FIELD(quantize).set_lower_bound(0).set_default(0)
52  .describe("whether to quantize threshold points (0: no, >0: yes)");
53  DMLC_DECLARE_FIELD(parallel_comp).set_lower_bound(0).set_default(0)
54  .describe("option to enable parallel compilation;"
55  "if set to nonzero, the trees will be evely distributed"
56  "into [parallel_comp] files.");
57  DMLC_DECLARE_FIELD(verbose).set_default(0)
58  .describe("if >0, produce extra messages");
59  DMLC_DECLARE_FIELD(native_lib_name).set_default("predictor");
60  DMLC_DECLARE_FIELD(code_folding_req)
61  .set_default(std::numeric_limits<double>::infinity())
62  .set_lower_bound(0);
63  }
64 };
65 
66 } // namespace compiler
67 } // namespace treelite
68 
69 #endif // TREELITE_COMPILER_PARAM_H_
parameters for tree compiler
Definition: param.h:18
std::string native_lib_name
native lib name (without extension)
Definition: param.h:38
std::string annotate_in
name of model annotation file. Use the class treelite.Annotator to generate this file.
Definition: param.h:26
double code_folding_req
parameter for folding rarely visited subtrees (no if/else blocks); all nodes whose data counts are lo...
Definition: param.h:44
int parallel_comp
option to enable parallel compilation; if set to nonzero, the trees will be evely distributed into [p...
Definition: param.h:34
int quantize
whether to quantize threshold points (0: no, >0: yes)
Definition: param.h:28
int verbose
if >0, produce extra messages
Definition: param.h:36