22 #ifndef __LINEAR_REGRESSION_GROUP_OF_BETAS_BATCH_H__
23 #define __LINEAR_REGRESSION_GROUP_OF_BETAS_BATCH_H__
25 #include "algorithms/algorithm.h"
26 #include "algorithms/linear_regression/linear_regression_group_of_betas_types.h"
32 namespace linear_regression
37 namespace quality_metric
42 namespace group_of_betas
58 template<
typename algorithmFPType, Method method, CpuType cpu>
59 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
63 BatchContainer(daal::services::Environment::env *daalEnv);
65 virtual ~BatchContainer();
72 virtual services::Status compute() DAAL_C11_OVERRIDE;
87 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
88 class DAAL_EXPORT Batch :
public daal::algorithms::quality_metric::Batch
91 typedef algorithms::linear_regression::quality_metric::group_of_betas::Input InputType;
92 typedef algorithms::linear_regression::quality_metric::group_of_betas::Parameter ParameterType;
93 typedef algorithms::linear_regression::quality_metric::group_of_betas::Result ResultType;
96 ParameterType parameter;
99 Batch(
size_t nBeta,
size_t nBetaReducedModel) : parameter(nBeta, nBetaReducedModel)
110 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
113 input.set(expectedResponses, other.input.get(expectedResponses));
114 input.set(predictedResponses, other.input.get(predictedResponses));
115 input.set(predictedReducedModelResponses, other.input.get(predictedReducedModelResponses));
122 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
128 ResultPtr getResult()
const
139 services::Status setResult(
const ResultPtr& result)
141 DAAL_CHECK(result, services::ErrorNullResult)
143 _res = _result.get();
144 return services::Status();
151 virtual void setInput(
const algorithms::Input *other) DAAL_C11_OVERRIDE
153 const InputType *inputPtr =
static_cast<const InputType *
>(other);
154 input.set(expectedResponses, inputPtr->get(expectedResponses));
155 input.set(predictedResponses, inputPtr->get(predictedResponses));
156 input.set(predictedReducedModelResponses, inputPtr->get(predictedReducedModelResponses));
164 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
166 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
170 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
172 return new Batch<algorithmFPType, method>(*this);
175 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
177 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
178 _res = _result.get();
182 virtual algorithms::ResultPtr getResultImpl() const DAAL_C11_OVERRIDE
189 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
192 _result.reset(
new ResultType());
200 using interface1::BatchContainer;
201 using interface1::Batch;
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::parameter
ParameterType parameter
Definition: linear_regression_group_of_betas_batch.h:96
daal
Definition: algorithm_base_common.h:31
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:53
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::input
InputType input
Definition: linear_regression_group_of_betas_batch.h:95
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::getResult
ResultPtr getResult() const
Definition: linear_regression_group_of_betas_batch.h:128
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:151
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:164
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:110
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedReducedModelResponses
Definition: linear_regression_group_of_betas_types.h:63
daal::batch
Definition: daal_defines.h:110
daal::algorithms::linear_regression::quality_metric::group_of_betas::expectedResponses
Definition: linear_regression_group_of_betas_types.h:61
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:99
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:88
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:139
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:59
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedResponses
Definition: linear_regression_group_of_betas_types.h:62
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:122
daal::services::ErrorNullResult
Definition: error_indexes.h:96