Metadata-Version: 2.1
Name: calibrator
Version: 0.0.5
Summary: A package for calibration on deep learning models for classification tasks.
Author-email: Linwei Tao <dylan.tao94@gmail.com>
Project-URL: Homepage, https://github.com/pypa/sampleproject
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# Calibration
a package for calibrating the deep learning models

## Use case
```python
from calibrator import LocalCalibrator
import torch

val_logits = torch.randn(1000, 10)
val_labels = torch.randint(0, 10, (1000,))
test_logits = torch.randn(1000, 10)

calibrator = LocalCalibrator(aggregation='consistency', num_samples=1000, noise_type='gaussian')
eps_opt = calibrator.search_optimal_epsilon(val_logits, val_labels, verbose=True)
calibrated_probability = calibrator.calibrate(test_logits)
```
