49 #ifndef __LINEAR_REGRESSION_TRAINING_BATCH_H__ 50 #define __LINEAR_REGRESSION_TRAINING_BATCH_H__ 52 #include "algorithms/algorithm.h" 53 #include "services/daal_defines.h" 54 #include "services/daal_memory.h" 55 #include "algorithms/linear_regression/linear_regression_training_types.h" 56 #include "algorithms/linear_regression/linear_regression_model.h" 57 #include "algorithms/linear_model/linear_model_training_batch.h" 63 namespace linear_regression
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 = normEqDense>
118 class DAAL_EXPORT Batch :
public linear_model::training::Batch
121 typedef algorithms::linear_regression::training::Input InputType;
122 typedef algorithms::linear_regression::Parameter ParameterType;
123 typedef algorithms::linear_regression::training::Result ResultType;
126 ParameterType parameter;
140 Batch(
const Batch<algorithmFPType, method> &other) : input(other.input), parameter(other.parameter)
147 virtual regression::training::Input* getInput() DAAL_C11_OVERRIDE {
return &input; }
153 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int)method; }
159 ResultPtr getResult() {
return ResultType::cast(_result); }
167 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 169 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
173 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
175 return new Batch<algorithmFPType, method>(*this);
178 services::Status allocateResult() DAAL_C11_OVERRIDE
180 services::Status s = getResult()->template allocate<algorithmFPType>(&input, ¶meter, method);
181 _res = _result.get();
187 _ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
190 _result.reset(
new ResultType());
195 using interface1::BatchContainer;
196 using interface1::Batch;
daal::algorithms::linear_regression::training::interface1::Batch
Provides methods for linear regression model-based training in the batch processing mode...
Definition: linear_regression_training_batch.h:118
daal::algorithms::linear_regression::training::interface1::Batch::getResult
ResultPtr getResult()
Definition: linear_regression_training_batch.h:159
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::linear_regression::training::interface1::Batch::getInput
virtual regression::training::Input * getInput() DAAL_C11_OVERRIDE
Definition: linear_regression_training_batch.h:147
daal::algorithms::linear_regression::training::interface1::BatchContainer
Class containing methods for normal equations linear regression model-based training using algorithmF...
Definition: linear_regression_training_batch.h:81
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::linear_regression::training::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: linear_regression_training_batch.h:140
daal::algorithms::linear_regression::training::interface1::Batch::parameter
ParameterType parameter
Definition: linear_regression_training_batch.h:126
daal::batch
Definition: daal_defines.h:132
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::linear_regression::training::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: linear_regression_training_batch.h:167
daal::algorithms::linear_regression::training::interface1::Result
Provides methods to access the result obtained with the compute() method of linear regression model-b...
Definition: linear_regression_training_types.h:361
daal::algorithms::linear_regression::training::interface1::Batch::Batch
Batch()
Definition: linear_regression_training_batch.h:129
daal::algorithms::linear_regression::training::interface1::Batch::input
InputType input
Definition: linear_regression_training_batch.h:125
daal::algorithms::linear_regression::interface1::Parameter
Parameters for the linear regression algorithm.
Definition: linear_regression_model.h:82
daal::algorithms::linear_regression::training::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: linear_regression_training_batch.h:153
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