 |
Belle II Software
release-05-02-19
|
12 #include <tracking/trackFindingCDC/varsets/NamedFloatTuple.h>
13 #include <boost/python/object.hpp>
20 namespace TrackFindingCDC {
22 class NamedFloatTuple;
30 explicit PyEstimator(
const std::string& pickleFileName);
33 double predict(
const std::vector<double>& inputVariables);
36 double predict(
const std::vector<NamedFloatTuple*>& floatTuples);
39 double predict(boost::python::object& array);
size_t m_nCurrent
Cache for the current length of the input array.
std::string m_pickleFileName
File name of the pickle file that contains the trained estimator.
boost::python::object m_array
Array to be served to the estimator.
void expand(size_t nVars)
Reserves space for at least n variable in the input array.
bool m_is_binary_classification
Internal flag to keep track whether a binary classification with predict_proba is evaluated.
boost::python::object m_estimator
Retrained python estimator object.
Abstract base class for different kinds of events.
PyEstimator(const std::string &pickleFileName)
Construct the Estimator.
void unpickleEstimator(const std::string &pickleFileName)
Load the estimator object from the pickled file.
boost::python::object m_predict
Python bound prediction method - cached to avoid repeated lookup.
double predict(const std::vector< double > &inputVariables)
Call the predict method of the estimator.