interval_classifier¶
- probly.transformation.interval_classifier(base: Predictor[In, Out], use_base_weights: bool = False) IntervalClassifierPredictor[In, Out][source]¶
Create an interval classifier from a base classifier based on [WCM+24].
Replaces every
Conv2d,BatchNorm2d,BatchNorm1d, andLinearin the base network with its interval counterpart, and replaces the lastLinearwith the credal headIntLinear -> IntBatchNorm1d -> IntSoftmax. Any trailing softmax in aProbabilisticClassifierbase is stripped.- Parameters:
base – Base predictor; must be a
ProbabilisticClassifierorLogitClassifier.use_base_weights – If True, copy each replaced layer’s weights, biases and (for BatchNorm) running statistics into the new layer’s
center_*slots. The radius parameters keep their fresh initialization. If False, every interval layer starts from scratch (matching how methods like dropout behave by default).
- Returns:
The transformed interval classifier predictor.
- Raises:
ValueError – If
basecontains nonn.Linearfor the credal head to replace.