incerto.shift.ClassifierShiftDetector#
- class incerto.shift.ClassifierShiftDetector(clf_factory=None, device=None)[source]#
Bases:
BaseShiftDetectorTrain a logistic regression to separate reference and test.
Lipton et al., 2018 (Black Box Shift Detection)
Methods
__init__([clf_factory, device])fit(reference_loader)Fit the detector on reference (source) distribution.
load(path)Load a detector from a file.
load_state_dict(state)Load classifier shift detector state.
save(path)Save detector state to a file.
score(test_loader)Compute shift score between reference and test distributions.
Save classifier shift detector state.