25 #ifndef __STUMP_TRAINING_BATCH_H__
26 #define __STUMP_TRAINING_BATCH_H__
28 #include "algorithms/weak_learner/weak_learner_training_batch.h"
29 #include "algorithms/stump/stump_training_types.h"
56 template<
typename algorithmFPType, Method method, CpuType cpu>
57 class BatchContainer :
public TrainingContainerIface<batch>
65 BatchContainer(daal::services::Environment::env *daalEnv);
71 services::Status compute() DAAL_C11_OVERRIDE;
91 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
92 class DAAL_EXPORT Batch :
public weak_learner::training::Batch
95 typedef weak_learner::training::Batch super;
97 typedef typename super::InputType InputType;
98 typedef typename super::ParameterType ParameterType;
99 typedef algorithms::stump::training::Result ResultType;
101 ParameterType parameter;
115 Batch(
const Batch<algorithmFPType, method> &other) : weak_learner::training::Batch(other),
116 parameter(other.parameter), input(other.input)
127 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
133 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
139 training::ResultPtr getResult()
141 return ResultType::cast(_result);
147 services::Status resetResult() DAAL_C11_OVERRIDE
149 _result.reset(
new ResultType());
150 DAAL_CHECK(_result, services::ErrorNullResult)
152 return services::Status();
160 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
162 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
166 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
168 return new Batch<algorithmFPType, method>(*this);
171 services::Status allocateResult() DAAL_C11_OVERRIDE
173 training::ResultPtr res = getResult();
174 DAAL_CHECK(res, services::ErrorNullResult);
175 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
176 _res = _result.get();
182 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
185 _result.reset(
new ResultType());
190 using interface1::BatchContainer;
191 using interface1::Batch;
197 #endif // __STUMP_TRAINING_BATCH_H__
daal::algorithms::stump::training::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::stump::training::interface1::Batch::input
InputType input
Definition: stump_training_batch.h:102
daal::batch
Definition: daal_defines.h:112
daal::algorithms::stump::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: stump_training_batch.h:133
daal::algorithms::stump::training::interface1::Batch::getResult
training::ResultPtr getResult()
Definition: stump_training_batch.h:139
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::stump::training::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::stump::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: stump_training_batch.h:160
daal::algorithms::stump::training::interface1::BatchContainer
Provides methods to run implementations of the the decision stump training algorithm. It is associated with the daal::algorithms::stump::training::Batch class and supports methods to train the decision stump model.
Definition: stump_training_batch.h:57
daal::algorithms::stump::training::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: stump_training_batch.h:127
daal::algorithms::stump::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: stump_training_batch.h:115
daal::algorithms::stump::training::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::stump::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: stump_training_batch.h:147
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::training::interface1::Batch
Trains the decision stump model.
Definition: stump_training_batch.h:92
daal::algorithms::stump::training::interface1::Batch::parameter
ParameterType parameter
Definition: stump_training_batch.h:101