22 #ifndef __KDTREE_KNN_CLASSIFICATION_PREDICT_H__
23 #define __KDTREE_KNN_CLASSIFICATION_PREDICT_H__
25 #include "algorithms/algorithm.h"
26 #include "algorithms/k_nearest_neighbors/kdtree_knn_classification_predict_types.h"
27 #include "algorithms/k_nearest_neighbors/kdtree_knn_classification_model.h"
28 #include "algorithms/classifier/classifier_predict.h"
29 #include "data_management/data/homogen_numeric_table.h"
35 namespace kdtree_knn_classification
51 template<
typename algorithmFPType, Method method, CpuType cpu>
52 class DAAL_EXPORT BatchContainer :
public PredictionContainerIface
59 BatchContainer(daal::services::Environment::env *daalEnv);
66 services::Status compute() DAAL_C11_OVERRIDE;
85 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
86 class Batch :
public classifier::prediction::Batch
89 typedef classifier::prediction::Batch super;
91 typedef algorithms::kdtree_knn_classification::prediction::Input InputType;
92 typedef algorithms::kdtree_knn_classification::Parameter ParameterType;
93 typedef typename super::ResultType ResultType;
96 ParameterType parameter;
110 Batch(
const Batch<algorithmFPType, method> & other) : classifier::prediction::Batch(other), input(other.input), parameter(other.parameter)
119 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
125 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
132 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
134 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
138 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
140 return new Batch<algorithmFPType, method>(*this);
143 services::Status allocateResult() DAAL_C11_OVERRIDE
145 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int)method);
146 _res = _result.get();
153 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
161 using interface1::BatchContainer;
162 using interface1::Batch;
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:52
daal
Definition: algorithm_base_common.h:31
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_predict.h:119
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::Batch
Batch()
Definition: kdtree_knn_classification_predict.h:99
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:40
daal::batch
Definition: daal_defines.h:106
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: kdtree_knn_classification_predict.h:96
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: kdtree_knn_classification_predict.h:132
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::input
InputType input
Definition: kdtree_knn_classification_predict.h:95
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:86
daal::algorithms::classifier::prediction::prediction
Definition: classifier_predict_types.h:76
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: kdtree_knn_classification_predict.h:125
daal::algorithms::kdtree_knn_classification::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: kdtree_knn_classification_predict.h:110