probly.conformal_prediction.scores.raps.common¶
Common functions for RAPS (Regularized Adaptive Prediction Sets) nonconformity scores.
Functions
|
Register implementation for specific type. |
Classes
|
Regularized Adaptive Prediction Sets (RAPS) nonconformity score. |
- class probly.conformal_prediction.scores.raps.common.RAPSScore(model, lambda_reg=0.1, k_reg=0, epsilon=0.01, randomize=True, random_state=None)[source]¶
Bases:
ClassificationScoreRegularized Adaptive Prediction Sets (RAPS) nonconformity score.
- Parameters:
- calibration_nonconformity(x_cal, y_cal, probs=None)¶
Compute calibration scores (vectorized, backend-agnostic).
- Parameters:
x_cal (Sequence[Any])
y_cal (Sequence[Any])
probs (Any | None)
- Return type:
npt.NDArray[np.floating]
- predict_nonconformity(x_test, probs=None)¶
Compute scores for all labels (stays on original device).
- Parameters:
x_test (Sequence[Any])
probs (Any | None)
- Return type:
Any