Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mon Sep 11 09:26:37 PDT 2017\r\n"
]
}
],
"source": [
"import numpy as np, pandas as pd, matplotlib.pyplot as plt, seaborn as sns\n",
"%matplotlib inline\n",
"!date"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SmartVA user asked about CSMF uncertainty\n",
"\n",
"This is something I've always thought worth doing, but never got around to: bootstrap resample the predictions to get a UI around the CSMF:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import glob"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"results = []\n",
"\n",
"for module in ['adult', 'child', 'neonate']:\n",
" for fname in glob.glob(f'/homes/abie/projects/2017/smartva_testing/'\\\n",
" f'*/{module}-predictions.csv'):\n",
" df = pd.read_csv(fname)\n",
" results.append({'fname':fname,\n",
" 'module': module,\n",
" 'n': len(df),\n",
" 'undet': df.cause.isnull().sum()})\n",
"results = pd.DataFrame(results)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"fname\n",
"/homes/abie/projects/2017/smartva_testing/phmrc_database_neonate/neonate-predictions.csv 2621\n",
"/homes/abie/projects/2017/smartva_testing/150817_neontae_only/neonate-predictions.csv 2823\n",
"/homes/abie/projects/2017/smartva_testing/150817_VA_Data_for_India/neonate-predictions.csv 2851\n",
"/homes/abie/projects/2017/smartva_testing/150817_VA_Data_for_India/adult-predictions.csv 6502\n",
"/homes/abie/projects/2017/smartva_testing/phmrc_database_adult/adult-predictions.csv 7839\n",
"Name: n, dtype: int64"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"results.groupby(['fname']).n.first().sort_values().tail()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"df = pd.read_csv('/homes/abie/projects/2017/smartva_testing/phmrc_database_adult/adult-predictions.csv')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>sid</th>\n",
" <th>cause</th>\n",
" <th>cause34</th>\n",
" <th>age</th>\n",
" <th>sex</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Adult1</td>\n",
" <td>6.0</td>\n",
" <td>Cirrhosis</td>\n",
" <td>51.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Adult2</td>\n",
" <td>22.0</td>\n",
" <td>Other Cardiovascular Diseases</td>\n",
" <td>24.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Adult3</td>\n",
" <td>9.0</td>\n",
" <td>Diabetes</td>\n",
" <td>62.0</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Adult4</td>\n",
" <td>25.0</td>\n",
" <td>Other Non-communicable Diseases</td>\n",
" <td>80.0</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Adult5</td>\n",
" <td>36.0</td>\n",
" <td>Ischemic Heart Disease</td>\n",
" <td>76.0</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" sid cause cause34 age sex\n",
"0 Adult1 6.0 Cirrhosis 51.0 1\n",
"1 Adult2 22.0 Other Cardiovascular Diseases 24.0 1\n",
"2 Adult3 9.0 Diabetes 62.0 2\n",
"3 Adult4 25.0 Other Non-communicable Diseases 80.0 2\n",
"4 Adult5 36.0 Ischemic Heart Disease 76.0 1"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0 Maternal\n",
"1 Stroke\n",
"2 Stroke\n",
"3 Maternal\n",
"4 Undetermined\n",
"Name: cause34, dtype: object"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def bootstrap_resample(s):\n",
" \"\"\" Resample pd.Series s *with* replacement\n",
" \"\"\"\n",
" \n",
" vals = np.random.choice(s.values, size=len(s), replace=True)\n",
" return pd.Series(vals, index=s.index, name=s.name)\n",
"\n",
"bootstrap_resample(df.cause34).head()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Maternal 0.050644\n",
"AIDS 0.054599\n",
"Undetermined 0.055237\n",
"Diabetes 0.057788\n",
"Stroke 0.072458\n",
"Name: cause34, dtype: float64"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def csmf(s):\n",
" \"\"\" Find CSMF for pd.Series of cause-of-deaths\n",
" *without* redistribution\n",
" \"\"\"\n",
" return s.value_counts(normalize=True)\n",
"csmf(df.cause34).sort_values().tail()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>lb</th>\n",
" <th>ub</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Maternal</th>\n",
" <td>0.041873</td>\n",
" <td>0.044998</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AIDS</th>\n",
" <td>0.047136</td>\n",
" <td>0.048953</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Undetermined</th>\n",
" <td>0.047391</td>\n",
" <td>0.049241</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Diabetes</th>\n",
" <td>0.049273</td>\n",
" <td>0.051537</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Stroke</th>\n",
" <td>0.062348</td>\n",
" <td>0.065536</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" lb ub\n",
"Maternal 0.041873 0.044998\n",
"AIDS 0.047136 0.048953\n",
"Undetermined 0.047391 0.049241\n",
"Diabetes 0.049273 0.051537\n",
"Stroke 0.062348 0.065536"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def csmf_ui(s):\n",
" \"\"\" Use `n_reps` bootstrap resamples to find the 95% UI\n",
" for CSMF values from cause-of-death pd.Series\"\"\"\n",
" n_reps = 1000\n",
" \n",
" df = pd.DataFrame(0, columns=range(n_reps), index=s.unique())\n",
" for rep in range(n_reps):\n",
" df[rep] = csmf(bootstrap_resample(s))\n",
" \n",
" df = df.fillna(0)\n",
" lb = np.percentile(df, .025, axis=1)\n",
" ub = np.percentile(df, .975, axis=1)\n",
" return pd.DataFrame({'lb': lb, 'ub':ub}, index=df.index)\n",
"\n",
"csmf_ui(df.cause34).sort_values('ub').tail()"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"df = pd.read_csv('/homes/abie/projects/2017/smartva_testing/phmrc_database_neonate/neonate-predictions.csv')"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>lb</th>\n",
" <th>ub</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Undetermined</th>\n",
" <td>0.081744</td>\n",
" <td>0.084319</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Meningitis/Sepsis</th>\n",
" <td>0.089755</td>\n",
" <td>0.093857</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Birth asphyxia</th>\n",
" <td>0.090423</td>\n",
" <td>0.094140</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Preterm Delivery</th>\n",
" <td>0.129530</td>\n",
" <td>0.138779</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Stillbirth</th>\n",
" <td>0.359308</td>\n",
" <td>0.371797</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" lb ub\n",
"Undetermined 0.081744 0.084319\n",
"Meningitis/Sepsis 0.089755 0.093857\n",
"Birth asphyxia 0.090423 0.094140\n",
"Preterm Delivery 0.129530 0.138779\n",
"Stillbirth 0.359308 0.371797"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"csmf_ui(df.cause34).sort_values('ub').tail()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>lb</th>\n",
" <th>ub</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Meningitis/Sepsis</th>\n",
" <td>0.067999</td>\n",
" <td>0.076</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Birth asphyxia</th>\n",
" <td>0.074250</td>\n",
" <td>0.082</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Undetermined</th>\n",
" <td>0.073249</td>\n",
" <td>0.083</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Preterm Delivery</th>\n",
" <td>0.126000</td>\n",
" <td>0.131</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Stillbirth</th>\n",
" <td>0.355250</td>\n",
" <td>0.367</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" lb ub\n",
"Meningitis/Sepsis 0.067999 0.076\n",
"Birth asphyxia 0.074250 0.082\n",
"Undetermined 0.073249 0.083\n",
"Preterm Delivery 0.126000 0.131\n",
"Stillbirth 0.355250 0.367"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"csmf_ui(df.cause34.iloc[:1000]).sort_values('ub').tail()"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>lb</th>\n",
" <th>ub</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Undetermined</th>\n",
" <td>0.022498</td>\n",
" <td>0.04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Birth asphyxia</th>\n",
" <td>0.022498</td>\n",
" <td>0.04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Meningitis/Sepsis</th>\n",
" <td>0.030000</td>\n",
" <td>0.05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Preterm Delivery</th>\n",
" <td>0.040000</td>\n",
" <td>0.06</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Stillbirth</th>\n",
" <td>0.270000</td>\n",
" <td>0.32</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" lb ub\n",
"Undetermined 0.022498 0.04\n",
"Birth asphyxia 0.022498 0.04\n",
"Meningitis/Sepsis 0.030000 0.05\n",
"Preterm Delivery 0.040000 0.06\n",
"Stillbirth 0.270000 0.32"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"csmf_ui(df.cause34.iloc[:100]).sort_values('ub').tail()"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [],
"source": [
"def csmf_hbar_w_error(df):\n",
" t = csmf_ui(df.cause34)\n",
" t['csmf'] = csmf(df.cause34)\n",
" \n",
" t *= 100\n",
" t = t.sort_values('csmf')\n",
" \n",
" t.csmf.plot(kind='barh', xerr=[(t.csmf-t.lb), (t.ub-t.csmf)])\n",
" return t\n"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeYAAAD8CAYAAACiqQeGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYXHWB7vHvS4AQCCbjJCNNQNslyshiIBFlNTjIVWRE\nBxwU0ABzzTDjIOjlalyugmsUnxFBHScquBAwGhcYQJAlDQjEkEDIAkQEwkAA2YZAWIIk7/2jfg1F\n20t1p7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G3MYwmZ/t\nT9rewXYrtf+vXWn7aIbJ/CRtI2nb9m3gIGAFw2R+th8A7pH0urLr74Bb6OX88gUj0SNJB1O77jUK\nOMv2l5o8pE0i6TxgOrVftfkT8Dng18DPgJcDdwP/aLvjDWKVJ2lf4BpgOS9co/wUtevMw2F+u1G7\neWYUtYUhxtz4AAAAd0lEQVTFz2x/XtJfMwzmV0/SdOBk24cMl/lJehW1VTLUTvuea/tLw2V+AJKm\nULtxb0vgTuBYyv9WaXB+CeaIiIgKyansiIiICkkwR0REVEiCOSIiokISzBERERWSYI6IiKiQBHNE\nRESFJJgjIiIqJMEcERFRIf8flMFO5OQ2Q/gAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7ff22a988f60>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"csmf_hbar_w_error(df.iloc[:1000])\n",
"plt.axis(xmax=60);"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeYAAAD8CAYAAACiqQeGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcXFWB9vHfQ4AQCCbjJCNNQNslyshiIBFlNSjyKjKi\nAw4KaIB5zTDjIOjwalxeBdcofkYE16jgQsBoXGAAQZY0IBBDB0IWICIQBgIIhCEQliDJM3/UaSja\n3re63Xm+n08+devcc849p1p56tx7q0q2iYiIiGrYrNEDiIiIiOclmCMiIiokwRwREVEhCeaIiIgK\nSTBHRERUSII5IiKiQhLMERERFZJgjoiIqJAEc0RERIVs3ugBxPAwYcIENzc3N3oYERHDyuLFix+2\nPbE3bRLM0SPNzc20trY2ehgREcOKpLt72yansiMiIiokwRwREVEhCeaIiIgKSTBHRERUSII5IiKi\nQhLMERERFZKPS0WPLFu9luZZFzV6GBHRB6tmv6PRQ4heyIo5IiKiQhLMERERFZJgjoiIqJAE8xCS\n9ClJKy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P0CmqrZKid9j3X9hdHyvwAJE2hduPelsCdwLGU/63Sw/klmCMiIiokp7IjIiIqJMEcERFR\nIQnmiIiICkkwR0REVEiCOSIiokISzBERERWSYI6IiKiQBHNERESF/C89HlGSlTr9eQAAAABJRU5E\nrkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x7ff22a940c88>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"csmf_hbar_w_error(df.iloc[:100])\n",
"plt.axis(xmax=60);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"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.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.