22 #ifndef __RIDGE_REGRESSION_TRAINING_BATCH_H__
23 #define __RIDGE_REGRESSION_TRAINING_BATCH_H__
25 #include "algorithms/algorithm.h"
26 #include "services/daal_defines.h"
27 #include "services/daal_memory.h"
28 #include "algorithms/ridge_regression/ridge_regression_training_types.h"
29 #include "algorithms/ridge_regression/ridge_regression_model.h"
30 #include "algorithms/linear_model/linear_model_training_batch.h"
36 namespace ridge_regression
51 template<
typename algorithmFPType, Method method, CpuType cpu>
52 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
59 BatchContainer(daal::services::Environment::env *daalEnv);
69 services::Status compute() DAAL_C11_OVERRIDE;
88 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = normEqDense>
89 class DAAL_EXPORT Batch :
public linear_model::training::Batch
92 typedef algorithms::ridge_regression::training::Input InputType;
93 typedef algorithms::ridge_regression::TrainParameter ParameterType;
94 typedef algorithms::ridge_regression::training::Result ResultType;
97 ParameterType parameter;
111 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
118 virtual regression::training::Input* getInput() DAAL_C11_OVERRIDE {
return &input; }
124 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
130 ResultPtr getResult() {
return ResultType::cast(_result); }
138 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
140 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
145 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
147 return new Batch<algorithmFPType, method>(*this);
150 services::Status allocateResult() DAAL_C11_OVERRIDE
152 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter, method);
153 _res = _result.get();
159 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
162 _result.reset(
new ResultType());
168 using interface1::BatchContainer;
169 using interface1::Batch;
daal::algorithms::ridge_regression::training::interface1::Batch::parameter
ParameterType parameter
Definition: ridge_regression_training_batch.h:97
daal::algorithms::ridge_regression::training::interface1::Batch::input
InputType input
Definition: ridge_regression_training_batch.h:96
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:89
daal
Definition: algorithm_base_common.h:31
daal::algorithms::ridge_regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: ridge_regression_training_batch.h:124
daal::batch
Definition: daal_defines.h:106
daal::algorithms::ridge_regression::training::interface1::Batch::Batch
Batch()
Definition: ridge_regression_training_batch.h:100
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:52
daal::algorithms::ridge_regression::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: ridge_regression_training_batch.h:138
daal::algorithms::ridge_regression::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: ridge_regression_training_batch.h:111
daal::algorithms::ridge_regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: ridge_regression_training_batch.h:130
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:50