49 #ifndef __STUMP_TRAINING_BATCH_H__ 50 #define __STUMP_TRAINING_BATCH_H__ 52 #include "algorithms/weak_learner/weak_learner_training_batch.h" 53 #include "algorithms/stump/stump_training_types.h" 80 template<
typename algorithmFPType, Method method, CpuType cpu>
81 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
89 BatchContainer(daal::services::Environment::env *daalEnv);
95 services::Status compute() DAAL_C11_OVERRIDE;
115 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
116 class DAAL_EXPORT Batch :
public weak_learner::training::Batch
119 typedef weak_learner::training::Batch super;
121 typedef typename super::InputType InputType;
122 typedef typename super::ParameterType ParameterType;
123 typedef algorithms::stump::training::Result ResultType;
125 ParameterType parameter;
139 Batch(
const Batch<algorithmFPType, method> &other) : weak_learner::training::Batch(other),
140 parameter(other.parameter), input(other.input)
151 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
157 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
163 training::ResultPtr getResult()
165 return ResultType::cast(_result);
171 services::Status resetResult() DAAL_C11_OVERRIDE
173 _result.reset(
new ResultType());
174 DAAL_CHECK(_result, services::ErrorNullResult)
176 return services::Status();
184 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 186 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
190 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
192 return new Batch<algorithmFPType, method>(*this);
195 services::Status allocateResult() DAAL_C11_OVERRIDE
197 training::ResultPtr res = getResult();
198 DAAL_CHECK(res, services::ErrorNullResult);
199 services::Status s = res->template allocate<algorithmFPType>(&input, _par, method);
200 _res = _result.get();
206 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
209 _result.reset(
new ResultType());
214 using interface1::BatchContainer;
215 using interface1::Batch;
221 #endif // __STUMP_TRAINING_BATCH_H__ daal::algorithms::weak_learner::training::interface1::Batch
Base class for training the weak learner model in the batch processing mode
Definition: weak_learner_training_batch.h:84
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:81
daal::services::interface1::Environment::_envStruct
The environment structure.
Definition: env_detect.h:95
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:81
daal::algorithms::stump::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: stump_training_batch.h:184
daal::algorithms::stump::training::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: stump_training_batch.h:151
daal::batch
Definition: daal_defines.h:132
daal::algorithms::stump::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: stump_training_batch.h:139
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::stump::training::interface1::Batch
Trains the decision stump model.
Definition: stump_training_batch.h:116
daal::algorithms::stump::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: stump_training_batch.h:157
daal::algorithms::classifier::training::interface1::Result
Provides methods to access final results obtained with the compute() method in the batch processing m...
Definition: classifier_training_types.h:222
daal::algorithms::stump::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: stump_training_batch.h:171
daal::algorithms::stump::training::interface1::Result
Provides methods to access final results obtained with the compute() method of the decision stump tra...
Definition: stump_training_types.h:95
daal::algorithms::stump::training::interface1::Batch::input
InputType input
Definition: stump_training_batch.h:126
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:76
daal::algorithms::stump::training::interface1::Batch::parameter
ParameterType parameter
Definition: stump_training_batch.h:125