24 #ifndef __PCA_EXPLAINED_VARIANCE_BATCH_H__
25 #define __PCA_EXPLAINED_VARIANCE_BATCH_H__
27 #include "algorithms/algorithm.h"
28 #include "algorithms/pca/pca_explained_variance_types.h"
36 namespace quality_metric
41 namespace explained_variance
58 template<
typename algorithmFPType, Method method, CpuType cpu>
59 class 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::pca::quality_metric::explained_variance::Input InputType;
92 typedef algorithms::pca::quality_metric::explained_variance::Parameter ParameterType;
93 typedef algorithms::pca::quality_metric::explained_variance::Result ResultType;
96 ParameterType parameter;
99 Batch(
size_t nFeatures = 0,
size_t nComponents = 0): parameter(nFeatures, nComponents)
110 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
113 input.set(eigenvalues, other.input.get(eigenvalues));
120 virtual int getMethod() const DAAL_C11_OVERRIDE {
return(
int) method; }
126 ResultPtr getResult()
const
137 services::Status setResult(
const ResultPtr& result)
139 DAAL_CHECK(result, services::ErrorNullResult)
141 _res = _result.get();
142 return services::Status();
149 virtual void setInput(
const algorithms::Input *other) DAAL_C11_OVERRIDE
151 const InputType *inputPtr =
static_cast<const InputType *
>(other);
152 input.set(eigenvalues, inputPtr->get(eigenvalues));
160 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const
162 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
166 virtual Batch<algorithmFPType, method> * cloneImpl() const DAAL_C11_OVERRIDE
168 return new Batch<algorithmFPType, method>(*this);
171 services::Status allocateResult() DAAL_C11_OVERRIDE
173 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
174 _res = _result.get();
178 virtual algorithms::ResultPtr getResultImpl() const DAAL_C11_OVERRIDE
185 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
188 _result.reset(
new ResultType());
196 using interface1::BatchContainer;
197 using interface1::Batch;
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::parameter
ParameterType parameter
Definition: pca_explained_variance_batch.h:96
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:149
daal::batch
Definition: daal_defines.h:112
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_explained_variance_batch.h:120
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: pca_explained_variance_batch.h:137
daal::services::ErrorNullResult
Definition: error_indexes.h:98
daal::algorithms::AnalysisContainerIface
Abstract interface class that provides virtual methods to access and run implementations of the analy...
Definition: analysis.h:55
daal::algorithms::pca::quality_metric::explained_variance::interface1::BatchContainer::~BatchContainer
virtual ~BatchContainer()
daal::algorithms::pca::quality_metric::explained_variance::interface1::BatchContainer::compute
virtual services::Status compute() DAAL_C11_OVERRIDE
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: pca_explained_variance_batch.h:110
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:99
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:88
daal::algorithms::pca::quality_metric::explained_variance::interface1::BatchContainer
Class containing methods to compute regression quality metric.
Definition: pca_explained_variance_batch.h:59
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::input
InputType input
Definition: pca_explained_variance_batch.h:95
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::getResult
ResultPtr getResult() const
Definition: pca_explained_variance_batch.h:126
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:70
daal::algorithms::pca::quality_metric::explained_variance::eigenvalues
Definition: pca_explained_variance_types.h:63
daal::algorithms::pca::quality_metric::explained_variance::interface1::BatchContainer::BatchContainer
BatchContainer(daal::services::Environment::env *daalEnv)
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: pca_explained_variance_batch.h:160