24 #ifndef __SVM_PREDICT_H__
25 #define __SVM_PREDICT_H__
27 #include "algorithms/algorithm.h"
28 #include "data_management/data/numeric_table.h"
29 #include "algorithms/classifier/classifier_predict.h"
30 #include "algorithms/svm/svm_predict_types.h"
59 template<
typename algorithmFPType, Method method, CpuType cpu>
60 class BatchContainer :
public PredictionContainerIface
67 BatchContainer(daal::services::Environment::env *daalEnv);
75 services::Status compute() DAAL_C11_OVERRIDE;
95 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
96 class Batch :
public classifier::prediction::interface1::Batch
99 typedef classifier::prediction::interface1::Batch super;
101 typedef algorithms::svm::prediction::Input InputType;
102 typedef algorithms::svm::interface1::Parameter ParameterType;
103 typedef typename super::ResultType ResultType;
106 ParameterType parameter;
120 Batch(
const Batch<algorithmFPType, method> &other) : classifier::prediction::interface1::Batch(other),
121 input(other.input), parameter(other.parameter)
132 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
138 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
146 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
148 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
153 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
155 return new Batch<algorithmFPType, method>(*this);
158 services::Status allocateResult() DAAL_C11_OVERRIDE
160 services::Status s = _result->allocate<algorithmFPType>(&input, 0, 0);
161 _res = _result.get();
168 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
194 template<
typename algorithmFPType, Method method, CpuType cpu>
195 class BatchContainer :
public PredictionContainerIface
202 BatchContainer(daal::services::Environment::env *daalEnv);
210 services::Status compute() DAAL_C11_OVERRIDE;
230 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
231 class Batch :
public classifier::prediction::Batch
234 typedef classifier::prediction::Batch super;
236 typedef algorithms::svm::prediction::Input InputType;
237 typedef algorithms::svm::Parameter ParameterType;
238 typedef typename super::ResultType ResultType;
241 ParameterType parameter;
255 Batch(
const Batch<algorithmFPType, method> &other) : classifier::prediction::Batch(other),
256 input(other.input), parameter(other.parameter)
267 InputType * getInput() DAAL_C11_OVERRIDE {
return &input; }
273 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
281 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
283 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
288 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
290 return new Batch<algorithmFPType, method>(*this);
293 services::Status allocateResult() DAAL_C11_OVERRIDE
295 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, 0);
296 _res = _result.get();
303 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
309 using interface2::BatchContainer;
310 using interface2::Batch;
daal::algorithms::svm::prediction::interface2::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: svm_predict.h:255
daal::algorithms::svm::prediction::interface1::BatchContainer
Provides methods to run implementations of the SVM algorithm. It is associated with the Prediction cl...
Definition: svm_predict.h:60
daal::algorithms::svm::prediction::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::svm::prediction::interface2::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: svm_predict.h:281
daal::batch
Definition: daal_defines.h:112
daal::algorithms::svm::prediction::interface2::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: svm_predict.h:267
daal::algorithms::svm::prediction::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: svm_predict.h:146
daal::algorithms::neural_networks::prediction::prediction
Definition: neural_networks_prediction_result.h:55
daal::algorithms::svm::prediction::interface2::Batch::Batch
Batch()
Definition: svm_predict.h:244
daal::algorithms::svm::prediction::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: svm_predict.h:120
daal::algorithms::svm::prediction::interface1::Batch::parameter
ParameterType parameter
Definition: svm_predict.h:106
daal::algorithms::svm::prediction::interface2::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::classifier::prediction::interface1::Input
Input objects in the prediction stage of the classification algorithm.
Definition: classifier_predict_types.h:111
daal::algorithms::svm::prediction::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::PredictionContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the algor...
Definition: prediction.h:42
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::svm::prediction::interface2::Batch::parameter
ParameterType parameter
Definition: svm_predict.h:241
daal::algorithms::svm::prediction::interface2::BatchContainer
Provides methods to run implementations of the SVM algorithm. It is associated with the Prediction cl...
Definition: svm_predict.h:195
daal::algorithms::svm::prediction::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::svm::prediction::interface2::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: svm_predict.h:273
daal::algorithms::classifier::interface1::Parameter
Base class for the parameters of the classification algorithm.
Definition: classifier_model.h:69
daal::algorithms::svm::prediction::interface2::Batch::input
InputType input
Definition: svm_predict.h:240
daal::algorithms::svm::prediction::interface2::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::svm::prediction::interface1::Batch
Algorithm class for making predictions based on the SVM model
Definition: svm_predict.h:96
daal::algorithms::svm::interface1::Parameter
Optional parameters.
Definition: svm_model.h:66
daal::algorithms::svm::prediction::interface2::Batch
Algorithm class for making predictions based on the SVM model
Definition: svm_predict.h:231
daal::algorithms::svm::prediction::interface1::Batch::Batch
Batch()
Definition: svm_predict.h:109
daal::algorithms::svm::prediction::interface1::Batch::getInput
InputType * getInput() DAAL_C11_OVERRIDE
Definition: svm_predict.h:132
daal::algorithms::svm::prediction::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: svm_predict.h:138
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::svm::prediction::interface1::Batch::input
InputType input
Definition: svm_predict.h:105
daal::algorithms::svm::prediction::interface2::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)