48 #ifndef __PCA_EXPLAINED_VARIANCE_BATCH_H__ 49 #define __PCA_EXPLAINED_VARIANCE_BATCH_H__ 51 #include "algorithms/algorithm.h" 52 #include "algorithms/pca/pca_explained_variance_types.h" 60 namespace quality_metric
65 namespace explained_variance
82 template<
typename algorithmFPType, Method method, CpuType cpu>
83 class DAAL_EXPORT BatchContainer :
public daal::algorithms::AnalysisContainerIface<batch>
87 BatchContainer(daal::services::Environment::env *daalEnv);
89 virtual ~BatchContainer();
96 virtual services::Status compute() DAAL_C11_OVERRIDE;
111 template<
typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>
112 class DAAL_EXPORT Batch :
public daal::algorithms::quality_metric::Batch
115 typedef algorithms::pca::quality_metric::explained_variance::Input InputType;
116 typedef algorithms::pca::quality_metric::explained_variance::Parameter ParameterType;
117 typedef algorithms::pca::quality_metric::explained_variance::Result ResultType;
120 ParameterType parameter;
123 Batch(
size_t nFeatures = 0,
size_t nComponents = 0): parameter(nFeatures, nComponents)
134 Batch(
const Batch<algorithmFPType, method> &other): parameter(other.parameter)
137 input.set(eigenvalues, other.input.get(eigenvalues));
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 InputType *inputPtr =
static_cast<const InputType *
>(other);
176 input.set(eigenvalues, inputPtr->get(eigenvalues));
184 services::SharedPtr<Batch<algorithmFPType, method> > clone()
const 186 return services::SharedPtr<Batch<algorithmFPType, method> >(cloneImpl());
190 virtual Batch<algorithmFPType, method> * cloneImpl()
const DAAL_C11_OVERRIDE
192 return new Batch<algorithmFPType, method>(*this);
195 services::Status allocateResult() DAAL_C11_OVERRIDE
197 services::Status s = _result->allocate<algorithmFPType>(&input, ¶meter, (int) method);
198 _res = _result.get();
202 virtual algorithms::ResultPtr getResultImpl()
const DAAL_C11_OVERRIDE
209 Analysis<batch>::_ac =
new __DAAL_ALGORITHM_CONTAINER(batch, BatchContainer, algorithmFPType, method)(&_env);
212 _result.reset(
new ResultType());
220 using interface1::BatchContainer;
221 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:83
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::pca::quality_metric::explained_variance::interface1::Batch::clone
services::SharedPtr< Batch< algorithmFPType, method > > clone() const
Definition: pca_explained_variance_batch.h:184
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:173
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::input
InputType input
Definition: pca_explained_variance_batch.h:119
daal::algorithms::pca::quality_metric::explained_variance::eigenvalues
Definition: pca_explained_variance_types.h:87
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::algorithms::pca::quality_metric::explained_variance::interface1::Parameter
Parameters for the compute() method of explained variance quality metrics.
Definition: pca_explained_variance_types.h:116
daal::services::interface1::SharedPtr::get
T * get() const
Definition: daal_shared_ptr.h:332
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:123
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::pca::quality_metric::explained_variance::interface1::Batch::Batch
Batch(const Batch< algorithmFPType, method > &other)
Definition: pca_explained_variance_batch.h:134
daal::algorithms::Analysis
Provides methods for execution of operations over data, such as computation of Summary Statistics est...
Definition: analysis.h:94
daal::algorithms::pca::quality_metric::explained_variance::interface1::Result
Provides interface for the result of linear regression quality metrics.
Definition: pca_explained_variance_types.h:177
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::setResult
services::Status setResult(const ResultPtr &result)
Definition: pca_explained_variance_batch.h:161
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::getMethod
virtual int getMethod() const DAAL_C11_OVERRIDE
Definition: pca_explained_variance_batch.h:144
daal::services::ErrorNullResult
Definition: error_indexes.h:122
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::getResult
ResultPtr getResult() const
Definition: pca_explained_variance_batch.h:150
daal::algorithms::pca::quality_metric::explained_variance::interface1::Batch::parameter
ParameterType parameter
Definition: pca_explained_variance_batch.h:120
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:112