24 #ifndef __RIDGE_REGRESSION_TRAINING_BATCH_H__
25 #define __RIDGE_REGRESSION_TRAINING_BATCH_H__
27 #include "algorithms/algorithm.h"
28 #include "services/daal_defines.h"
29 #include "services/daal_memory.h"
30 #include "algorithms/ridge_regression/ridge_regression_training_types.h"
31 #include "algorithms/ridge_regression/ridge_regression_model.h"
32 #include "algorithms/linear_model/linear_model_training_batch.h"
38 namespace ridge_regression
53 template<
typename algorithmFPType, Method method, CpuType cpu>
54 class BatchContainer :
public TrainingContainerIface<batch>
61 BatchContainer(daal::services::Environment::env *daalEnv);
71 services::Status compute() DAAL_C11_OVERRIDE;
90 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = normEqDense>
91 class DAAL_EXPORT Batch :
public linear_model::training::Batch
94 typedef algorithms::ridge_regression::training::Input InputType;
95 typedef algorithms::ridge_regression::TrainParameter ParameterType;
96 typedef algorithms::ridge_regression::training::Result ResultType;
99 ParameterType parameter;
113 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
120 virtual regression::training::Input* getInput() DAAL_C11_OVERRIDE {
return &input; }
126 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
132 ResultPtr getResult() {
return ResultType::cast(_result); }
137 virtual services::Status resetResult() DAAL_C11_OVERRIDE
139 _result.reset(
new ResultType());
140 DAAL_CHECK(_result, services::ErrorNullResult)
142 return services::Status();
150 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
152 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
157 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
159 return new Batch<algorithmFPType, method>(*this);
162 services::Status allocateResult() DAAL_C11_OVERRIDE
164 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter, method);
165 _res = _result.get();
171 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
174 _result.reset(
new ResultType());
180 using interface1::BatchContainer;
181 using interface1::Batch;
daal::algorithms::ridge_regression::training::interface1::Batch::input
InputType input
Definition: ridge_regression_training_batch.h:98
daal::batch
Definition: daal_defines.h:112
daal::algorithms::ridge_regression::training::interface1::BatchContainer::compute
services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::ridge_regression::training::interface1::Batch::parameter
ParameterType parameter
Definition: ridge_regression_training_batch.h:99
daal::algorithms::ridge_regression::training::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::ridge_regression::training::interface1::Batch
Provides methods for ridge regression model-based training in the batch processing mode...
Definition: ridge_regression_training_batch.h:91
daal::algorithms::ridge_regression::training::interface1::BatchContainer
Class containing methods for normal equations ridge regression model-based training using algorithmFP...
Definition: ridge_regression_training_batch.h:54
daal::algorithms::ridge_regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: ridge_regression_training_batch.h:132
daal::algorithms::ridge_regression::training::interface1::BatchContainer::~BatchContainer
~BatchContainer()
daal::algorithms::ridge_regression::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: ridge_regression_training_batch.h:113
daal::algorithms::ridge_regression::training::interface1::Batch::Batch
Batch()
Definition: ridge_regression_training_batch.h:102
daal::algorithms::ridge_regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: ridge_regression_training_batch.h:126
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:52