48 #ifndef __RIDGE_REGRESSION_TRAINING_BATCH_H__ 49 #define __RIDGE_REGRESSION_TRAINING_BATCH_H__ 51 #include "algorithms/algorithm.h" 52 #include "services/daal_defines.h" 53 #include "services/daal_memory.h" 54 #include "algorithms/ridge_regression/ridge_regression_training_types.h" 55 #include "algorithms/ridge_regression/ridge_regression_model.h" 56 #include "algorithms/linear_model/linear_model_training_batch.h" 62 namespace ridge_regression
77 template<
typename algorithmFPType, Method method, CpuType cpu>
78 class DAAL_EXPORT BatchContainer :
public TrainingContainerIface<batch>
85 BatchContainer(daal::services::Environment::env *daalEnv);
95 services::Status compute() DAAL_C11_OVERRIDE;
114 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = normEqDense>
115 class DAAL_EXPORT Batch :
public linear_model::training::Batch
118 typedef algorithms::ridge_regression::training::Input InputType;
119 typedef algorithms::ridge_regression::TrainParameter ParameterType;
120 typedef algorithms::ridge_regression::training::Result ResultType;
123 ParameterType parameter;
137 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
144 virtual regression::training::Input* getInput() DAAL_C11_OVERRIDE {
return &input; }
150 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
156 ResultPtr getResult() {
return ResultType::cast(_result); }
164 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 166 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
171 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
173 return new Batch<algorithmFPType, method>(*this);
176 services::Status allocateResult() DAAL_C11_OVERRIDE
178 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter, method);
179 _res = _result.get();
185 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
188 _result.reset(
new ResultType());
194 using interface1::BatchContainer;
195 using interface1::Batch;
daal::algorithms::ridge_regression::training::interface1::Batch::parameter
ParameterType parameter
Definition: ridge_regression_training_batch.h:123
daal::algorithms::ridge_regression::training::interface1::Batch::input
InputType input
Definition: ridge_regression_training_batch.h:122
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:115
daal::services::interface1::Environment::_envStruct
The environment structure.
Definition: env_detect.h:95
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::ridge_regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: ridge_regression_training_batch.h:150
daal::algorithms::ridge_regression::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: ridge_regression_training_batch.h:164
daal::algorithms::linear_model::training::interface1::Result
Provides methods to access the result obtained with the compute() method of the regression model-base...
Definition: linear_model_training_types.h:174
daal::algorithms::linear_model::interface1::Parameter
Parameters for the regression algorithm.
Definition: linear_model_model.h:85
daal::algorithms::ridge_regression::interface1::TrainParameter
Parameters for the ridge regression algorithm.
Definition: ridge_regression_model.h:94
daal::batch
Definition: daal_defines.h:132
daal::algorithms::ridge_regression::training::interface1::Batch::Batch
Batch()
Definition: ridge_regression_training_batch.h:126
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::ridge_regression::training::interface1::Batch::getInput
virtual regression::training::Input * getInput() DAAL_C11_OVERRIDE
Definition: ridge_regression_training_batch.h:144
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:78
daal::algorithms::ridge_regression::training::interface1::Result
Provides methods to access the result obtained with the compute() method of ridge regression model-ba...
Definition: ridge_regression_training_types.h:358
daal::algorithms::ridge_regression::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: ridge_regression_training_batch.h:137
daal::algorithms::ridge_regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: ridge_regression_training_batch.h:156
daal::algorithms::linear_model::training::interface1::Batch
Provides methods for linear model model-based training in the batch processing mode.
Definition: linear_model_training_batch.h:78
daal::algorithms::TrainingContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the model...
Definition: training.h:76