{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from lifelines.datasets import load_rossi\n", "rossi = load_rossi()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
weekarrestfinageracewexpmarparoprio
020102710013
117101810018
2251019010113
352012311111
452001901013
\n", "
" ], "text/plain": [ " week arrest fin age race wexp mar paro prio\n", "0 20 1 0 27 1 0 0 1 3\n", "1 17 1 0 18 1 0 0 1 8\n", "2 25 1 0 19 0 1 0 1 13\n", "3 52 0 1 23 1 1 1 1 1\n", "4 52 0 0 19 0 1 0 1 3" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rossi.head()" ] }, { "cell_type": "code", "execution_count": 109, "metadata": {}, "outputs": [], "source": [ "# let's b-spline age\n", "from patsy import dmatrix\n", "from patsy import build_design_matrices \n", "\n", "\n", "design = dmatrix(\"fin + bs(age, df=4) + wexp + mar + paro + prio - 1\", data=rossi, return_type=\"matrix\")\n", "transformed_rossi = pd.DataFrame(design, columns=design.design_info.column_names)\n", "transformed_rossi['week'] = rossi['week']\n", "transformed_rossi['arrest'] = rossi['arrest']" ] }, { "cell_type": "code", "execution_count": 110, "metadata": {}, "outputs": [], "source": [ "cph = CoxPHFitter().fit(transformed_rossi, \"week\", \"arrest\")" ] }, { "cell_type": "code", "execution_count": 111, "metadata": {}, "outputs": [], "source": [ "# now we need to \"extend\" our data to plot it\n", "# we'll plot age over it's observed range\n", "age_range = np.linspace(rossi['age'].min(), rossi['age'].max(), 50)\n", "\n", "# need to create a matrix of variables at their means, _except_ for age. \n", "x_bar = rossi.drop([\"week\", \"arrest\"], axis=1).mean(0).to_frame().T\n", "new_data = pd.concat([x_bar] * 50).reset_index()\n", "new_data['age'] = age_range\n", "\n", "predict_on = build_design_matrices([design.design_info], new_data, return_type=\"dataframe\")[0]" ] }, { "cell_type": "code", "execution_count": 112, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 112, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl4VeW59/HvnYQkJIHMJAECCYIMyiQRRBxxQmtFj2ihWm2rpZ6WTh7b0vZt6+upfR3aattjrfNUFRFrpa1oqeKEogRllDnMEghzIJCQcL9/7A0nwUCA7GQl2b/Pde1r7/WsZ+11r3bLL2s9azB3R0RE5KCYoAsQEZGWRcEgIiJ1KBhERKQOBYOIiNShYBARkToUDCIiUoeCQURE6lAwiIhIHQoGERGpIy7oAk5EVlaWFxQUBF2GiEirMmfOnC3unt1Qv1YZDAUFBRQXFwddhohIq2Jma46lnw4liYhIHQoGERGpQ8EgIiJ1KBhERKQOBYOIiNShYBARkToUDCIiUkdUBcM/52/kL7OO6TReEZGoFVXB8OqCjfzmX0vZt78m6FJERFqsqAqGcUO7saNiP68vKg26FBGRFiuqguHMkzLplpHE8x+tDboUEZEWK6qCISbG+NLp+cwq2UZJ2e6gyxERaZGiKhgArinqSlyMMWn2uqBLERFpkaIuGDp1SOT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/A2YDHQjdGfaa9398AHqVs3MzgLeBRbwv8ecf0ponKHNbruZDSA02BhL6I+9ye5+h5n1IPSXdAbwCXC9u1cGV2nTCR9Kus3dL2/r2x3evpfDk3HAc+5+p5llEqHfeVQFg4iINCyaDiWJiMgxUDCIiEgdCgYREalDwSAiInUoGEREpA4Fg4iI1KFgEBGROhQMIiJSx/8HfId4TZcb1YUAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "cph.predict_log_partial_hazard(predict_on).plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "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.7.7" } }, "nbformat": 4, "nbformat_minor": 2 }