22 #ifndef __DECISION_TREE_CLASSIFICATION_TRAINING_BATCH_H__
23 #define __DECISION_TREE_CLASSIFICATION_TRAINING_BATCH_H__
25 #include "algorithms/algorithm.h"
26 #include "algorithms/decision_tree/decision_tree_classification_training_types.h"
27 #include "algorithms/decision_tree/decision_tree_classification_model.h"
28 #include "algorithms/classifier/classifier_training_batch.h"
34 namespace decision_tree
36 namespace classification
52 template <
typename algorithmFPType, Method method, CpuType cpu>
53 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
60 BatchContainer(daal::services::Environment::env * daalEnv);
68 services::Status compute() DAAL_C11_OVERRIDE;
86 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
87 class DAAL_EXPORT Batch :
public classifier::training::Batch
90 typedef classifier::training::Batch super;
92 typedef algorithms::decision_tree::classification::training::Input InputType;
93 typedef algorithms::decision_tree::classification::Parameter ParameterType;
94 typedef algorithms::decision_tree::classification::training::Result ResultType;
98 ParameterType parameter;
101 Batch(
size_t nClasses) : parameter(nClasses)
111 Batch(
const Batch<algorithmFPType, method> & other) : classifier::training::Batch(other), input(other.input), parameter(other.parameter)
120 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
126 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
132 ResultPtr getResult() {
return ResultType::cast(_result); }
137 services::Status resetResult() DAAL_C11_OVERRIDE
139 _result.reset(
new ResultType());
140 DAAL_CHECK(_result, services::ErrorNullResult);
142 return services::Status();
151 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
153 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
157 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
159 return new Batch<algorithmFPType, method>(*this);
162 services::Status allocateResult() DAAL_C11_OVERRIDE
164 ResultPtr res = getResult();
165 DAAL_CHECK(res, services::ErrorNullResult);
166 services::Status s = res->template allocate<algorithmFPType>((classifier::training::InputIface *)(&input), ¶meter, (int)method);
167 _res = _result.get();
174 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
176 _result.reset(
new ResultType());
183 using interface1::BatchContainer;
184 using interface1::Batch;
daal::algorithms::decision_tree::classification::training::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:120
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:87
daal
Definition: algorithm_base_common.h:31
daal::algorithms::decision_tree::classification::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: decision_tree_classification_training_batch.h:151
daal::algorithms::decision_tree::classification::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:137
daal::algorithms::decision_tree::classification::training::interface1::Batch::parameter
ParameterType parameter
Definition: decision_tree_classification_training_batch.h:98
daal::batch
Definition: daal_defines.h:110
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:53
daal::algorithms::decision_tree::classification::training::interface1::Batch::Batch
Batch(size_t nClasses)
Definition: decision_tree_classification_training_batch.h:101
daal::algorithms::decision_tree::classification::training::interface1::Batch::input
InputType input
Definition: decision_tree_classification_training_batch.h:97
daal::algorithms::decision_tree::classification::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: decision_tree_classification_training_batch.h:111
daal::algorithms::decision_tree::classification::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: decision_tree_classification_training_batch.h:126
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:50
daal::algorithms::decision_tree::classification::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: decision_tree_classification_training_batch.h:132