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;
110 Batch(
const Batch<algorithmFPType, method> &other);
122 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
128 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
134 virtual algorithms::regression::training::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); }
154 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
156 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
161 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
163 return new Batch<algorithmFPType, method>(*this);
166 services::Status allocateResult() DAAL_C11_OVERRIDE
168 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter(), method);
169 _res = _result.get();
175 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
177 _result.reset(
new ResultType());
182 using interface1::BatchContainer;
183 using interface1::Batch;
daal::algorithms::gbt::regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: gbt_regression_training_batch.h:146
daal::algorithms::gbt::regression::training::interface1::Batch::~Batch
~Batch()
Definition: gbt_regression_training_batch.h:113
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:134
daal::algorithms::gbt::regression::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: gbt_regression_training_batch.h:154
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:110
daal::algorithms::gbt::regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: gbt_regression_training_batch.h:140
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:122
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::parameter
const ParameterType & parameter() const
Definition: gbt_regression_training_batch.h:128
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:50