49 #ifndef __SVM_TRAIN_H__
50 #define __SVM_TRAIN_H__
52 #include "algorithms/algorithm.h"
54 #include "algorithms/svm/svm_train_types.h"
55 #include "algorithms/classifier/classifier_training_batch.h"
80 template<
typename algorithmFPType, Method method, CpuType cpu>
81 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
89 BatchContainer(daal::services::Environment::env *daalEnv);
97 services::Status compute() DAAL_C11_OVERRIDE;
117 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = boser>
118 class DAAL_EXPORT Batch :
public classifier::training::Batch
122 classifier::training::Input input;
136 Batch(
const Batch<algorithmFPType, method> &other) : classifier::training::Batch(other),
137 parameter(other.parameter), input(other.input)
148 classifier::training::Input * getInput() DAAL_C11_OVERRIDE {
return &input; }
154 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
160 ResultPtr getResult()
162 return Result::cast(_result);
168 services::Status resetResult() DAAL_C11_OVERRIDE
170 _result.reset(
new Result());
171 DAAL_CHECK(_result, services::ErrorNullResult);
173 return services::Status();
181 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
183 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
187 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
189 return new Batch<algorithmFPType, method>(*this);
192 services::Status allocateResult() DAAL_C11_OVERRIDE
194 ResultPtr res = getResult();
195 DAAL_CHECK(res, services::ErrorNullResult);
196 services::Status s = res->template allocate<algorithmFPType>(&input, _par, (int) method);
197 _res = _result.get();
203 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
206 _result.reset(
new Result());
211 using interface1::BatchContainer;
212 using interface1::Batch;
daal::algorithms::svm::training::interface1::Result
Provides methods to access final results obtained with the compute() method of the SVM training algor...
Definition: svm_train_types.h:93
daal
Definition: algorithm_base_common.h:57
daal::algorithms::svm::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: svm_train.h:181
daal::algorithms::svm::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: svm_train.h:154
daal::algorithms::svm::training::interface1::Batch::input
classifier::training::Input input
Definition: svm_train.h:122
daal::algorithms::svm::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: svm_train.h:136
daal::algorithms::svm::training::interface1::BatchContainer
Class containing methods to compute results of the SVM training.
Definition: svm_train.h:81
daal::algorithms::svm::training::interface1::Batch::parameter
Parameter parameter
Definition: svm_train.h:121
daal::batch
Definition: daal_defines.h:131
daal::algorithms::svm::training::interface1::Batch::Batch
Batch()
Definition: svm_train.h:125
daal::algorithms::svm::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: svm_train.h:160
daal::algorithms::svm::training::interface1::Batch::getInput
classifier::training::Input * getInput() DAAL_C11_OVERRIDE
Definition: svm_train.h:148
daal::algorithms::svm::training::interface1::Batch::resetResult
services::Status resetResult() DAAL_C11_OVERRIDE
Definition: svm_train.h:168
daal::algorithms::svm::training::interface1::Batch
Algorithm class to train the SVM model
Definition: svm_train.h:118
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:76