48 #ifndef __LINEAR_REGRESSION_GROUP_OF_BETAS_BATCH_H__
49 #define __LINEAR_REGRESSION_GROUP_OF_BETAS_BATCH_H__
51 #include "algorithms/algorithm.h"
52 #include "algorithms/linear_regression/linear_regression_group_of_betas_types.h"
58 namespace linear_regression
63 namespace quality_metric
68 namespace group_of_betas
84 template<
typename algorithmFPType, Method method, CpuType cpu>
85 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
89 BatchContainer(daal::services::Environment::env *daalEnv);
91 virtual ~BatchContainer();
98 virtual services::Status compute() DAAL_C11_OVERRIDE;
113 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
114 class DAAL_EXPORT Batch :
public daal::algorithms::quality_metric::Batch
121 Batch(
size_t nBeta,
size_t nBetaReducedModel) : parameter(nBeta, nBetaReducedModel)
132 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
135 input.set(expectedResponses, other.input.get(expectedResponses));
136 input.set(predictedResponses, other.input.get(predictedResponses));
137 input.set(predictedReducedModelResponses, other.input.get(predictedReducedModelResponses));
144 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
150 ResultPtr getResult()
const
161 services::Status setResult(
const ResultPtr& result)
163 DAAL_CHECK(result, services::ErrorNullResult)
165 _res = _result.get();
166 return services::Status();
173 virtual void setInput(
const algorithms::Input *other) DAAL_C11_OVERRIDE
175 const Input *inputPtr =
static_cast<const Input *
>(other);
176 input.set(expectedResponses, inputPtr->get(expectedResponses));
177 input.set(predictedResponses, inputPtr->get(predictedResponses));
178 input.set(predictedReducedModelResponses, inputPtr->get(predictedReducedModelResponses));
186 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
188 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
192 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
194 return new Batch<algorithmFPType, method>(*this);
197 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
199 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
200 _res = _result.get();
204 virtual algorithms::ResultPtr getResultImpl() const DAAL_C11_OVERRIDE
211 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
214 _result.reset(
new Result());
222 using interface1::BatchContainer;
223 using interface1::Batch;
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::input
Input input
Definition: linear_regression_group_of_betas_batch.h:117
daal
Definition: algorithm_base_common.h:57
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:79
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::getResult
ResultPtr getResult() const
Definition: linear_regression_group_of_betas_batch.h:150
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:173
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:186
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:132
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedReducedModelResponses
Definition: linear_regression_group_of_betas_types.h:89
daal::batch
Definition: daal_defines.h:131
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::parameter
Parameter parameter
Definition: linear_regression_group_of_betas_batch.h:118
daal::algorithms::linear_regression::quality_metric::group_of_betas::expectedResponses
Definition: linear_regression_group_of_betas_types.h:87
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:121
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:114
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:161
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:85
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedResponses
Definition: linear_regression_group_of_betas_types.h:88
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Parameter
Parameters for the compute() method of a group of betas quality metrics.
Definition: linear_regression_group_of_betas_types.h:123
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:144
daal::services::ErrorNullResult
Definition: error_indexes.h:122