hN_Unc2020_EV3Down_BDTRwgt_Nu.h
Go to the documentation of this file.
1 
2 // ----------------------------------------------
3 //
4 // WARNING: AUTOGENERATED CODE -- DO NOT EDIT
5 // Created using treelite from an xgboost model
6 // in ConvertModel.py.
7 //
8 // ----------------------------------------------
9 
10 #ifndef HN_UNC2020_EV3DOWN_BDTRWGT_NU_H
11 #define HN_UNC2020_EV3DOWN_BDTRWGT_NU_H
12 
13 #include <cmath>
14 
15 #include "NOvARwgt/util/BDTReweighter.h"
16 
17 namespace novarwgt
18 {
19  /// Autogenerated class wrapping a BDT-based reweighter.
20  ///
21  /// The predict() method requires an array of the 'features' (as BDTReweighterFeature objects)
22  /// that the BDT was trained with, passed IN THE SAME ORDER as they appeared in the training set.
23  /// They are (idx --> name):
24  /// 0 --> A
25  /// 1 --> hitnuc
26  /// 2 --> cc
27  /// 3 --> neu
28  /// 4 --> Ev
29  /// 5 --> Q2
30  /// 6 --> W
31  /// 7 --> y
32  /// 8 --> nN
33  /// 9 --> nP
34  /// 10 --> npi0
35  /// 11 --> npim
36  /// 12 --> npip
37  /// 13 --> eN
38  /// 14 --> eP
39  /// 15 --> epi0
40  /// 16 --> epim
41  /// 17 --> epip
42  class hN_Unc2020_EV3Down_BDTRwgt_Nu : public novarwgt::BDTReweighter
43  {
44  public:
45  // inherit the constructor
46  using BDTReweighter::BDTReweighter;
47 
48  // --------------------------------------------
49  // treelite generated model code begins here...
50 
51  virtual ~hN_Unc2020_EV3Down_BDTRwgt_Nu() = default;
52 
53 
54  std::size_t get_num_output_group(void) {
55  return 1;
56  }
57 
58  std::size_t get_num_feature(void) {
59  return 18;
60  }
61 
62  static inline float pred_transform(float margin) {
63  const float alpha = (float)1;
64  return 1.0f / (1 + expf(-alpha * margin));
65  }
66 
67  float predict(union BDTReweighterFeature* data, int pred_margin) ;
68 
69  // treelite generated model code ends here...
70  // --------------------------------------------
71 
72  };
73 }
74 
75 #endif
float predict(union BDTReweighterFeature *data, int pred_margin)
const XML_Char const XML_Char * data
Definition: expat.h:268
virtual ~hN_Unc2020_EV3Down_BDTRwgt_Nu()=default