25 #ifndef __STUMP_CLASSIFICATION_TRAINING_BATCH_H__
26 #define __STUMP_CLASSIFICATION_TRAINING_BATCH_H__
28 #include "algorithms/classifier/classifier_training_batch.h"
29 #include "algorithms/stump/stump_classification_training_types.h"
37 namespace classification
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 classifier::training::Batch
97 typedef classifier::training::Batch super;
99 typedef typename super::InputType InputType;
100 typedef algorithms::stump::classification::Parameter ParameterType;
101 typedef algorithms::stump::classification::training::Result ResultType;
105 Batch(
size_t nClasses = 2);
113 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 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
142 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
148 training::ResultPtr getResult()
150 return ResultType::cast(_result);
156 services::Status resetResult() DAAL_C11_OVERRIDE
158 _result.reset(
new ResultType());
159 DAAL_CHECK(_result, services::ErrorNullResult)
161 return services::Status();
169 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
171 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
175 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
177 return new Batch<algorithmFPType, method>(*this);
180 services::Status allocateResult() DAAL_C11_OVERRIDE
182 training::ResultPtr res = getResult();
183 DAAL_CHECK(res, services::ErrorNullResult);
184 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
185 _res = _result.get();
191 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
193 _result.reset(
new ResultType());
198 using interface1::BatchContainer;
199 using interface1::Batch;
206 #endif // __stump__classification_TRAINING_BATCH_H__
daal::algorithms::stump::classification::training::interface1::BatchContainer
Provides methods to run implementations of the the decision stump training algorithm. It is associated with the daal::algorithms::stump::classification::training::Batch class and supports methods to train the decision stump model.
Definition: stump_classification_training_batch.h:59
daal::batch
Definition: daal_defines.h:112
daal::algorithms::stump::classification::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: stump_classification_training_batch.h:156
daal::algorithms::stump::classification::training::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: stump_classification_training_batch.h:136
daal::algorithms::stump::classification::training::interface1::Batch
Trains the decision stump model.
Definition: stump_classification_training_batch.h:94
daal::algorithms::stump::classification::training::interface1::Batch::parameter
const ParameterType & parameter() const
Definition: stump_classification_training_batch.h:130
daal::algorithms::stump::classification::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: stump_classification_training_batch.h:142
daal::algorithms::stump::classification::training::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::stump::classification::training::interface1::Batch::parameter
ParameterType & parameter()
Definition: stump_classification_training_batch.h:124
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::stump::classification::training::interface1::Batch::getResult
training::ResultPtr getResult()
Definition: stump_classification_training_batch.h:148
daal::algorithms::stump::classification::training::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::stump::classification::training::interface1::Batch::input
InputType input
Definition: stump_classification_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::classification::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: stump_classification_training_batch.h:169
daal::algorithms::stump::classification::training::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE