forked from alisw/AliPhysics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAliMLModelHandler.h
More file actions
61 lines (46 loc) · 1.83 KB
/
Copy pathAliMLModelHandler.h
File metadata and controls
61 lines (46 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef ALIMLMODELHANDLER_H
#define ALIMLMODELHANDLER_H
// Copyright CERN. This software is distributed under the terms of the GNU
// General Public License v3 (GPL Version 3).
//
// See http://www.gnu.org/licenses/ for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file AliMLModelHandler.h
/// \brief Utility class to store the compiled model and it's information
/// \author pietro.fecchio@cern.ch, maximiliano.puccio@cern.ch, fabio.catalano@cern.ch
#include <string>
#include "TNamed.h"
namespace YAML {
class Node;
}
class AliExternalBDT;
class AliMLModelHandler : public TNamed {
public:
enum {kXGBoost, kLightGBM, kModelLibrary};
enum {kLowerCut, kUpperCut};
AliMLModelHandler();
AliMLModelHandler(const YAML::Node &node);
virtual ~AliMLModelHandler();
AliMLModelHandler(const AliMLModelHandler &source);
AliMLModelHandler &operator=(const AliMLModelHandler &source);
AliExternalBDT *GetModel() { return fModel; }
std::string const &GetPath() const { return fPath; }
std::string const &GetLibrary() const { return fLibrary; }
std::vector<double> const &GetScoreCut() const { return fScoreCut; }
std::vector<int> const &GetScoreCutOpt() const { return fScoreCutOpt; }
bool CompileModel();
static std::string ImportFile(std::string path);
private:
AliExternalBDT *fModel; //!<!
std::string fPath; ///
std::string fLibrary; ///
std::vector<double> fScoreCut; /// vector of cuts to be applied on output scores
std::vector<int> fScoreCutOpt; /// vector of options on output scores ("upper" or "lower")
/// \cond CLASSIMP
ClassDef(AliMLModelHandler, 2); ///
/// \endcond
};
#endif