24 #ifndef __LINEAR_REGRESSION_GROUP_OF_BETAS_BATCH_H__
25 #define __LINEAR_REGRESSION_GROUP_OF_BETAS_BATCH_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/linear_regression/linear_regression_group_of_betas_types.h"
34 namespace linear_regression
39 namespace quality_metric
44 namespace group_of_betas
60 template<
typename algorithmFPType, Method method, CpuType cpu>
61 class BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
65 BatchContainer(daal::services::Environment::env *daalEnv);
67 virtual ~BatchContainer();
74 virtual services::Status compute() DAAL_C11_OVERRIDE;
89 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
90 class DAAL_EXPORT Batch :
public daal::algorithms::quality_metric::Batch
93 typedef algorithms::linear_regression::quality_metric::group_of_betas::Input InputType;
94 typedef algorithms::linear_regression::quality_metric::group_of_betas::Parameter ParameterType;
95 typedef algorithms::linear_regression::quality_metric::group_of_betas::Result ResultType;
98 ParameterType parameter;
101 Batch(
size_t nBeta,
size_t nBetaReducedModel) : parameter(nBeta, nBetaReducedModel)
112 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
115 input.set(expectedResponses, other.input.get(expectedResponses));
116 input.set(predictedResponses, other.input.get(predictedResponses));
117 input.set(predictedReducedModelResponses, other.input.get(predictedReducedModelResponses));
124 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
130 ResultPtr getResult()
const
141 services::Status setResult(
const ResultPtr& result)
143 DAAL_CHECK(result, services::ErrorNullResult)
145 _res = _result.get();
146 return services::Status();
153 virtual void setInput(
const algorithms::Input *other) DAAL_C11_OVERRIDE
155 const InputType *inputPtr =
static_cast<const InputType *
>(other);
156 input.set(expectedResponses, inputPtr->get(expectedResponses));
157 input.set(predictedResponses, inputPtr->get(predictedResponses));
158 input.set(predictedReducedModelResponses, inputPtr->get(predictedReducedModelResponses));
166 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
168 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
172 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
174 return new Batch<algorithmFPType, method>(*this);
177 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
179 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
180 _res = _result.get();
184 virtual algorithms::ResultPtr getResultImpl() const DAAL_C11_OVERRIDE
191 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
194 _result.reset(
new ResultType());
202 using interface1::BatchContainer;
203 using interface1::Batch;
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch
Computes the linear regression quality metric in the batch processing mode.
Definition: linear_regression_group_of_betas_batch.h:90
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::getResult
ResultPtr getResult() const
Definition: linear_regression_group_of_betas_batch.h:130
daal::batch
Definition: daal_defines.h:112
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: linear_regression_group_of_betas_batch.h:166
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::BatchContainer
Class containing methods to compute regression quality metric.
Definition: linear_regression_group_of_betas_batch.h:61
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::parameter
ParameterType parameter
Definition: linear_regression_group_of_betas_batch.h:98
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedReducedModelResponses
Definition: linear_regression_group_of_betas_types.h:65
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: linear_regression_group_of_betas_batch.h:141
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedResponses
Definition: linear_regression_group_of_betas_types.h:64
daal::algorithms::linear_regression::quality_metric::group_of_betas::expectedResponses
Definition: linear_regression_group_of_betas_types.h:63
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::BatchContainer::~BatchContainer
virtual ~BatchContainer()
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::setInput
virtual void setInput(const algorithms::Input *other) DAAL_C11_OVERRIDE
Definition: linear_regression_group_of_betas_batch.h:153
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: linear_regression_group_of_betas_batch.h:112
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: linear_regression_group_of_betas_batch.h:124
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::input
InputType input
Definition: linear_regression_group_of_betas_batch.h:97
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::Batch
Batch(size_t nBeta, size_t nBetaReducedModel)
Definition: linear_regression_group_of_betas_batch.h:101
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70