Collection of metrics used to evaluate the state of an EClassifier. More...
#include <eVision/EasyDeepLearning/EasyClassify/EClassificationMetrics.h>
Public Member Functions | |
| EClassificationMetrics () | |
| Constructs an EClassificationMetrics object. | |
| EClassificationMetrics (const eVision::EasyDeepLearning::EClassificationMetrics &other) | |
| Copy constructor of an EClassificationMetrics object. | |
| virtual | ~EClassificationMetrics () throw () |
| eVision::EasyDeepLearning::EClassificationMetrics & | operator= (const eVision::EasyDeepLearning::EClassificationMetrics &other) |
| Assignment operator. | |
| void | Load (const std::string &path) |
| Loads a classification metric. The given ESerializer must have been created for reading. | |
| void | Load (eVision::ESerializer *serializer) |
| Loads a classification metric. The given ESerializer must have been created for reading. | |
| void | Save (const std::string &path) |
| Saves a classification metric. The given ESerializer must have been created for writing. | |
| void | Save (eVision::ESerializer *serializer) |
| Saves a classification metric. The given ESerializer must have been created for writing. | |
| bool | IsValid () const |
| Indicates whether the object contains at least one classification result. | |
| void | AddResult (const eVision::EasyDeepLearning::EClassificationResult &result, const std::string &groundtruthLabel) |
| Adds the given result with the corresponding ground truth label to the metrics. | |
| void | AddMetrics (const eVision::EasyDeepLearning::EClassificationMetrics &other) |
| Adds the other metrics to the current metrics of this object. | |
| float | GetAccuracy () const |
| The accuracy of the classifier. | |
| float | GetWeightedAccuracy (const std::vector< float > &weights) const |
| The label weighted accuracy. | |
| float | GetWeightedAccuracy (const eVision::EasyDeepLearning::EDataset &dataset) const |
| The label weighted accuracy. | |
| float | GetBalancedAccuracy () const |
| The balanced accuracy. | |
| float | GetLabelAccuracy (const std::string &label) const |
| The accuracy of the classifier for a given label. | |
| float | GetError () const |
| The error of the classifier. | |
| float | GetWeightedError (const std::vector< float > &weights) const |
| The label weighted error. | |
| float | GetWeightedError (const eVision::EasyDeepLearning::EDataset &dataset) const |
| The label weighted error. | |
| float | GetBalancedError () const |
| The balanced error. | |
| float | GetLabelError (const std::string &label) const |
| The error of the classifier for a given label. | |
| bool | CanComputeWeightedError () const |
| Whether the object can be used to get weighted, balanced, and label errors. | |
| uint32_t | GetConfusion (const std::string &trueClass, const std::string &predictedClass) const |
| Confusion value of one label with another. | |
| EClassificationMetrics (CppWrapperInternal::InternalConstructor) | |
Public Attributes | |
| CppWrapperInternal::WrappedClass | wrappedClass_ |
Collection of metrics used to evaluate the state of an EClassifier.
A metric is a value summarizing a collection of classification results (EClassificationResult). New results can be added to the object individually with EClassificationMetrics::AddResult or collectively with EClassificationMetrics::AddMetrics.
EClassificationMetrics contains the following metrics:
License(s): BasicTypes
| eVision::EasyDeepLearning::EClassificationMetrics::EClassificationMetrics | ( | ) |
Constructs an EClassificationMetrics object.
| eVision::EasyDeepLearning::EClassificationMetrics::EClassificationMetrics | ( | const eVision::EasyDeepLearning::EClassificationMetrics & | other | ) |
Copy constructor of an EClassificationMetrics object.
| other | Reference to the EClassificationMetrics object that should be copied |
|
virtual | ||||||||||||
| eVision::EasyDeepLearning::EClassificationMetrics::EClassificationMetrics | ( | CppWrapperInternal::InternalConstructor | ) |
| void eVision::EasyDeepLearning::EClassificationMetrics::AddMetrics | ( | const eVision::EasyDeepLearning::EClassificationMetrics & | other | ) |
Adds the other metrics to the current metrics of this object.
| other | Classification metrics |
| void eVision::EasyDeepLearning::EClassificationMetrics::AddResult | ( | const eVision::EasyDeepLearning::EClassificationResult & | result, |
| const std::string & | groundtruthLabel ) |
Adds the given result with the corresponding ground truth label to the metrics.
| result | A reference to an EClassificationResult object. |
| groundtruthLabel | The ground truth label corresponding to the result |
| bool eVision::EasyDeepLearning::EClassificationMetrics::CanComputeWeightedError | ( | ) | const |
Whether the object can be used to get weighted, balanced, and label errors.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetAccuracy | ( | ) | const |
The accuracy of the classifier.
The accuracy is the number of images that were correctly classified (also called the true positives) over the total number of images that was used to evaluate the classifier.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetBalancedAccuracy | ( | ) | const |
The balanced accuracy.
The balanced accuracy is the label weighted accuracy with the same weight for each labels.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetBalancedError | ( | ) | const |
The balanced error.
The balanced error is the label weighted error with the same weight for each labels.
If EClassificationMetrics::CanComputeWeightedError is false, this method is an alias for EClassificationMetrics::GetError.
| uint32_t eVision::EasyDeepLearning::EClassificationMetrics::GetConfusion | ( | const std::string & | trueClass, |
| const std::string & | predictedClass ) const |
Confusion value of one label with another.
The confusion value of a label with another is the number of images belonging to this label that are classified as belonging to the other label.
| trueClass | The label for which to obtain the confusion value |
| predictedClass | The label with which there is a confusion |
| float eVision::EasyDeepLearning::EClassificationMetrics::GetError | ( | ) | const |
The error of the classifier.
The error, which is also called the loss, is the quantity that is minimized during the training of the deep neural network. For classification, the error is the cross-entropy.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetLabelAccuracy | ( | const std::string & | label | ) | const |
The accuracy of the classifier for a given label.
| label | The label of which we want the accuracy |
The label accuracy is the number of images of a given label that were correctly classified (also called the true positives) over the total number of images of that label that was used to evaluate the classifier.
If there is no results for the given label, the method will throw an exception.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetLabelError | ( | const std::string & | label | ) | const |
The error of the classifier for a given label.
| label | The label from which to get the error. |
The label error corresponds to the error only for images of the given label.
If there is no results for the given label, the method will throw an exception. If EClassificationMetrics::CanComputeWeightedError is false, this method is an alias for EClassificationMetrics::GetError.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetWeightedAccuracy | ( | const eVision::EasyDeepLearning::EDataset & | dataset | ) | const |
The label weighted accuracy.
| dataset | Dataset from which to use the label weights |
The weighted accuracy is the weighted average of the label accuracies (see EClassificationMetrics::GetLabelAccuracy). If there is no results for a given label, it will be ignored in the weighted accuracy.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetWeightedAccuracy | ( | const std::vector< float > & | weights | ) | const |
The label weighted accuracy.
| weights | Array of label weights for the labels of the classifier (see EDeepLearningTool::GetLabel) |
The weighted accuracy is the weighted average of the label accuracies (see EClassificationMetrics::GetLabelAccuracy). If there is no results for a given label, it will be ignored in the weighted accuracy.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetWeightedError | ( | const eVision::EasyDeepLearning::EDataset & | dataset | ) | const |
The label weighted error.
| dataset | Dataset from which to use the label weights |
The weighted error is the weighted average of the label errors (see EClassificationMetrics::GetLabelError).
If there isn't any result for a given label, it will be ignored in the weighted error.
If EClassificationMetrics::CanComputeWeightedError is false, this method is an alias for EClassificationMetrics::GetError.
| float eVision::EasyDeepLearning::EClassificationMetrics::GetWeightedError | ( | const std::vector< float > & | weights | ) | const |
The label weighted error.
| weights | Array of label weights for the labels of the classifier (see EDeepLearningTool::GetLabel) |
The weighted error is the weighted average of the label errors (see EClassificationMetrics::GetLabelError).
If there isn't any result for a given label, it will be ignored in the weighted error.
If EClassificationMetrics::CanComputeWeightedError is false, this method is an alias for EClassificationMetrics::GetError.
| bool eVision::EasyDeepLearning::EClassificationMetrics::IsValid | ( | ) | const |
Indicates whether the object contains at least one classification result.
| void eVision::EasyDeepLearning::EClassificationMetrics::Load | ( | const std::string & | path | ) |
Loads a classification metric. The given ESerializer must have been created for reading.
| path | The file path. |
| void eVision::EasyDeepLearning::EClassificationMetrics::Load | ( | eVision::ESerializer * | serializer | ) |
Loads a classification metric. The given ESerializer must have been created for reading.
| serializer | The serializer. |
| eVision::EasyDeepLearning::EClassificationMetrics & eVision::EasyDeepLearning::EClassificationMetrics::operator= | ( | const eVision::EasyDeepLearning::EClassificationMetrics & | other | ) |
Assignment operator.
| other | Reference to the EClassificationMetrics object used for the assignment |
| void eVision::EasyDeepLearning::EClassificationMetrics::Save | ( | const std::string & | path | ) |
Saves a classification metric. The given ESerializer must have been created for writing.
| path | The file path. |
| void eVision::EasyDeepLearning::EClassificationMetrics::Save | ( | eVision::ESerializer * | serializer | ) |
Saves a classification metric. The given ESerializer must have been created for writing.
| serializer | The ESerializer object that is written to. |
| CppWrapperInternal::WrappedClass eVision::EasyDeepLearning::EClassificationMetrics::wrappedClass_ |