48 #ifndef __GBT_REGRESSION_PREDICT_H__ 49 #define __GBT_REGRESSION_PREDICT_H__ 51 #include "algorithms/algorithm.h" 52 #include "algorithms/gradient_boosted_trees/gbt_regression_predict_types.h" 53 #include "algorithms/regression/regression_predict.h" 76 template<
typename algorithmFPType, Method method, CpuType cpu>
77 class DAAL_EXPORT BatchContainer :
public PredictionContainerIface
84 BatchContainer(daal::services::Environment::env *daalEnv);
90 services::Status compute() DAAL_C11_OVERRIDE;
109 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
110 class Batch :
public algorithms::regression::prediction::Batch
113 typedef algorithms::gbt::regression::prediction::Input InputType;
114 typedef algorithms::gbt::regression::prediction::Parameter ParameterType;
115 typedef algorithms::gbt::regression::prediction::Result ResultType;
122 _par =
new ParameterType();
132 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input)
134 _par =
new ParameterType(other.parameter());
148 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
154 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
160 virtual algorithms::regression::prediction::Input* getInput() DAAL_C11_OVERRIDE{
return &input; }
166 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
172 ResultPtr getResult() {
return ResultType::cast(_result); }
179 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 181 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
186 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
188 return new Batch<algorithmFPType, method>(*this);
191 services::Status allocateResult() DAAL_C11_OVERRIDE
193 services::Status s = getResult()->template allocate<algorithmFPType>(_in, 0, 0);
194 _res = _result.get();
200 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
202 _result.reset(
new ResultType());
207 using interface1::BatchContainer;
208 using interface1::Batch;
daal::algorithms::gbt::regression::prediction::interface1::Batch::Batch
Batch()
Definition: gbt_regression_predict.h:120
daal::algorithms::gbt::regression::prediction::interface1::Batch::input
InputType input
Definition: gbt_regression_predict.h:117
daal::services::interface1::Environment::_envStruct
The environment structure.
Definition: env_detect.h:95
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::gbt::regression::prediction::interface1::Result
Provides interface for the result of model-based prediction.
Definition: gbt_regression_predict_types.h:187
daal::algorithms::gbt::regression::prediction::interface1::Batch::getResult
ResultPtr getResult()
Definition: gbt_regression_predict.h:172
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:79
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:66
daal::algorithms::gbt::regression::prediction::interface1::Batch::parameter
ParameterType & parameter()
Definition: gbt_regression_predict.h:148
daal::algorithms::gbt::regression::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:166
daal::algorithms::gbt::regression::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: gbt_regression_predict.h:132
daal::batch
Definition: daal_defines.h:132
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::gbt::regression::prediction::interface1::Batch::getInput
virtual algorithms::regression::prediction::Input * getInput() DAAL_C11_OVERRIDE
Definition: gbt_regression_predict.h:160
daal::algorithms::gbt::regression::prediction::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_predict.h:139
daal::algorithms::gbt::regression::prediction::interface1::Batch
Provides methods to run implementations of the model-based prediction.
Definition: gbt_regression_predict.h:110
daal::algorithms::gbt::regression::prediction::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: gbt_regression_predict.h:154
daal::algorithms::gbt::regression::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: gbt_regression_predict.h:179
daal::algorithms::gbt::regression::prediction::interface1::Parameter
Parameters of the prediction algorithm.
Definition: gbt_regression_predict_types.h:130
daal::algorithms::regression::prediction::interface1::Batch
Provides methods to run implementations of the regression model-based prediction. ...
Definition: regression_predict.h:77
daal::algorithms::gbt::regression::prediction::interface1::BatchContainer
Class containing computation methods for model-based prediction.
Definition: gbt_regression_predict.h:77