22 #ifndef __PCA_EXPLAINED_VARIANCE_BATCH_H__
23 #define __PCA_EXPLAINED_VARIANCE_BATCH_H__
25 #include "algorithms/algorithm.h"
26 #include "algorithms/pca/pca_explained_variance_types.h"
34 namespace quality_metric
39 namespace explained_variance
56 template<
typename algorithmFPType, Method method, CpuType cpu>
57 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
61 BatchContainer(daal::services::Environment::env *daalEnv);
63 virtual ~BatchContainer();
70 virtual services::Status compute() DAAL_C11_OVERRIDE;
85 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
86 class DAAL_EXPORT Batch :
public daal::algorithms::quality_metric::Batch
89 typedef algorithms::pca::quality_metric::explained_variance::Input InputType;
90 typedef algorithms::pca::quality_metric::explained_variance::Parameter ParameterType;
91 typedef algorithms::pca::quality_metric::explained_variance::Result ResultType;
94 ParameterType parameter;
97 Batch(
size_t nFeatures = 0,
size_t nComponents = 0): parameter(nFeatures, nComponents)
108 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
111 input.set(eigenvalues, other.input.get(eigenvalues));
118 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
124 ResultPtr getResult()
const
135 services::Status setResult(
const ResultPtr& result)
137 DAAL_CHECK(result, services::ErrorNullResult)
139 _res = _result.get();
140 return services::Status();
147 virtual void setInput(
const algorithms::Input *other) DAAL_C11_OVERRIDE
149 const InputType *inputPtr =
static_cast<const InputType *
>(other);
150 input.set(eigenvalues, inputPtr->get(eigenvalues));
158 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
160 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
164 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
166 return new Batch<algorithmFPType, method>(*this);
169 services::Status allocateResult() DAAL_C11_OVERRIDE
171 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
172 _res = _result.get();
176 virtual algorithms::ResultPtr getResultImpl() const DAAL_C11_OVERRIDE
183 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
186 _result.reset(
new ResultType());
194 using interface1::BatchContainer;
195 using interface1::Batch;
daal::algorithms::pca::quality_metric::explained_variance::interface1::BatchContainer
Class containing methods to compute regression quality metric.
Definition: pca_explained_variance_batch.h:57
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::pca::quality_metric::explained_variance::interface1::Batch::setInput
virtual void setInput(const algorithms::Input *other) DAAL_C11_OVERRIDE
Definition: pca_explained_variance_batch.h:147
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::input
InputType input
Definition: pca_explained_variance_batch.h:93
daal::batch
Definition: daal_defines.h:110
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: pca_explained_variance_batch.h:158
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::Batch
Batch(size_t nFeatures=0, size_t nComponents=0)
Definition: pca_explained_variance_batch.h:97
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: pca_explained_variance_batch.h:108
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:68
daal::algorithms::pca::quality_metric::explained_variance::eigenvalues
Definition: pca_explained_variance_types.h:61
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::getResult
ResultPtr getResult() const
Definition: pca_explained_variance_batch.h:124
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: pca_explained_variance_batch.h:135
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_explained_variance_batch.h:118
daal::services::ErrorNullResult
Definition: error_indexes.h:96
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::parameter
ParameterType parameter
Definition: pca_explained_variance_batch.h:94
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch
Computes the linear regression quality metric in the batch processing mode.
Definition: pca_explained_variance_batch.h:86