Skip to content

Instantly share code, notes, and snippets.

@piyush01123
Created November 12, 2019 14:14
Show Gist options
  • Save piyush01123/0263c4b286c0b990fcf4b3cfeb65d836 to your computer and use it in GitHub Desktop.
Save piyush01123/0263c4b286c0b990fcf4b3cfeb65d836 to your computer and use it in GitHub Desktop.
Ensemble Error Limit
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from scipy.stats import binom\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def ensemble_error(N, eps):\n",
" # for N=11, we will misclassify if at least 6 go wrong (11//2+1)\n",
" # similarly for 12, at least 7 must go wrong\n",
" errors = [binom.pmf(i, N, eps) for i in range(N//2+1, N+1)]\n",
" return sum(errors)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dd3hU1dbA4d8i9CoKKlIFQSn2WLgWUJBiQ2yAFUURAftVQRERGzZABYQgiFhA8KoXr3jVi/IpKAqIoqJAKNIhIFVqkv39sU5kiCkTMjNn5sx6n+c8mZlzMrNOJlmzs8/ea4tzDmOMMYmvhN8BGGOMiQxL6MYYExCW0I0xJiAsoRtjTEBYQjfGmICwhG6MMQFhCT1JiEhLEVlVwP5xIvJELGMykSUiTkSOCeO4An8XTOKyhB4hIrJcRHaJyI6QbZjfccWKqKUissDvWOKdiEz3ku+JuR5/33u8pU+hhcZi72cCsoQeWZc45yqGbL39DiiGzgUOB+qLyGmxfGERKRnL14uQRcANOXdE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Fl+jiq4uwDjn3Asi0hxdBa2Zcy7b78ASRTy30JNxcepwzhkRaQ08DFzqnNsTo9iipbBzrgQ0A6aLyHK0r3FKgl8YDed9XgVMcc7tc84tAxahCT5RhXPO3YBJAM65b4CyaBGroArr770o4jmhJ+Pi1IWes4icDIxCk3mi96tCIefsnNvqnKvmnKvnnKuHXje41Dk3x59wIyKc3+0P0NY5IlIN7YJZGssgIyycc14BtAIQkcZoQs+IaZSxNQW4wRvtciaw1Tm3tljP6PeV4EKuEl+ItkyWAA97jw1E/6BB3/DJQDrwHVDf75hjcM7/A9YDP3jbFL9jjvY55zp2Ogk+yiXM91nQrqYFwE9AZ79jjsE5NwFmoiNgfgDa+B1zMc93ArAW2If+x9UN6AH0CHmPh3s/j58i8XttU/+NMSYg4rnLxRhjTBFYQjfGmICwhG6MMQFhCd0YYwLCEroxxgSEJXRjjAkIS+jGGBMQ/w8+sdjtkw7ENgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"N = 11\n",
"\n",
"model_accuracies = np.arange(0,1,.01)\n",
"ensemble_accuracies = [1-ensemble_error(N, 1-acc) for acc in model_accuracies]\n",
"\n",
"plt.plot(model_accuracies, ensemble_accuracies, 'b')\n",
"plt.title(\"Ensemble Accuracy vs Model Accuracy\")\n",
"plt.plot([0, 1], [0, 1],'r--')\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment