25 #ifndef __STUMP_REGRESSION_TRAINING_BATCH_H__
26 #define __STUMP_REGRESSION_TRAINING_BATCH_H__
28 #include "algorithms/regression/regression_training_batch.h"
29 #include "algorithms/stump/stump_regression_training_types.h"
58 template<
typename algorithmFPType, Method method, CpuType cpu>
59 class BatchContainer :
public TrainingContainerIface<batch>
67 BatchContainer(daal::services::Environment::env *daalEnv);
73 services::Status compute() DAAL_C11_OVERRIDE;
93 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
94 class DAAL_EXPORT Batch :
public daal::algorithms::regression::training::Batch
97 typedef daal::algorithms::regression::training::Batch super;
99 typedef typename super::InputType InputType;
100 typedef algorithms::stump::regression::Parameter ParameterType;
101 typedef algorithms::stump::regression::training::Result ResultType;
114 Batch(
const Batch<algorithmFPType, method> & other);
125 ParameterType& parameter() {
return *
static_cast<ParameterType*
>(_par); }
131 const ParameterType& parameter()
const {
return *
static_cast<const ParameterType*
>(_par); }
137 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
143 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
149 ResultPtr getResult() {
return ResultType::cast(_result); }
154 services::Status resetResult() DAAL_C11_OVERRIDE
156 _result.reset(
new ResultType());
157 DAAL_CHECK(_result, services::ErrorNullResult)
159 return services::Status();
167 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
169 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, _par, 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;
202 #endif // __stump__regression_TRAINING_BATCH_H__
daal::algorithms::stump::regression::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: stump_regression_training_batch.h:167
daal::batch
Definition: daal_defines.h:112
daal::algorithms::stump::regression::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: stump_regression_training_batch.h:154
daal::algorithms::stump::regression::training::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: stump_regression_training_batch.h:137
daal::algorithms::stump::regression::training::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::stump::regression::training::interface1::Batch::parameter
ParameterType & parameter()
Definition: stump_regression_training_batch.h:125
daal::algorithms::stump::regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: stump_regression_training_batch.h:143
daal::algorithms::stump::regression::training::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::stump::regression::training::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: stump_regression_training_batch.h:131
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::stump::regression::training::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::stump::regression::training::interface1::Batch
Trains the decision stump model.
Definition: stump_regression_training_batch.h:94
daal::algorithms::stump::regression::training::interface1::Batch::input
InputType input
Definition: stump_regression_training_batch.h:103
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52
daal::algorithms::stump::regression::training::interface1::BatchContainer
Provides methods to run implementations of the the decision stump training algorithm. It is associated with the daal::algorithms::stump::regression::training::Batch class and supports methods to train the decision stump model.
Definition: stump_regression_training_batch.h:59
daal::algorithms::stump::regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: stump_regression_training_batch.h:149