24 #ifndef __KDTREE_KNN_CLASSIFICATION_TRAINING_BATCH_H__
25 #define __KDTREE_KNN_CLASSIFICATION_TRAINING_BATCH_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/k_nearest_neighbors/kdtree_knn_classification_training_types.h"
29 #include "algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h"
30 #include "algorithms/classifier/classifier_training_batch.h"
36 namespace kdtree_knn_classification
52 template <
typename algorithmFPType, Method method, CpuType cpu>
53 class BatchContainer :
public TrainingContainerIface<batch>
60 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env * daalEnv);
63 DAAL_DEPRECATED ~BatchContainer();
68 DAAL_DEPRECATED 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::interface1::Batch
90 typedef classifier::training::interface1::Batch super;
92 typedef typename super::InputType InputType;
93 typedef algorithms::kdtree_knn_classification::interface1::Parameter ParameterType;
94 typedef algorithms::kdtree_knn_classification::training::Result ResultType;
96 ParameterType parameter;
100 DAAL_DEPRECATED Batch()
111 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> & other) : classifier::training::interface1::Batch(other),
112 parameter(other.parameter), input(other.input)
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 interface1::ResultPtr getResult() {
return Result::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 const interface1::ResultPtr res = getResult();
166 DAAL_CHECK(_result, services::ErrorNullResult);
167 services::Status s = res->template allocate<algorithmFPType>((classifier::training::InputIface *)(&input), ¶meter, (int)method);
168 _res = _result.get();
174 _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 typename super::InputType InputType;
237 typedef algorithms::kdtree_knn_classification::Parameter ParameterType;
238 typedef algorithms::kdtree_knn_classification::training::Result ResultType;
240 ParameterType parameter;
255 Batch(
const Batch<algorithmFPType, method> & other) : classifier::training::Batch(other),
256 parameter(other.parameter), input(other.input)
265 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
271 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
277 ResultPtr getResult() {
return Result::cast(_result); }
282 services::Status resetResult() DAAL_C11_OVERRIDE
284 _result.reset(
new ResultType());
285 DAAL_CHECK(_result, services::ErrorNullResult);
287 return services::Status();
296 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
298 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
302 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
304 return new Batch<algorithmFPType, method>(*this);
307 services::Status allocateResult() DAAL_C11_OVERRIDE
309 const ResultPtr res = getResult();
310 DAAL_CHECK(_result, services::ErrorNullResult);
311 services::Status s = res->template allocate<algorithmFPType>((classifier::training::InputIface *)(&input), ¶meter, (int)method);
312 _res = _result.get();
318 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
321 _result.reset(
new ResultType());
328 using interface2::BatchContainer;
329 using interface2::Batch;
daal::algorithms::kdtree_knn_classification::training::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::kdtree_knn_classification::training::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
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::kdtree_knn_classification::training::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::kdtree_knn_classification::training::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::kdtree_knn_classification::training::interface1::Batch
Provides methods for KD-tree based kNN model-based training in the batch processing mode...
Definition: kdtree_knn_classification_training_batch.h:87
daal::batch
Definition: daal_defines.h:112
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::input
InputType input
Definition: kdtree_knn_classification_training_batch.h:241
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::Batch
Batch()
Definition: kdtree_knn_classification_training_batch.h:244
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_training_batch.h:127
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::getResult
ResultPtr getResult()
Definition: kdtree_knn_classification_training_batch.h:277
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kdtree_knn_classification_training_batch.h:296
daal::algorithms::kdtree_knn_classification::training::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::kdtree_knn_classification::interface1::Parameter
KD-tree based kNN algorithm parameters.
Definition: kdtree_knn_classification_model.h:74
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::parameter
ParameterType parameter
Definition: kdtree_knn_classification_training_batch.h:240
daal::algorithms::classifier::training::interface1::Batch
Algorithm class for training the classifier model.
Definition: classifier_training_batch.h:58
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: kdtree_knn_classification_training_batch.h:255
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_training_batch.h:265
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::resetResult
DAAL_DEPRECATED services::Status resetResult() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_training_batch.h:138
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: kdtree_knn_classification_training_batch.h:111
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_training_batch.h:282
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::Batch
DAAL_DEPRECATED Batch()
Definition: kdtree_knn_classification_training_batch.h:100
daal::algorithms::kdtree_knn_classification::training::interface1::BatchContainer::~BatchContainer
DAAL_DEPRECATED ~BatchContainer()
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::parameter
ParameterType parameter
Definition: kdtree_knn_classification_training_batch.h:96
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_training_batch.h:121
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::input
InputType input
Definition: kdtree_knn_classification_training_batch.h:97
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::kdtree_knn_classification::training::interface1::Batch::getResult
DAAL_DEPRECATED interface1::ResultPtr getResult()
Definition: kdtree_knn_classification_training_batch.h:133
daal::algorithms::kdtree_knn_classification::training::interface2::BatchContainer
Class containing methods for KD-tree based kNN model-based training using algorithmFPType precision a...
Definition: kdtree_knn_classification_training_batch.h:197
daal::algorithms::kdtree_knn_classification::training::interface2::Batch
Provides methods for KD-tree based kNN model-based training in the batch processing mode...
Definition: kdtree_knn_classification_training_batch.h:231
daal::algorithms::kdtree_knn_classification::training::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kdtree_knn_classification_training_batch.h:152
daal::algorithms::kdtree_knn_classification::training::interface1::BatchContainer
Class containing methods for KD-tree based kNN model-based training using algorithmFPType precision a...
Definition: kdtree_knn_classification_training_batch.h:53
daal::algorithms::kdtree_knn_classification::training::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_training_batch.h:271
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52