24 #ifndef __DECISION_TREE_CLASSIFICATION_TRAINING_BATCH_H__
25 #define __DECISION_TREE_CLASSIFICATION_TRAINING_BATCH_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/decision_tree/decision_tree_classification_training_types.h"
29 #include "algorithms/decision_tree/decision_tree_classification_model.h"
30 #include "algorithms/classifier/classifier_training_batch.h"
36 namespace decision_tree
38 namespace classification
54 template <
typename algorithmFPType, Method method, CpuType cpu>
55 class BatchContainer :
public TrainingContainerIface<batch>
62 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env * daalEnv);
65 DAAL_DEPRECATED ~BatchContainer();
70 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
88 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
89 class DAAL_EXPORT Batch :
public classifier::training::interface1::Batch
92 typedef classifier::training::interface1::Batch super;
94 typedef algorithms::decision_tree::classification::training::Input InputType;
95 typedef algorithms::decision_tree::classification::interface1::Parameter ParameterType;
96 typedef algorithms::decision_tree::classification::training::Result ResultType;
99 ParameterType parameter;
102 DAAL_DEPRECATED Batch(
size_t nClasses) : parameter(nClasses)
112 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> & other) : classifier::training::interface1::Batch(other), input(other.input), parameter(other.parameter)
121 DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
127 DAAL_DEPRECATED_VIRTUAL
virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
133 DAAL_DEPRECATED ResultPtr getResult() {
return ResultType::cast(_result); }
138 DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
140 _result.reset(
new ResultType());
141 DAAL_CHECK(_result, services::ErrorNullResult);
143 return services::Status();
152 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
154 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
158 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
160 return new Batch<algorithmFPType, method>(*this);
163 services::Status allocateResult() DAAL_C11_OVERRIDE
165 ResultPtr res = getResult();
166 DAAL_CHECK(res, services::ErrorNullResult);
167 services::Status s = res->template allocate<algorithmFPType>((classifier::training::InputIface *)(&input), ¶meter, (int)method);
168 _res = _result.get();
175 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
177 _result.reset(
new ResultType());
196 template <
typename algorithmFPType, Method method, CpuType cpu>
197 class BatchContainer :
public TrainingContainerIface<batch>
204 BatchContainer(daal::services::Environment::env * daalEnv);
212 services::Status compute() DAAL_C11_OVERRIDE;
230 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
231 class DAAL_EXPORT Batch :
public classifier::training::Batch
234 typedef classifier::training::Batch super;
236 typedef algorithms::decision_tree::classification::training::Input InputType;
237 typedef algorithms::decision_tree::classification::Parameter ParameterType;
238 typedef algorithms::decision_tree::classification::training::Result ResultType;
242 ParameterType parameter;
245 Batch(
size_t nClasses) : parameter(nClasses)
255 Batch(
const Batch<algorithmFPType, method> & other) : classifier::training::Batch(other), input(other.input), parameter(other.parameter)
264 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
270 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
276 ResultPtr getResult() {
return ResultType::cast(_result); }
281 services::Status resetResult() DAAL_C11_OVERRIDE
283 _result.reset(
new ResultType());
284 DAAL_CHECK(_result, services::ErrorNullResult);
286 return services::Status();
295 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
297 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
301 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
303 return new Batch<algorithmFPType, method>(*this);
306 services::Status allocateResult() DAAL_C11_OVERRIDE
308 ResultPtr res = getResult();
309 DAAL_CHECK(res, services::ErrorNullResult);
310 services::Status s = res->template allocate<algorithmFPType>((classifier::training::InputIface *)(&input), ¶meter, (int)method);
311 _res = _result.get();
318 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
320 _result.reset(
new ResultType());
327 using interface2::BatchContainer;
328 using interface2::Batch;
daal::algorithms::decision_tree::classification::training::interface2::Batch
Provides methods for Decision tree model-based training in the batch processing mode.
Definition: decision_tree_classification_training_batch.h:231
daal::algorithms::decision_tree::classification::training::interface1::BatchContainer
Class containing methods for Decision tree model-based training using algorithmFPType precision arith...
Definition: decision_tree_classification_training_batch.h:55
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:198
daal::algorithms::decision_tree::classification::training::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::batch
Definition: daal_defines.h:112
daal::algorithms::decision_tree::classification::training::interface1::Batch::resetResult
DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:138
daal::algorithms::decision_tree::classification::training::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::classifier::training::interface1::Batch
Algorithm class for training the classifier model.
Definition: classifier_training_batch.h:58
daal::algorithms::decision_tree::classification::training::interface1::Batch::getResult
DAAL_DEPRECATED ResultPtr getResult()
Definition: decision_tree_classification_training_batch.h:133
daal::algorithms::decision_tree::classification::training::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::decision_tree::classification::training::interface2::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: decision_tree_classification_training_batch.h:255
daal::algorithms::decision_tree::classification::training::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:127
daal::algorithms::decision_tree::classification::training::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::decision_tree::classification::training::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::decision_tree::classification::training::interface2::Batch::getResult
ResultPtr getResult()
Definition: decision_tree_classification_training_batch.h:276
daal::algorithms::decision_tree::classification::training::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:121
daal::algorithms::decision_tree::classification::interface1::Parameter
Decision tree algorithm parameters.
Definition: decision_tree_classification_model.h:84
daal::algorithms::decision_tree::classification::training::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: decision_tree_classification_training_batch.h:295
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::decision_tree::classification::training::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::decision_tree::classification::training::interface2::Batch::Batch
Batch(size_t nClasses)
Definition: decision_tree_classification_training_batch.h:245
daal::algorithms::decision_tree::classification::training::interface2::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:281
daal::algorithms::decision_tree::classification::training::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:264
daal::algorithms::decision_tree::classification::training::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:270
daal::algorithms::decision_tree::classification::training::interface1::Batch
Provides methods for Decision tree model-based training in the batch processing mode.
Definition: decision_tree_classification_training_batch.h:89
daal::algorithms::decision_tree::classification::training::interface2::Batch::parameter
ParameterType parameter
Definition: decision_tree_classification_training_batch.h:242
daal::algorithms::decision_tree::classification::training::interface1::Batch::parameter
ParameterType parameter
Definition: decision_tree_classification_training_batch.h:99
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::classifier::training::interface1::Input
Base class for the input objects in the training stage of the classification algorithms.
Definition: classifier_training_types.h:110
daal::algorithms::decision_tree::classification::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: decision_tree_classification_training_batch.h:112
daal::algorithms::decision_tree::classification::training::interface2::BatchContainer
Class containing methods for Decision tree model-based training using algorithmFPType precision arith...
Definition: decision_tree_classification_training_batch.h:197
daal::algorithms::decision_tree::classification::training::interface1::Batch::input
InputType input
Definition: decision_tree_classification_training_batch.h:98
daal::algorithms::decision_tree::classification::training::interface2::Batch::input
InputType input
Definition: decision_tree_classification_training_batch.h:241
daal::algorithms::decision_tree::classification::training::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: decision_tree_classification_training_batch.h:152
daal::algorithms::decision_tree::classification::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(size_t nClasses)
Definition: decision_tree_classification_training_batch.h:102
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52