22 #ifndef __GBT_REGRESSION_PREDICT_H__
23 #define __GBT_REGRESSION_PREDICT_H__
25 #include "algorithms/algorithm.h"
26 #include "algorithms/gradient_boosted_trees/gbt_regression_predict_types.h"
27 #include "algorithms/regression/regression_predict.h"
50 template<
typename algorithmFPType, Method method, CpuType cpu>
51 class DAAL_EXPORT BatchContainer :
public PredictionContainerIface
58 BatchContainer(daal::services::Environment::env *daalEnv);
64 services::Status compute() DAAL_C11_OVERRIDE;
83 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
84 class DAAL_EXPORT Batch :
public algorithms::regression::prediction::Batch
87 typedef algorithms::gbt::regression::prediction::Input InputType;
88 typedef algorithms::gbt::regression::prediction::Parameter ParameterType;
89 typedef algorithms::gbt::regression::prediction::Result ResultType;
102 Batch(
const Batch<algorithmFPType, method> &other);
114 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
120 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
126 virtual algorithms::regression::prediction::Input* getInput() DAAL_C11_OVERRIDE{
return &input; }
132 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
138 ResultPtr getResult() {
return ResultType::cast(_result); }
145 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
147 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
152 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
154 return new Batch<algorithmFPType, method>(*this);
157 services::Status allocateResult() DAAL_C11_OVERRIDE
159 services::Status s = getResult()->template allocate<algorithmFPType>(_in, 0, 0);
160 _res = _result.get();
166 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
168 _result.reset(
new ResultType());
173 using interface1::BatchContainer;
174 using interface1::Batch;
daal::algorithms::gbt::regression::prediction::interface1::Batch::input
InputType input
Definition: gbt_regression_predict.h:91
daal
Definition: algorithm_base_common.h:31
daal::algorithms::gbt::regression::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: gbt_regression_predict.h:138
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:40
daal::algorithms::gbt::regression::prediction::interface1::Batch::parameter
ParameterType & parameter()
Definition: gbt_regression_predict.h:114
daal::algorithms::gbt::regression::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:132
daal::algorithms::gbt::regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: gbt_regression_predict.h:145
daal::batch
Definition: daal_defines.h:106
daal::algorithms::gbt::regression::prediction::interface1::Batch::getInput
virtual algorithms::regression::prediction::Input * getInput() DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:126
daal::algorithms::gbt::regression::prediction::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_predict.h:105
daal::algorithms::gbt::regression::prediction::interface1::Batch
Provides methods to run implementations of the model-based prediction.
Definition: gbt_regression_predict.h:84
daal::algorithms::gbt::regression::prediction::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: gbt_regression_predict.h:120
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::gbt::regression::prediction::interface1::BatchContainer
Class containing computation methods for model-based prediction.
Definition: gbt_regression_predict.h:51