25 #ifndef __GBT_REGRESSSION_TRAINING_BATCH_H__
26 #define __GBT_REGRESSSION_TRAINING_BATCH_H__
28 #include "algorithms/algorithm.h"
29 #include "data_management/data/numeric_table.h"
30 #include "services/daal_defines.h"
31 #include "services/daal_memory.h"
32 #include "algorithms/gradient_boosted_trees/gbt_regression_training_types.h"
33 #include "algorithms/gradient_boosted_trees/gbt_regression_model.h"
34 #include "algorithms/regression/regression_training_batch.h"
58 template<
typename algorithmFPType, Method method, CpuType cpu>
59 class BatchContainer :
public TrainingContainerIface<batch>
67 BatchContainer(daal::services::Environment::env *daalEnv);
74 services::Status compute() DAAL_C11_OVERRIDE;
75 services::Status setupCompute() DAAL_C11_OVERRIDE;
93 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
94 class DAAL_EXPORT Batch :
public algorithms::regression::training::Batch
97 typedef algorithms::gbt::regression::training::Input InputType;
98 typedef algorithms::gbt::regression::training::Parameter ParameterType;
99 typedef algorithms::gbt::regression::training::Result ResultType;
112 Batch(
const Batch<algorithmFPType, method> &other);
124 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
130 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
136 virtual algorithms::regression::training::Input* getInput() DAAL_C11_OVERRIDE{
return &input; }
142 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
148 ResultPtr getResult() {
return ResultType::cast(_result); }
153 virtual services::Status resetResult() DAAL_C11_OVERRIDE
155 _result.reset(
new ResultType());
156 DAAL_CHECK(_result, services::ErrorNullResult)
158 return services::Status();
166 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
168 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
173 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
175 return new Batch<algorithmFPType, method>(*this);
178 services::Status allocateResult() DAAL_C11_OVERRIDE
180 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter(), method);
181 _res = _result.get();
187 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
189 _result.reset(
new ResultType());
194 using interface1::BatchContainer;
195 using interface1::Batch;
daal::algorithms::gbt::regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: gbt_regression_training_batch.h:148
daal::algorithms::gbt::regression::training::interface1::Batch::getInput
virtual algorithms::regression::training::Input * getInput() DAAL_C11_OVERRIDE
Definition: gbt_regression_training_batch.h:136
daal::batch
Definition: daal_defines.h:112
daal::algorithms::gbt::regression::training::interface1::Batch
Provides methods for model-based training in the batch processing mode.
Definition: gbt_regression_training_batch.h:94
daal::algorithms::gbt::regression::training::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::gbt::regression::training::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: gbt_regression_training_batch.h:130
daal::algorithms::gbt::regression::training::interface1::Batch::input
InputType input
Definition: gbt_regression_training_batch.h:101
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::gbt::regression::training::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::gbt::regression::training::interface1::BatchContainer
Class containing methods for gradient boosted trees regression model-based training using algorithmFP...
Definition: gbt_regression_training_batch.h:59
daal::algorithms::gbt::regression::training::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_training_batch.h:115
daal::algorithms::gbt::regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_training_batch.h:142
daal::algorithms::gbt::regression::training::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::gbt::regression::training::interface1::Batch::parameter
ParameterType & parameter()
Definition: gbt_regression_training_batch.h:124
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52