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 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;
96 _par =
new ParameterType();
106 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input)
108 _par =
new ParameterType(other.parameter());
122 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
128 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
134 virtual algorithms::regression::prediction::Input* getInput() DAAL_C11_OVERRIDE{
return &input; }
140 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
146 ResultPtr getResult() {
return ResultType::cast(_result); }
153 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
155 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
160 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
162 return new Batch<algorithmFPType, method>(*this);
165 services::Status allocateResult() DAAL_C11_OVERRIDE
167 services::Status s = getResult()->template allocate<algorithmFPType>(_in, 0, 0);
168 _res = _result.get();
174 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
176 _result.reset(
new ResultType());
181 using interface1::BatchContainer;
182 using interface1::Batch;
daal::algorithms::gbt::regression::prediction::interface1::Batch::Batch
Batch()
Definition: gbt_regression_predict.h:94
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:146
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:122
daal::algorithms::gbt::regression::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:140
daal::algorithms::gbt::regression::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: gbt_regression_predict.h:106
daal::algorithms::gbt::regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: gbt_regression_predict.h:153
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:134
daal::algorithms::gbt::regression::prediction::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_predict.h:113
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:128
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