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
117 typedef algorithms::linear_regression::quality_metric::group_of_betas::Input InputType;
118 typedef algorithms::linear_regression::quality_metric::group_of_betas::Parameter ParameterType;
119 typedef algorithms::linear_regression::quality_metric::group_of_betas::Result ResultType;
122 ParameterType parameter;
125 Batch(
size_t nBeta,
size_t nBetaReducedModel) : parameter(nBeta, nBetaReducedModel)
136 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
139 input.set(expectedResponses, other.input.get(expectedResponses));
140 input.set(predictedResponses, other.input.get(predictedResponses));
141 input.set(predictedReducedModelResponses, other.input.get(predictedReducedModelResponses));
148 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
154 ResultPtr getResult()
const 165 services::Status setResult(
const ResultPtr& result)
167 DAAL_CHECK(result, services::ErrorNullResult)
169 _res = _result.get();
170 return services::Status();
177 virtual void setInput(
const algorithms::Input *other) DAAL_C11_OVERRIDE
179 const InputType *inputPtr =
static_cast<const InputType *
>(other);
180 input.set(expectedResponses, inputPtr->get(expectedResponses));
181 input.set(predictedResponses, inputPtr->get(predictedResponses));
182 input.set(predictedReducedModelResponses, inputPtr->get(predictedReducedModelResponses));
190 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 192 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
196 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
198 return new Batch<algorithmFPType, method>(*this);
201 virtual services::Status allocateResult() DAAL_C11_OVERRIDE
203 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
204 _res = _result.get();
208 virtual algorithms::ResultPtr getResultImpl()
const DAAL_C11_OVERRIDE
215 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
218 _result.reset(
new ResultType());
226 using interface1::BatchContainer;
227 using interface1::Batch;
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:190
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::parameter
ParameterType parameter
Definition: linear_regression_group_of_betas_batch.h:122
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::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::input
InputType input
Definition: linear_regression_group_of_betas_batch.h:121
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::Result
Provides interface for the result of linear regression quality metrics.
Definition: linear_regression_group_of_betas_types.h:191
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:177
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:136
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::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
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:125
daal::algorithms::linear_regression::quality_metric::group_of_betas::interface1::Batch::getResult
ResultPtr getResult() const
Definition: linear_regression_group_of_betas_batch.h:154
daal::algorithms::quality_metric::interface1::Batch
Provides methods to compute quality metrics of an algorithm in the batch processing mode...
Definition: algorithm_quality_metric_batch.h:79
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:165
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::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::predictedReducedModelResponses
Definition: linear_regression_group_of_betas_types.h:89
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:148
daal::algorithms::linear_regression::quality_metric::group_of_betas::predictedResponses
Definition: linear_regression_group_of_betas_types.h:88
daal::services::ErrorNullResult
Definition: error_indexes.h:122