Skip to content

Commit

Permalink
prob to logodds
Browse files Browse the repository at this point in the history
  • Loading branch information
tompollard committed Feb 8, 2018
1 parent 358eea5 commit 617cf49
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions challenge-demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
{
"cell_type": "code",
"execution_count": 704,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Data processing libraries\n",
"import pandas as pd\n",
"import numpy as np\n",
"from datetime import datetime\n",
"import itertools\n",
"\n",
"# Database libraries\n",
"import psycopg2\n",
Expand Down Expand Up @@ -2264,10 +2264,10 @@
},
"outputs": [],
"source": [
"def prob2logit(prob):\n",
"def prob2logodds(prob):\n",
" odds = prob / (1 - prob)\n",
" logit = np.log(odds)\n",
" return logit"
" logodds = np.log(odds)\n",
" return logodds"
]
},
{
Expand Down Expand Up @@ -2364,7 +2364,7 @@
],
"source": [
"weekend_grid['predict'] = adj_glm_int.predict(weekend_grid[['inday_icu_wkd','admission_type']])\n",
"weekend_grid['log_odds'] = prob2logit(weekend_grid['predict'])\n",
"weekend_grid['log_odds'] = prob2logodds(weekend_grid['predict'])\n",
"weekend_grid.set_index(['inday_icu_wkd','admission_type'])"
]
},
Expand Down

0 comments on commit 617cf49

Please sign in to comment.