Skip to content

Instantly share code, notes, and snippets.

View g-leech's full-sized avatar

Gavin Leech g-leech

View GitHub Profile
@g-leech
g-leech / spock.py
Last active April 10, 2022 18:40
Comparing Spock's predictions to a coin flip, yielding a Brier score of 0.57
import numpy as np
# impossible 0
# v unlik 10
# unlik 25
# lik 75
# vv likely 99.5
preds = [
[0, 1],
[0.75, 1],
# You can get your own copy of the MCMC trace: https://github.com/g-leech/masks_v_mandates#run
# but I've included the quantiles in this script for reproducibility.
import numpy as np
sns.set_style("whitegrid")
def exp_reduction(a, x):
reductions = 1 - np.exp((-1.0) * a * x)
return reductions.mean()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import gjp
# https://github.com/niplav/iqisa/blob/master/iqisa.py
import iqisa as iqs
import matplotlib.pyplot as plt
df=gjp.load_markets()
df["isCorrect"] = (df.outcome == df.answer_option).astype(float)
fig = plt.figure(figsize=(9, 9))
https://twitter.com/g_leech_/status/1728731355029393447?t=VN50RyPqwWFfcC63tMP_ng&s=19
https://twitter.com/g_leech_/status/1723630099507871780?t=YFYUi0eNkkLXOzzmbMtoGA&s=19
https://twitter.com/g_leech_/status/1623044128190697483
https://twitter.com/g_leech_/status/1639725932448456705
https://twitter.com/g_leech_/status/1630276985963556865
https://twitter.com/g_leech_/status/1622321776595189765
https://twitter.com/g_leech_/status/1668960035068694533
https://twitter.com/g_leech_/status/1715654603973312949
https://twitter.com/g_leech_/status/1713930232632135986
https://twitter.com/g_leech_/status/1711441986878644597