Undoing a commit

This commit is contained in:
yagudin 2021-06-03 00:34:06 +03:00
parent d08f15621e
commit 0ceec7a819

View File

@ -1,5 +1,7 @@
import logging
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import sys
import streamlit as st import streamlit as st
import uncurl import uncurl
from calibration import overconfidence from calibration import overconfidence
@ -163,11 +165,24 @@ if __name__ == "__main__":
# --- # ---
for strategy in ['uniform', 'quantile']:
for n_bins in range(1, 300):
try:
fig = plotly_calibration(y_true, y_pred, n_bins=n_bins, strategy=strategy) fig = plotly_calibration(y_true, y_pred, n_bins=n_bins, strategy=strategy)
st.plotly_chart(fig, use_container_width=True) # st.plotly_chart(fig, use_container_width=True)
fig = plotly_calibration_odds(y_true, y_pred, n_bins=n_bins, strategy=strategy) fig = plotly_calibration_odds(y_true, y_pred, n_bins=n_bins, strategy=strategy)
st.plotly_chart(fig, use_container_width=True) # st.plotly_chart(fig, use_container_width=True)
except:
st.warning("Hey! Unfortunately, there occured a mysterious error, which I haven't been able to reproduce locally. Try refreshing the page or changing the number of bins a bit. <3")
np.set_printoptions(threshold=sys.maxsize)
logging.info("=" * 40)
logging.info(f"n_bins={n_bins}, strategy={strategy}")
logging.info(f"true={repr(y_true)}")
logging.info(f"y_pred={repr(y_pred)}")
logging.info("=" * 40)
# overconf = overconfidence(y_true, y_pred) # overconf = overconfidence(y_true, y_pred)
# st.write(f"Your over/under- confidence score is {overconf:.2f}.") # st.write(f"Your over/under- confidence score is {overconf:.2f}.")