24 #ifndef __KDTREE_KNN_CLASSIFICATION_PREDICT_H__
25 #define __KDTREE_KNN_CLASSIFICATION_PREDICT_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/k_nearest_neighbors/kdtree_knn_classification_predict_types.h"
29 #include "algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h"
30 #include "algorithms/classifier/classifier_predict.h"
31 #include "data_management/data/homogen_numeric_table.h"
37 namespace kdtree_knn_classification
53 template<
typename algorithmFPType, Method method, CpuType cpu>
54 class BatchContainer :
public PredictionContainerIface
61 DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv);
63 DAAL_DEPRECATED ~BatchContainer();
68 DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE;
87 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
88 class Batch :
public classifier::prediction::interface1::Batch
91 typedef classifier::prediction::interface1::Batch super;
93 typedef algorithms::kdtree_knn_classification::prediction::Input InputType;
94 typedef algorithms::kdtree_knn_classification::interface1::Parameter ParameterType;
95 typedef typename super::ResultType ResultType;
98 ParameterType parameter;
101 DAAL_DEPRECATED Batch()
112 DAAL_DEPRECATED Batch(
const Batch<algorithmFPType, method> & other) : classifier::prediction::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; }
134 DAAL_DEPRECATED services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
136 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
140 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
142 return new Batch<algorithmFPType, method>(*this);
145 services::Status allocateResult() DAAL_C11_OVERRIDE
147 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int)method);
148 _res = _result.get();
155 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
175 template<
typename algorithmFPType, Method method, CpuType cpu>
176 class BatchContainer :
public PredictionContainerIface
183 BatchContainer(daal::services::Environment::env *daalEnv);
190 services::Status compute() DAAL_C11_OVERRIDE;
209 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
210 class Batch :
public classifier::prediction::Batch
213 typedef classifier::prediction::Batch super;
215 typedef algorithms::kdtree_knn_classification::prediction::Input InputType;
216 typedef algorithms::kdtree_knn_classification::Parameter ParameterType;
217 typedef typename super::ResultType ResultType;
220 ParameterType parameter;
234 Batch(
const Batch<algorithmFPType, method> & other) : classifier::prediction::Batch(other), input(other.input), parameter(other.parameter)
243 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
249 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
256 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
258 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
262 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
264 return new Batch<algorithmFPType, method>(*this);
267 services::Status allocateResult() DAAL_C11_OVERRIDE
269 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int)method);
270 _res = _result.get();
277 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
285 using interface2::BatchContainer;
286 using interface2::Batch;
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_predict.h:243
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::getMethod
virtual DAAL_DEPRECATED_VIRTUAL int getMethod() const DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_predict.h:127
daal::batch
Definition: daal_defines.h:112
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch
Provides methods to run implementations of the KD-tree based kNN model-based prediction.
Definition: kdtree_knn_classification_predict.h:210
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::parameter
ParameterType parameter
Definition: kdtree_knn_classification_predict.h:220
daal::algorithms::kdtree_knn_classification::interface1::Parameter
KD-tree based kNN algorithm parameters.
Definition: kdtree_knn_classification_model.h:74
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::kdtree_knn_classification::prediction::interface1::BatchContainer::compute
DAAL_DEPRECATED services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::kdtree_knn_classification::prediction::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::kdtree_knn_classification::prediction::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::Batch
DAAL_DEPRECATED Batch(const Batch< algorithmFPType, method > &other)
Definition: kdtree_knn_classification_predict.h:112
daal::algorithms::classifier::prediction::interface1::Input
Input objects in the prediction stage of the classification algorithm.
Definition: classifier_predict_types.h:111
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::Batch
DAAL_DEPRECATED Batch()
Definition: kdtree_knn_classification_predict.h:101
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: kdtree_knn_classification_predict.h:234
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:42
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: kdtree_knn_classification_predict.h:98
daal::algorithms::classifier::prediction::interface1::Result
Provides methods to access prediction results obtained with the compute() method of the classifier pr...
Definition: classifier_predict_types.h:168
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::input
InputType input
Definition: kdtree_knn_classification_predict.h:97
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::getInput
DAAL_DEPRECATED InputType * getInput() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_predict.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::prediction::interface2::BatchContainer
Class containing computation methods for KD-tree based kNN model-based prediction.
Definition: kdtree_knn_classification_predict.h:176
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::input
InputType input
Definition: kdtree_knn_classification_predict.h:219
daal::algorithms::kdtree_knn_classification::prediction::interface1::BatchContainer::BatchContainer
DAAL_DEPRECATED BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kdtree_knn_classification_predict.h:256
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::clone
DAAL_DEPRECATED services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kdtree_knn_classification_predict.h:134
daal::algorithms::kdtree_knn_classification::prediction::interface1::BatchContainer
Class containing computation methods for KD-tree based kNN model-based prediction.
Definition: kdtree_knn_classification_predict.h:54
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::Batch
Batch()
Definition: kdtree_knn_classification_predict.h:223
daal::algorithms::kdtree_knn_classification::prediction::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_predict.h:249
daal::algorithms::classifier::prediction::interface1::Batch
Base class for making predictions based on the model of the classification algorithms.
Definition: classifier_predict.h:61
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch
Provides methods to run implementations of the KD-tree based kNN model-based prediction.
Definition: kdtree_knn_classification_predict.h:88