EFS-OpenSource / calibration-framework

The net:cal calibration framework is a Python 3 library for measuring and mitigating miscalibration of uncertainty estimates, e.g., by a neural network.
https://efs-opensource.github.io/calibration-framework/
Apache License 2.0
344 stars 42 forks source link

ReliabilityDiagram.plot() makes duplicate copy of figure #45

Closed jmsdao closed 1 year ago

jmsdao commented 1 year ago

Code to recreate (I ran it in Google Colab):

!pip install netcal
import numpy as np
from netcal.presentation import ReliabilityDiagram

conf = np.random.rand(1000)
ground = np.random.randint(0, 2, 1000)

diag = ReliabilityDiagram(20)
diag.plot(conf, ground)

Results of !pip show netcal:

Name: netcal
Version: 1.3.5
Summary: The net:cal calibration framework is a Python 3 library for measuring and mitigating miscalibration of uncertainty estimates, e.g., by a neural network.
Home-page: 
Author: Fabian Küppers
Author-email: [fabian.kueppers@efs-techhub.com](mailto:fabian.kueppers@efs-techhub.com)
License: Apache-2.0
Location: /usr/local/lib/python3.9/dist-packages
Requires: gpytorch, matplotlib, numpy, pyro-ppl, scikit-learn, scipy, tensorboard, tikzplotlib, torch, torchvision, tqdm
Required-by:
jmsdao commented 1 year ago

Also wanted to say, this is a great library!

jmsdao commented 1 year ago

Sorry, I am silly. Adding a semicolon on the line with .plot() fixes this.