22 #ifndef __ALGORITHM_QUALITY_METRIC_SET_BATCH_H__
23 #define __ALGORITHM_QUALITY_METRIC_SET_BATCH_H__
25 #include "algorithms/algorithm_quality_metric_set_types.h"
34 namespace quality_metric_set
53 InputAlgorithmsCollection inputAlgorithms;
55 Batch(
bool useDefaultMetrics =
true) : _useDefaultMetrics(useDefaultMetrics)
63 ResultCollectionPtr getResultCollection() {
return _resultCollection; }
69 InputDataCollectionPtr getInputDataCollection() {
return _inputData; }
76 services::Status compute()
78 this->_status = computeNoThrow();
79 return services::throwIfPossible(this->_status);
87 services::Status computeNoThrow()
89 DAAL_CHECK(inputAlgorithms.size(), services::ErrorEmptyInputAlgorithmsCollection)
91 for (
size_t i = 0; i < inputAlgorithms.size(); i++)
93 size_t key = inputAlgorithms.getKeyByIndex((
int)i);
94 inputAlgorithms[key]->setInput(_inputData->getInput(key).get());
95 s = inputAlgorithms[key]->computeNoThrow();
97 _resultCollection->add(key, inputAlgorithms[key]->getResult());
106 services::SharedPtr<services::ErrorCollection> getErrors()
108 return _status.getCollection();
112 virtual void initializeQualityMetrics() = 0;
114 bool _useDefaultMetrics;
115 InputDataCollectionPtr _inputData;
116 ResultCollectionPtr _resultCollection;
117 services::Status _status;
121 using interface1::Batch;
daal::algorithms::quality_metric_set::interface1::Batch::compute
services::Status compute()
Definition: algorithm_quality_metric_set_batch.h:76
daal
Definition: algorithm_base_common.h:31
daal::algorithms::quality_metric_set::interface1::Batch
Provides methods to compute a quality metric set of an algorithm in the batch processing mode...
Definition: algorithm_quality_metric_set_batch.h:50
daal::algorithms::quality_metric_set::interface1::Batch::_inputData
InputDataCollectionPtr _inputData
Definition: algorithm_quality_metric_set_batch.h:115
daal::algorithms::quality_metric_set::interface1::Batch::getInputDataCollection
InputDataCollectionPtr getInputDataCollection()
Definition: algorithm_quality_metric_set_batch.h:69
daal::algorithms::quality_metric_set::interface1::Batch::inputAlgorithms
InputAlgorithmsCollection inputAlgorithms
Definition: algorithm_quality_metric_set_batch.h:53
daal::algorithms::quality_metric_set::interface1::Batch::computeNoThrow
services::Status computeNoThrow()
Definition: algorithm_quality_metric_set_batch.h:87
daal::algorithms::quality_metric_set::interface1::Batch::getResultCollection
ResultCollectionPtr getResultCollection()
Definition: algorithm_quality_metric_set_batch.h:63
daal::services::ErrorEmptyInputAlgorithmsCollection
Definition: error_indexes.h:391
daal::algorithms::quality_metric_set::interface1::Batch::getErrors
services::SharedPtr< services::ErrorCollection > getErrors()
Definition: algorithm_quality_metric_set_batch.h:106