23 #ifndef __GBT_REGRESSSION_TRAINING_BATCH_H__
24 #define __GBT_REGRESSSION_TRAINING_BATCH_H__
26 #include "algorithms/algorithm.h"
27 #include "data_management/data/numeric_table.h"
28 #include "services/daal_defines.h"
29 #include "services/daal_memory.h"
30 #include "algorithms/gradient_boosted_trees/gbt_regression_training_types.h"
31 #include "algorithms/gradient_boosted_trees/gbt_regression_model.h"
32 #include "algorithms/regression/regression_training_batch.h"
56 template<
typename algorithmFPType, Method method, CpuType cpu>
57 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
65 BatchContainer(daal::services::Environment::env *daalEnv);
72 services::Status compute() DAAL_C11_OVERRIDE;
73 services::Status setupCompute() DAAL_C11_OVERRIDE;
91 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
92 class DAAL_EXPORT Batch :
public algorithms::regression::training::Batch
95 typedef algorithms::gbt::regression::training::Input InputType;
96 typedef algorithms::gbt::regression::training::Parameter ParameterType;
97 typedef algorithms::gbt::regression::training::Result ResultType;
104 _par =
new ParameterType();
114 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input)
116 _par =
new ParameterType(other.parameter());
130 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
136 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
142 virtual algorithms::regression::training::Input* getInput() DAAL_C11_OVERRIDE{
return &input; }
148 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
154 ResultPtr getResult() {
return ResultType::cast(_result); }
162 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
164 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
169 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
171 return new Batch<algorithmFPType, method>(*this);
174 services::Status allocateResult() DAAL_C11_OVERRIDE
176 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter(), method);
177 _res = _result.get();
183 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
185 _result.reset(
new ResultType());
190 using interface1::BatchContainer;
191 using interface1::Batch;
daal::algorithms::gbt::regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: gbt_regression_training_batch.h:154
daal::algorithms::gbt::regression::training::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_training_batch.h:121
daal
Definition: algorithm_base_common.h:31
daal::algorithms::gbt::regression::training::interface1::Batch::getInput
virtual algorithms::regression::training::Input * getInput() DAAL_C11_OVERRIDE
Definition: gbt_regression_training_batch.h:142
daal::algorithms::gbt::regression::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: gbt_regression_training_batch.h:114
daal::algorithms::gbt::regression::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: gbt_regression_training_batch.h:162
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:57
daal::batch
Definition: daal_defines.h:106
daal::algorithms::gbt::regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_training_batch.h:148
daal::algorithms::gbt::regression::training::interface1::Batch::input
InputType input
Definition: gbt_regression_training_batch.h:99
daal::algorithms::gbt::regression::training::interface1::Batch::parameter
ParameterType & parameter()
Definition: gbt_regression_training_batch.h:130
daal::algorithms::gbt::regression::training::interface1::Batch
Provides methods for model-based training in the batch processing mode.
Definition: gbt_regression_training_batch.h:92
daal::algorithms::gbt::regression::training::interface1::Batch::Batch
Batch()
Definition: gbt_regression_training_batch.h:102
daal::algorithms::gbt::regression::training::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: gbt_regression_training_batch.h:136
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:50