Reference

Task & Metric Classes

Core classes for defining selective inference tasks and metrics

SelectiveInferenceTask

Wrap a trained LightningModule to attach selection results during inference.

SelectiveMetric

Evaluate a metric on full, selected, and rejected subsets.

RiskCoverageMetric

Build a risk-coverage curve from scores and per-sample errors.

RiskCoverage

Container for risk-coverage results.

Embedding based Uncertainty Scores

Uncertainty scoring methods for embedding-based approaches

scores.CosineScore

Returns the KNN-distance based on the cosine distance to the nearest samples.

scores.EuclideanScore

Returns the KNN-distance based on the Euclidean distance to the nearest samples.

scores.MahalanobisScore

Returns the Mahalanobis distance to the training samples distribution.

scores.PCAScore

Returns uncertainty scores based on PCA reconstruction errors.

scores.PyODScore

Uncertainty scores based on detectors supplied by PyOD.

scores.utils.TensorPCA

Tensor-based PCA.

Logit based Uncertainty Scores

Uncertainty scoring methods based on model logits

scores.EnergyScore

Energy-based uncertainty score.

scores.EntropyScore

Entropy-based uncertainty score.

scores.MarginScore

Top-two margin uncertainty score.

scores.SoftmaxScore

Maximum softmax probability uncertainty score.

Other Uncertainty Scores

Uncertainty scoring methods based on other principles

scores.RandomScore

Returns random uncertainty scores per sample.

Abstract Classes

Abstract base classes

scores.UncertaintyScore

Abstract Base Class for Uncertainty Scores.

scores.EmbeddingScore

Base class for embedding-based uncertainty scores.

scores.KNNScore

Abstract base class for KNN distance-based uncertainty scores.

scores.LogitScore

Base class for logit-based uncertainty scores.

Utilities

Helpers for progress and logging

utils.track()

Wrap an iterable with a progress bar.

utils.enable()

Globally enable progress reporting.

utils.disable()

Globally disable progress reporting.

utils.set_backend()

Select the progress-bar backend.

utils.get_backend()

Return the name of the currently selected backend.

utils.get_logger()

Return a logger scoped to the seapig package.

utils.configure_logging()

Configure the seapig package logger.