nessie.detectors.prediction_margin

Module Contents

Classes

PredictionMargin

Dmitriy Dligach and Martha Palmer. 2011. Reducing the need for double annotation.

class nessie.detectors.prediction_margin.PredictionMargin

Bases: nessie.detectors.error_detector.ModelBasedDetector

Dmitriy Dligach and Martha Palmer. 2011. Reducing the need for double annotation. In Proceedings of the 5th Linguistic Annotation Workshop (LAW V ‘11). Association for Computational Linguistics, USA, 65–73.

error_detector_kind(self)
score(self, probabilities: numpy.typing.NDArray[float], **kwargs) numpy.typing.NDArray[float]

The prediction margin for an instance is the absolute difference between the two largest probabilities predicted by a machine learning model. A smaller margin indicates a larger uncertainty.

Parameters

probabilities – a (num_instances, num_classes) numpy array obtained from a machine learning model

Returns

a (num_instances,) numpy array containing the resulting scores

Return type

scores

uses_probabilities(self) bool