24 #ifndef __GBT_REGRESSION_PREDICT_H__
25 #define __GBT_REGRESSION_PREDICT_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/gradient_boosted_trees/gbt_regression_predict_types.h"
29 #include "algorithms/regression/regression_predict.h"
52 template<
typename algorithmFPType, Method method, CpuType cpu>
53 class BatchContainer :
public PredictionContainerIface
60 BatchContainer(daal::services::Environment::env *daalEnv);
66 services::Status compute() DAAL_C11_OVERRIDE;
85 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
86 class DAAL_EXPORT Batch :
public algorithms::regression::prediction::Batch
89 typedef algorithms::gbt::regression::prediction::Input InputType;
90 typedef algorithms::gbt::regression::prediction::Parameter ParameterType;
91 typedef algorithms::gbt::regression::prediction::Result ResultType;
104 Batch(
const Batch<algorithmFPType, method> &other);
116 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
122 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
128 virtual algorithms::regression::prediction::Input* getInput() DAAL_C11_OVERRIDE{
return &input; }
134 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
140 ResultPtr getResult() {
return ResultType::cast(_result); }
147 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
149 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
154 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
156 return new Batch<algorithmFPType, method>(*this);
159 services::Status allocateResult() DAAL_C11_OVERRIDE
161 services::Status s = getResult()->template allocate<algorithmFPType>(_in, _par, 0);
162 _res = _result.get();
168 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
170 _result.reset(
new ResultType());
175 using interface1::BatchContainer;
176 using interface1::Batch;
daal::algorithms::gbt::regression::prediction::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_predict.h:107
daal::algorithms::gbt::regression::prediction::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: gbt_regression_predict.h:122
daal::batch
Definition: daal_defines.h:112
daal::algorithms::gbt::regression::prediction::interface1::BatchContainer
Class containing computation methods for model-based prediction.
Definition: gbt_regression_predict.h:53
daal::algorithms::gbt::regression::prediction::interface1::Batch::getInput
virtual algorithms::regression::prediction::Input * getInput() DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:128
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::gbt::regression::prediction::interface1::Batch
Provides methods to run implementations of the model-based prediction.
Definition: gbt_regression_predict.h:86
daal::algorithms::gbt::regression::prediction::interface1::Batch::parameter
ParameterType & parameter()
Definition: gbt_regression_predict.h:116
daal::algorithms::gbt::regression::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:134
daal::algorithms::gbt::regression::prediction::interface1::Batch::input
InputType input
Definition: gbt_regression_predict.h:93
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:42
daal::algorithms::gbt::regression::prediction::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::gbt::regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: gbt_regression_predict.h:147
daal::algorithms::gbt::regression::prediction::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::gbt::regression::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: gbt_regression_predict.h:140