eVision Python API
Loading...
Searching...
No Matches
eVision.EasyDeepLearning.EClassificationMetrics Class Reference

Collection of metrics used to evaluate the state of an eVision.EasyDeepLearning.EClassifier. More...

Public Member Functions

None __init__ (self)
 Constructs an eVision.EasyDeepLearning.EClassificationMetrics object.
None __init__ (self, eVision.EasyDeepLearning.EClassificationMetrics other)
 Copy constructor of an eVision.EasyDeepLearning.EClassificationMetrics object.
None Load (self, str path)
 Loads a classification metric.
None Load (self, eVision.ESerializer|None serializer)
 Loads a classification metric.
None Save (self, str path)
 Saves a classification metric.
None Save (self, eVision.ESerializer|None serializer)
 Saves a classification metric.
bool IsValid (self)
 Indicates whether the object contains at least one classification result.
None AddResult (self, eVision.EasyDeepLearning.EClassificationResult result, str groundtruthLabel)
 Adds the given result with the corresponding ground truth label to the metrics.
None AddMetrics (self, eVision.EasyDeepLearning.EClassificationMetrics other)
 Adds the other metrics to the current metrics of this object.
float GetWeightedAccuracy (self, list[float] weights)
 The label weighted accuracy.
float GetWeightedAccuracy (self, eVision.EasyDeepLearning.EDataset dataset)
 The label weighted accuracy.
float GetLabelAccuracy (self, str label)
 The accuracy of the classifier for a given label.
float GetWeightedError (self, list[float] weights)
 The label weighted error.
float GetWeightedError (self, eVision.EasyDeepLearning.EDataset dataset)
 The label weighted error.
float GetLabelError (self, str label)
 The error of the classifier for a given label.
bool CanComputeWeightedError (self)
 Whether the object can be used to get weighted, balanced, and label errors.
int GetConfusion (self, str trueClass, str predictedClass)
 Confusion value of one label with another.
float Accuracy (self)
 The accuracy of the classifier.
float BalancedAccuracy (self)
 The balanced accuracy.
float Error (self)
 The error of the classifier.
float BalancedError (self)
 The balanced error.

Detailed Description

Collection of metrics used to evaluate the state of an eVision.EasyDeepLearning.EClassifier.

A metric is a value summarizing a collection of classification results (eVision.EasyDeepLearning.EClassificationResult). New results can be added to the object individually with eVision.EasyDeepLearning.EClassificationMetrics.AddResult or collectively with eVision.EasyDeepLearning.EClassificationMetrics.AddMetrics.

eVision.EasyDeepLearning.EClassificationMetrics contains the following metrics:

Remarks:

License(s): BasicTypes

Constructor & Destructor Documentation

◆ __init__() [1/2]

None eVision.EasyDeepLearning.EClassificationMetrics.__init__ ( self)

◆ __init__() [2/2]

None eVision.EasyDeepLearning.EClassificationMetrics.__init__ ( self,
eVision.EasyDeepLearning.EClassificationMetrics other )

Copy constructor of an eVision.EasyDeepLearning.EClassificationMetrics object.

Parameters
otherReference to the eVision.EasyDeepLearning.EClassificationMetrics object that should be copied

Member Function Documentation

◆ Accuracy()

float eVision.EasyDeepLearning.EClassificationMetrics.Accuracy ( self)

The accuracy of the classifier.

Remarks:

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.

◆ AddMetrics()

None eVision.EasyDeepLearning.EClassificationMetrics.AddMetrics ( self,
eVision.EasyDeepLearning.EClassificationMetrics other )

Adds the other metrics to the current metrics of this object.

Parameters
otherClassification metrics

◆ AddResult()

None eVision.EasyDeepLearning.EClassificationMetrics.AddResult ( self,
eVision.EasyDeepLearning.EClassificationResult result,
str groundtruthLabel )

Adds the given result with the corresponding ground truth label to the metrics.

Parameters
resultA reference to an eVision.EasyDeepLearning.EClassificationResult object.
groundtruthLabelThe ground truth label corresponding to the result

◆ BalancedAccuracy()

float eVision.EasyDeepLearning.EClassificationMetrics.BalancedAccuracy ( self)

The balanced accuracy.

Remarks:

The balanced accuracy is the label weighted accuracy with the same weight for each labels.

◆ BalancedError()

float eVision.EasyDeepLearning.EClassificationMetrics.BalancedError ( self)

The balanced error.

Remarks:

The balanced error is the label weighted error with the same weight for each labels.

If eVision.EasyDeepLearning.EClassificationMetrics.CanComputeWeightedError is false, this method is an alias for eVision.EasyDeepLearning.EClassificationMetrics.Error.

◆ CanComputeWeightedError()

bool eVision.EasyDeepLearning.EClassificationMetrics.CanComputeWeightedError ( self)

Whether the object can be used to get weighted, balanced, and label errors.

◆ Error()

float eVision.EasyDeepLearning.EClassificationMetrics.Error ( self)

The error of the classifier.

Remarks:

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.

◆ GetConfusion()

int eVision.EasyDeepLearning.EClassificationMetrics.GetConfusion ( self,
str trueClass,
str predictedClass )

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.

Parameters
trueClassThe label for which to obtain the confusion value
predictedClassThe label with which there is a confusion

◆ GetLabelAccuracy()

float eVision.EasyDeepLearning.EClassificationMetrics.GetLabelAccuracy ( self,
str label )

The accuracy of the classifier for a given label.

Remarks:

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.

Parameters
labelThe label of which we want the accuracy

◆ GetLabelError()

float eVision.EasyDeepLearning.EClassificationMetrics.GetLabelError ( self,
str label )

The error of the classifier for a given label.

Remarks:

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 eVision.EasyDeepLearning.EClassificationMetrics.CanComputeWeightedError is false, this method is an alias for eVision.EasyDeepLearning.EClassificationMetrics.Error.

Parameters
labelThe label from which to get the error.

◆ GetWeightedAccuracy() [1/2]

float eVision.EasyDeepLearning.EClassificationMetrics.GetWeightedAccuracy ( self,
eVision.EasyDeepLearning.EDataset dataset )

The label weighted accuracy.

Remarks:

The weighted accuracy is the weighted average of the label accuracies (see eVision.EasyDeepLearning.EClassificationMetrics.GetLabelAccuracy). If there is no results for a given label, it will be ignored in the weighted accuracy.

Parameters
datasetDataset from which to use the label weights

◆ GetWeightedAccuracy() [2/2]

float eVision.EasyDeepLearning.EClassificationMetrics.GetWeightedAccuracy ( self,
list[float] weights )

The label weighted accuracy.

Remarks:

The weighted accuracy is the weighted average of the label accuracies (see eVision.EasyDeepLearning.EClassificationMetrics.GetLabelAccuracy). If there is no results for a given label, it will be ignored in the weighted accuracy.

Parameters
weightsArray of label weights for the labels of the classifier (see eVision.EasyDeepLearning.EDeepLearningTool.GetLabel)

◆ GetWeightedError() [1/2]

float eVision.EasyDeepLearning.EClassificationMetrics.GetWeightedError ( self,
eVision.EasyDeepLearning.EDataset dataset )

The label weighted error.

Remarks:

The weighted error is the weighted average of the label errors (see eVision.EasyDeepLearning.EClassificationMetrics.GetLabelError).

If there isn't any result for a given label, it will be ignored in the weighted error.

If eVision.EasyDeepLearning.EClassificationMetrics.CanComputeWeightedError is false, this method is an alias for eVision.EasyDeepLearning.EClassificationMetrics.Error.

Parameters
datasetDataset from which to use the label weights

◆ GetWeightedError() [2/2]

float eVision.EasyDeepLearning.EClassificationMetrics.GetWeightedError ( self,
list[float] weights )

The label weighted error.

Remarks:

The weighted error is the weighted average of the label errors (see eVision.EasyDeepLearning.EClassificationMetrics.GetLabelError).

If there isn't any result for a given label, it will be ignored in the weighted error.

If eVision.EasyDeepLearning.EClassificationMetrics.CanComputeWeightedError is false, this method is an alias for eVision.EasyDeepLearning.EClassificationMetrics.Error.

Parameters
weightsArray of label weights for the labels of the classifier (see eVision.EasyDeepLearning.EDeepLearningTool.GetLabel)

◆ IsValid()

bool eVision.EasyDeepLearning.EClassificationMetrics.IsValid ( self)

Indicates whether the object contains at least one classification result.

◆ Load() [1/2]

None eVision.EasyDeepLearning.EClassificationMetrics.Load ( self,
eVision.ESerializer | None serializer )

Loads a classification metric.

The given eVision.ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ Load() [2/2]

None eVision.EasyDeepLearning.EClassificationMetrics.Load ( self,
str path )

Loads a classification metric.

The given eVision.ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Save() [1/2]

None eVision.EasyDeepLearning.EClassificationMetrics.Save ( self,
eVision.ESerializer | None serializer )

Saves a classification metric.

The given eVision.ESerializer must have been created for writing.

Parameters
serializerThe eVision.ESerializer object that is written to.

◆ Save() [2/2]

None eVision.EasyDeepLearning.EClassificationMetrics.Save ( self,
str path )

Saves a classification metric.

The given eVision.ESerializer must have been created for writing.

Parameters
pathThe file path.