diff --git a/Ch11-surv-lab.ipynb b/Ch11-surv-lab.ipynb index a8a6182..efbc233 100644 --- a/Ch11-surv-lab.ipynb +++ b/Ch11-surv-lab.ipynb @@ -5,7 +5,9 @@ "id": "c7f4eb5a", "metadata": {}, "source": [ - "# Chapter 11" + "\n", + "# Chapter 11\n", + "\n" ] }, { @@ -32,10 +34,10 @@ "id": "91ac40fd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:36.910686Z", - "iopub.status.busy": "2023-07-31T02:15:36.910197Z", - "iopub.status.idle": "2023-07-31T02:15:38.043363Z", - "shell.execute_reply": "2023-07-31T02:15:38.043019Z" + "iopub.execute_input": "2023-08-06T17:35:46.303006Z", + "iopub.status.busy": "2023-08-06T17:35:46.302426Z", + "iopub.status.idle": "2023-08-06T17:35:47.388674Z", + "shell.execute_reply": "2023-08-06T17:35:47.388193Z" } }, "outputs": [], @@ -44,7 +46,7 @@ "import numpy as np\n", "import pandas as pd\n", "from ISLP.models import ModelSpec as MS\n", - "from ISLP import load_data" + "from ISLP import load_data\n" ] }, { @@ -62,10 +64,10 @@ "id": "99782418", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.045310Z", - "iopub.status.busy": "2023-07-31T02:15:38.045152Z", - "iopub.status.idle": "2023-07-31T02:15:38.137179Z", - "shell.execute_reply": "2023-07-31T02:15:38.136883Z" + "iopub.execute_input": "2023-08-06T17:35:47.390741Z", + "iopub.status.busy": "2023-08-06T17:35:47.390555Z", + "iopub.status.idle": "2023-08-06T17:35:47.484777Z", + "shell.execute_reply": "2023-08-06T17:35:47.484422Z" } }, "outputs": [], @@ -76,7 +78,7 @@ "from lifelines.statistics import \\\n", " (logrank_test,\n", " multivariate_logrank_test)\n", - "from ISLP.survival import sim_time" + "from ISLP.survival import sim_time\n" ] }, { @@ -95,10 +97,10 @@ "id": "3137149a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.138950Z", - "iopub.status.busy": "2023-07-31T02:15:38.138844Z", - "iopub.status.idle": "2023-07-31T02:15:38.145075Z", - "shell.execute_reply": "2023-07-31T02:15:38.144817Z" + "iopub.execute_input": "2023-08-06T17:35:47.486501Z", + "iopub.status.busy": "2023-08-06T17:35:47.486385Z", + "iopub.status.idle": "2023-08-06T17:35:47.493362Z", + "shell.execute_reply": "2023-08-06T17:35:47.493058Z" } }, "outputs": [ @@ -115,7 +117,7 @@ ], "source": [ "BrainCancer = load_data('BrainCancer')\n", - "BrainCancer.columns" + "BrainCancer.columns\n" ] }, { @@ -133,11 +135,12 @@ "id": "45963c92", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.146568Z", - "iopub.status.busy": "2023-07-31T02:15:38.146458Z", - "iopub.status.idle": "2023-07-31T02:15:38.149482Z", - "shell.execute_reply": "2023-07-31T02:15:38.149235Z" - } + "iopub.execute_input": "2023-08-06T17:35:47.494963Z", + "iopub.status.busy": "2023-08-06T17:35:47.494863Z", + "iopub.status.idle": "2023-08-06T17:35:47.497996Z", + "shell.execute_reply": "2023-08-06T17:35:47.497741Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -154,7 +157,7 @@ } ], "source": [ - "BrainCancer['sex'].value_counts()" + "BrainCancer['sex'].value_counts()\n" ] }, { @@ -163,11 +166,12 @@ "id": "73be61f6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.151583Z", - "iopub.status.busy": "2023-07-31T02:15:38.151488Z", - "iopub.status.idle": "2023-07-31T02:15:38.153999Z", - "shell.execute_reply": "2023-07-31T02:15:38.153712Z" - } + "iopub.execute_input": "2023-08-06T17:35:47.499414Z", + "iopub.status.busy": "2023-08-06T17:35:47.499312Z", + "iopub.status.idle": "2023-08-06T17:35:47.502029Z", + "shell.execute_reply": "2023-08-06T17:35:47.501779Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -186,7 +190,7 @@ } ], "source": [ - "BrainCancer['diagnosis'].value_counts()" + "BrainCancer['diagnosis'].value_counts()\n" ] }, { @@ -195,11 +199,12 @@ "id": "572f0b9e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.155561Z", - "iopub.status.busy": "2023-07-31T02:15:38.155460Z", - "iopub.status.idle": "2023-07-31T02:15:38.158411Z", - "shell.execute_reply": "2023-07-31T02:15:38.158146Z" - } + "iopub.execute_input": "2023-08-06T17:35:47.503331Z", + "iopub.status.busy": "2023-08-06T17:35:47.503251Z", + "iopub.status.idle": "2023-08-06T17:35:47.506059Z", + "shell.execute_reply": "2023-08-06T17:35:47.505826Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -216,7 +221,7 @@ } ], "source": [ - "BrainCancer['status'].value_counts()" + "BrainCancer['status'].value_counts()\n" ] }, { @@ -250,10 +255,10 @@ "id": "92c39707", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.159867Z", - "iopub.status.busy": "2023-07-31T02:15:38.159768Z", - "iopub.status.idle": "2023-07-31T02:15:38.465840Z", - "shell.execute_reply": "2023-07-31T02:15:38.465244Z" + "iopub.execute_input": "2023-08-06T17:35:47.507415Z", + "iopub.status.busy": "2023-08-06T17:35:47.507329Z", + "iopub.status.idle": "2023-08-06T17:35:47.692016Z", + "shell.execute_reply": "2023-08-06T17:35:47.690384Z" } }, "outputs": [ @@ -282,7 +287,7 @@ "fig, ax = subplots(figsize=(8,8))\n", "km = KaplanMeierFitter()\n", "km_brain = km.fit(BrainCancer['time'], BrainCancer['status'])\n", - "km_brain.plot(label='Kaplan Meier estimate', ax=ax)" + "km_brain.plot(label='Kaplan Meier estimate', ax=ax)\n" ] }, { @@ -316,10 +321,10 @@ "id": "3fc7848c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.468449Z", - "iopub.status.busy": "2023-07-31T02:15:38.468262Z", - "iopub.status.idle": "2023-07-31T02:15:38.604720Z", - "shell.execute_reply": "2023-07-31T02:15:38.604313Z" + "iopub.execute_input": "2023-08-06T17:35:47.696231Z", + "iopub.status.busy": "2023-08-06T17:35:47.695950Z", + "iopub.status.idle": "2023-08-06T17:35:47.857113Z", + "shell.execute_reply": "2023-08-06T17:35:47.856731Z" } }, "outputs": [ @@ -340,7 +345,7 @@ "for sex, df in BrainCancer.groupby('sex'):\n", " by_sex[sex] = df\n", " km_sex = km.fit(df['time'], df['status'])\n", - " km_sex.plot(label='Sex=%s' % sex, ax=ax)" + " km_sex.plot(label='Sex=%s' % sex, ax=ax)\n" ] }, { @@ -361,11 +366,12 @@ "id": "bf30d26f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.606730Z", - "iopub.status.busy": "2023-07-31T02:15:38.606598Z", - "iopub.status.idle": "2023-07-31T02:15:38.666348Z", - "shell.execute_reply": "2023-07-31T02:15:38.665926Z" - } + "iopub.execute_input": "2023-08-06T17:35:47.858891Z", + "iopub.status.busy": "2023-08-06T17:35:47.858766Z", + "iopub.status.idle": "2023-08-06T17:35:47.913319Z", + "shell.execute_reply": "2023-08-06T17:35:47.913028Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -451,7 +457,7 @@ "logrank_test(by_sex['Male']['time'],\n", " by_sex['Female']['time'],\n", " by_sex['Male']['status'],\n", - " by_sex['Female']['status'])" + " by_sex['Female']['status'])\n" ] }, { @@ -473,10 +479,10 @@ "id": "2ab78e07", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.668086Z", - "iopub.status.busy": "2023-07-31T02:15:38.667893Z", - "iopub.status.idle": "2023-07-31T02:15:38.695653Z", - "shell.execute_reply": "2023-07-31T02:15:38.695352Z" + "iopub.execute_input": "2023-08-06T17:35:47.914969Z", + "iopub.status.busy": "2023-08-06T17:35:47.914826Z", + "iopub.status.idle": "2023-08-06T17:35:47.941528Z", + "shell.execute_reply": "2023-08-06T17:35:47.941277Z" } }, "outputs": [ @@ -542,7 +548,7 @@ "cox_fit = coxph().fit(model_df,\n", " 'time',\n", " 'status')\n", - "cox_fit.summary[['coef', 'se(coef)', 'p']]" + "cox_fit.summary[['coef', 'se(coef)', 'p']]\n" ] }, { @@ -566,10 +572,10 @@ "id": "4716b7b0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.697533Z", - "iopub.status.busy": "2023-07-31T02:15:38.697411Z", - "iopub.status.idle": "2023-07-31T02:15:38.703099Z", - "shell.execute_reply": "2023-07-31T02:15:38.702785Z" + "iopub.execute_input": "2023-08-06T17:35:47.943061Z", + "iopub.status.busy": "2023-08-06T17:35:47.942963Z", + "iopub.status.idle": "2023-08-06T17:35:47.948065Z", + "shell.execute_reply": "2023-08-06T17:35:47.947785Z" } }, "outputs": [ @@ -648,7 +654,7 @@ } ], "source": [ - "cox_fit.log_likelihood_ratio_test()" + "cox_fit.log_likelihood_ratio_test()\n" ] }, { @@ -672,10 +678,10 @@ "id": "c2767d88", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.704759Z", - "iopub.status.busy": "2023-07-31T02:15:38.704654Z", - "iopub.status.idle": "2023-07-31T02:15:38.742754Z", - "shell.execute_reply": "2023-07-31T02:15:38.742458Z" + "iopub.execute_input": "2023-08-06T17:35:47.949725Z", + "iopub.status.busy": "2023-08-06T17:35:47.949641Z", + "iopub.status.idle": "2023-08-06T17:35:47.982167Z", + "shell.execute_reply": "2023-08-06T17:35:47.981821Z" } }, "outputs": [ @@ -789,7 +795,7 @@ "fit_all = coxph().fit(all_df,\n", " 'time',\n", " 'status')\n", - "fit_all.summary[['coef', 'se(coef)', 'p']]" + "fit_all.summary[['coef', 'se(coef)', 'p']]\n" ] }, { @@ -820,10 +826,10 @@ "id": "ede1d219", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.744507Z", - "iopub.status.busy": "2023-07-31T02:15:38.744382Z", - "iopub.status.idle": "2023-07-31T02:15:38.748245Z", - "shell.execute_reply": "2023-07-31T02:15:38.747960Z" + "iopub.execute_input": "2023-08-06T17:35:47.983958Z", + "iopub.status.busy": "2023-08-06T17:35:47.983832Z", + "iopub.status.idle": "2023-08-06T17:35:47.989895Z", + "shell.execute_reply": "2023-08-06T17:35:47.989591Z" } }, "outputs": [], @@ -834,7 +840,7 @@ " return pd.Series.mode(series)\n", " else:\n", " return series.mean()\n", - "modal_data = cleaned.apply(representative, axis=0)" + "modal_data = cleaned.apply(representative, axis=0)\n" ] }, { @@ -853,10 +859,10 @@ "id": "dc032a71", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.749853Z", - "iopub.status.busy": "2023-07-31T02:15:38.749753Z", - "iopub.status.idle": "2023-07-31T02:15:38.755760Z", - "shell.execute_reply": "2023-07-31T02:15:38.755479Z" + "iopub.execute_input": "2023-08-06T17:35:47.991841Z", + "iopub.status.busy": "2023-08-06T17:35:47.991705Z", + "iopub.status.idle": "2023-08-06T17:35:47.997910Z", + "shell.execute_reply": "2023-08-06T17:35:47.997622Z" } }, "outputs": [ @@ -963,7 +969,7 @@ "modal_df = pd.DataFrame(\n", " [modal_data.iloc[0] for _ in range(len(levels))])\n", "modal_df['diagnosis'] = levels\n", - "modal_df" + "modal_df\n" ] }, { @@ -981,10 +987,10 @@ "id": "e7c1fe43", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.757256Z", - "iopub.status.busy": "2023-07-31T02:15:38.757143Z", - "iopub.status.idle": "2023-07-31T02:15:38.764838Z", - "shell.execute_reply": "2023-07-31T02:15:38.764420Z" + "iopub.execute_input": "2023-08-06T17:35:47.999542Z", + "iopub.status.busy": "2023-08-06T17:35:47.999430Z", + "iopub.status.idle": "2023-08-06T17:35:48.007263Z", + "shell.execute_reply": "2023-08-06T17:35:48.006958Z" } }, "outputs": [ @@ -1106,7 +1112,7 @@ "source": [ "modal_X = all_MS.transform(modal_df)\n", "modal_X.index = levels\n", - "modal_X" + "modal_X\n" ] }, { @@ -1123,11 +1129,12 @@ "id": "f89fbed7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.766834Z", - "iopub.status.busy": "2023-07-31T02:15:38.766698Z", - "iopub.status.idle": "2023-07-31T02:15:38.774286Z", - "shell.execute_reply": "2023-07-31T02:15:38.774004Z" - } + "iopub.execute_input": "2023-08-06T17:35:48.008740Z", + "iopub.status.busy": "2023-08-06T17:35:48.008640Z", + "iopub.status.idle": "2023-08-06T17:35:48.015006Z", + "shell.execute_reply": "2023-08-06T17:35:48.014745Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1264,7 +1271,7 @@ ], "source": [ "predicted_survival = fit_all.predict_survival_function(modal_X)\n", - "predicted_survival" + "predicted_survival\n" ] }, { @@ -1283,11 +1290,12 @@ "id": "8f0329b4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.776165Z", - "iopub.status.busy": "2023-07-31T02:15:38.776021Z", - "iopub.status.idle": "2023-07-31T02:15:38.882750Z", - "shell.execute_reply": "2023-07-31T02:15:38.882417Z" - } + "iopub.execute_input": "2023-08-06T17:35:48.016512Z", + "iopub.status.busy": "2023-08-06T17:35:48.016391Z", + "iopub.status.idle": "2023-08-06T17:35:48.128436Z", + "shell.execute_reply": "2023-08-06T17:35:48.127998Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1303,7 +1311,7 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "predicted_survival.plot(ax=ax);" + "predicted_survival.plot(ax=ax);\n" ] }, { @@ -1325,10 +1333,10 @@ "id": "3045bfc0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:38.884377Z", - "iopub.status.busy": "2023-07-31T02:15:38.884272Z", - "iopub.status.idle": "2023-07-31T02:15:38.999104Z", - "shell.execute_reply": "2023-07-31T02:15:38.998778Z" + "iopub.execute_input": "2023-08-06T17:35:48.130335Z", + "iopub.status.busy": "2023-08-06T17:35:48.130198Z", + "iopub.status.idle": "2023-08-06T17:35:48.248098Z", + "shell.execute_reply": "2023-08-06T17:35:48.247765Z" } }, "outputs": [ @@ -1350,7 +1358,7 @@ "for result, df in Publication.groupby('posres'):\n", " by_result[result] = df\n", " km_result = km.fit(df['time'], df['status'])\n", - " km_result.plot(label='Result=%d' % result, ax=ax)" + " km_result.plot(label='Result=%d' % result, ax=ax)\n" ] }, { @@ -1370,11 +1378,12 @@ "id": "d070f716", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.000963Z", - "iopub.status.busy": "2023-07-31T02:15:39.000831Z", - "iopub.status.idle": "2023-07-31T02:15:39.031731Z", - "shell.execute_reply": "2023-07-31T02:15:39.031439Z" - } + "iopub.execute_input": "2023-08-06T17:35:48.249785Z", + "iopub.status.busy": "2023-08-06T17:35:48.249668Z", + "iopub.status.idle": "2023-08-06T17:35:48.282954Z", + "shell.execute_reply": "2023-08-06T17:35:48.282630Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1439,7 +1448,7 @@ "posres_fit = coxph().fit(posres_df,\n", " 'time',\n", " 'status')\n", - "posres_fit.summary[['coef', 'se(coef)', 'p']]" + "posres_fit.summary[['coef', 'se(coef)', 'p']]\n" ] }, { @@ -1458,10 +1467,10 @@ "id": "2bbcdd0c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.033405Z", - "iopub.status.busy": "2023-07-31T02:15:39.033297Z", - "iopub.status.idle": "2023-07-31T02:15:39.071871Z", - "shell.execute_reply": "2023-07-31T02:15:39.071602Z" + "iopub.execute_input": "2023-08-06T17:35:48.284714Z", + "iopub.status.busy": "2023-08-06T17:35:48.284593Z", + "iopub.status.idle": "2023-08-06T17:35:48.323890Z", + "shell.execute_reply": "2023-08-06T17:35:48.323545Z" } }, "outputs": [ @@ -1559,7 +1568,7 @@ " intercept=False)\n", "coxph().fit(model.fit_transform(Publication),\n", " 'time',\n", - " 'status').summary[['coef', 'se(coef)', 'p']]" + " 'status').summary[['coef', 'se(coef)', 'p']]\n" ] }, { @@ -1593,7 +1602,7 @@ "`Time` of day (Morning, Afternoon, or Evening). We generate data\n", "for these covariates so that all possibilities are equally likely: for\n", "instance, morning, afternoon and evening calls are equally likely, and\n", - "any number of operators from $5$ to $15$ is equally likely." + "any number of operators from $5$ to $15$ is equally likely. " ] }, { @@ -1602,10 +1611,10 @@ "id": "b8ece43a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.073478Z", - "iopub.status.busy": "2023-07-31T02:15:39.073379Z", - "iopub.status.idle": "2023-07-31T02:15:39.076907Z", - "shell.execute_reply": "2023-07-31T02:15:39.076640Z" + "iopub.execute_input": "2023-08-06T17:35:48.325634Z", + "iopub.status.busy": "2023-08-06T17:35:48.325517Z", + "iopub.status.idle": "2023-08-06T17:35:48.329272Z", + "shell.execute_reply": "2023-08-06T17:35:48.328978Z" } }, "outputs": [], @@ -1640,10 +1649,10 @@ "id": "3e4f766f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.078347Z", - "iopub.status.busy": "2023-07-31T02:15:39.078266Z", - "iopub.status.idle": "2023-07-31T02:15:39.085129Z", - "shell.execute_reply": "2023-07-31T02:15:39.084865Z" + "iopub.execute_input": "2023-08-06T17:35:48.330871Z", + "iopub.status.busy": "2023-08-06T17:35:48.330782Z", + "iopub.status.idle": "2023-08-06T17:35:48.337958Z", + "shell.execute_reply": "2023-08-06T17:35:48.337672Z" } }, "outputs": [], @@ -1672,10 +1681,10 @@ "id": "72f42d14", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.086703Z", - "iopub.status.busy": "2023-07-31T02:15:39.086584Z", - "iopub.status.idle": "2023-07-31T02:15:39.090844Z", - "shell.execute_reply": "2023-07-31T02:15:39.090578Z" + "iopub.execute_input": "2023-08-06T17:35:48.339669Z", + "iopub.status.busy": "2023-08-06T17:35:48.339578Z", + "iopub.status.idle": "2023-08-06T17:35:48.343948Z", + "shell.execute_reply": "2023-08-06T17:35:48.343688Z" } }, "outputs": [ @@ -1767,7 +1776,7 @@ } ], "source": [ - "X[:5]" + "X[:5]\n" ] }, { @@ -1784,17 +1793,17 @@ "id": "8b921536", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.092615Z", - "iopub.status.busy": "2023-07-31T02:15:39.092336Z", - "iopub.status.idle": "2023-07-31T02:15:39.103571Z", - "shell.execute_reply": "2023-07-31T02:15:39.101990Z" + "iopub.execute_input": "2023-08-06T17:35:48.345389Z", + "iopub.status.busy": "2023-08-06T17:35:48.345291Z", + "iopub.status.idle": "2023-08-06T17:35:48.350596Z", + "shell.execute_reply": "2023-08-06T17:35:48.349892Z" } }, "outputs": [], "source": [ "true_beta = np.array([0.04, -0.3, 0, 0.2, -0.2])\n", "true_linpred = X.dot(true_beta)\n", - "hazard = lambda t: 1e-5 * t" + "hazard = lambda t: 1e-5 * t\n" ] }, { @@ -1831,15 +1840,16 @@ "id": "96ce0f99", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.107799Z", - "iopub.status.busy": "2023-07-31T02:15:39.107513Z", - "iopub.status.idle": "2023-07-31T02:15:39.111944Z", - "shell.execute_reply": "2023-07-31T02:15:39.110837Z" - } + "iopub.execute_input": "2023-08-06T17:35:48.356110Z", + "iopub.status.busy": "2023-08-06T17:35:48.355787Z", + "iopub.status.idle": "2023-08-06T17:35:48.360120Z", + "shell.execute_reply": "2023-08-06T17:35:48.358812Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "cum_hazard = lambda t: 1e-5 * t**2 / 2" + "cum_hazard = lambda t: 1e-5 * t**2 / 2\n" ] }, { @@ -1861,17 +1871,17 @@ "id": "63d78ff9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.116637Z", - "iopub.status.busy": "2023-07-31T02:15:39.116086Z", - "iopub.status.idle": "2023-07-31T02:15:39.297425Z", - "shell.execute_reply": "2023-07-31T02:15:39.293868Z" + "iopub.execute_input": "2023-08-06T17:35:48.363547Z", + "iopub.status.busy": "2023-08-06T17:35:48.363232Z", + "iopub.status.idle": "2023-08-06T17:35:48.547724Z", + "shell.execute_reply": "2023-08-06T17:35:48.547018Z" } }, "outputs": [], "source": [ "W = np.array([sim_time(l, cum_hazard, rng)\n", " for l in true_linpred])\n", - "D['Wait time'] = np.clip(W, 0, 1000)" + "D['Wait time'] = np.clip(W, 0, 1000)\n" ] }, { @@ -1890,11 +1900,12 @@ "id": "fe008dbf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.312187Z", - "iopub.status.busy": "2023-07-31T02:15:39.311513Z", - "iopub.status.idle": "2023-07-31T02:15:39.327004Z", - "shell.execute_reply": "2023-07-31T02:15:39.326346Z" - } + "iopub.execute_input": "2023-08-06T17:35:48.552971Z", + "iopub.status.busy": "2023-08-06T17:35:48.552635Z", + "iopub.status.idle": "2023-08-06T17:35:48.584979Z", + "shell.execute_reply": "2023-08-06T17:35:48.563731Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1988,7 +1999,7 @@ "D['Failed'] = rng.choice([1, 0],\n", " N,\n", " p=[0.9, 0.1])\n", - "D[:5]" + "D[:5]\n" ] }, { @@ -1997,10 +2008,10 @@ "id": "c3a2bec7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.330721Z", - "iopub.status.busy": "2023-07-31T02:15:39.330474Z", - "iopub.status.idle": "2023-07-31T02:15:39.363217Z", - "shell.execute_reply": "2023-07-31T02:15:39.362899Z" + "iopub.execute_input": "2023-08-06T17:35:48.615161Z", + "iopub.status.busy": "2023-08-06T17:35:48.614999Z", + "iopub.status.idle": "2023-08-06T17:35:48.618097Z", + "shell.execute_reply": "2023-08-06T17:35:48.617615Z" } }, "outputs": [ @@ -2016,7 +2027,7 @@ } ], "source": [ - "D['Failed'].mean()" + "D['Failed'].mean()\n" ] }, { @@ -2033,10 +2044,10 @@ "id": "2b27af56", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.364912Z", - "iopub.status.busy": "2023-07-31T02:15:39.364808Z", - "iopub.status.idle": "2023-07-31T02:15:39.567228Z", - "shell.execute_reply": "2023-07-31T02:15:39.566838Z" + "iopub.execute_input": "2023-08-06T17:35:48.620507Z", + "iopub.status.busy": "2023-08-06T17:35:48.620371Z", + "iopub.status.idle": "2023-08-06T17:35:48.790525Z", + "shell.execute_reply": "2023-08-06T17:35:48.790116Z" } }, "outputs": [ @@ -2068,7 +2079,7 @@ " by_center[center] = df\n", " km_center = km.fit(df['Wait time'], df['Failed'])\n", " km_center.plot(label='Center=%s' % center, ax=ax)\n", - "ax.set_title(\"Probability of Still Being on Hold\")" + "ax.set_title(\"Probability of Still Being on Hold\")\n" ] }, { @@ -2085,10 +2096,10 @@ "id": "9625598d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.569040Z", - "iopub.status.busy": "2023-07-31T02:15:39.568920Z", - "iopub.status.idle": "2023-07-31T02:15:39.823091Z", - "shell.execute_reply": "2023-07-31T02:15:39.822627Z" + "iopub.execute_input": "2023-08-06T17:35:48.792256Z", + "iopub.status.busy": "2023-08-06T17:35:48.792159Z", + "iopub.status.idle": "2023-08-06T17:35:49.004599Z", + "shell.execute_reply": "2023-08-06T17:35:49.004246Z" } }, "outputs": [ @@ -2120,7 +2131,7 @@ " by_time[time] = df\n", " km_time = km.fit(df['Wait time'], df['Failed'])\n", " km_time.plot(label='Time=%s' % time, ax=ax)\n", - "ax.set_title(\"Probability of Still Being on Hold\")" + "ax.set_title(\"Probability of Still Being on Hold\")\n" ] }, { @@ -2141,11 +2152,12 @@ "id": "75a744ef", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.825758Z", - "iopub.status.busy": "2023-07-31T02:15:39.825581Z", - "iopub.status.idle": "2023-07-31T02:15:39.847974Z", - "shell.execute_reply": "2023-07-31T02:15:39.847624Z" - } + "iopub.execute_input": "2023-08-06T17:35:49.006368Z", + "iopub.status.busy": "2023-08-06T17:35:49.006251Z", + "iopub.status.idle": "2023-08-06T17:35:49.026122Z", + "shell.execute_reply": "2023-08-06T17:35:49.025786Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2230,7 +2242,7 @@ "source": [ "multivariate_logrank_test(D['Wait time'],\n", " D['Center'],\n", - " D['Failed'])" + " D['Failed'])\n" ] }, { @@ -2247,11 +2259,12 @@ "id": "9badb3e3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.850725Z", - "iopub.status.busy": "2023-07-31T02:15:39.850538Z", - "iopub.status.idle": "2023-07-31T02:15:39.873327Z", - "shell.execute_reply": "2023-07-31T02:15:39.873038Z" - } + "iopub.execute_input": "2023-08-06T17:35:49.027909Z", + "iopub.status.busy": "2023-08-06T17:35:49.027782Z", + "iopub.status.idle": "2023-08-06T17:35:49.046955Z", + "shell.execute_reply": "2023-08-06T17:35:49.046606Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2336,7 +2349,7 @@ "source": [ "multivariate_logrank_test(D['Wait time'],\n", " D['Time'],\n", - " D['Failed'])" + " D['Failed'])\n" ] }, { @@ -2356,11 +2369,12 @@ "id": "026e9ff8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:39.875394Z", - "iopub.status.busy": "2023-07-31T02:15:39.875265Z", - "iopub.status.idle": "2023-07-31T02:15:40.004667Z", - "shell.execute_reply": "2023-07-31T02:15:40.004293Z" - } + "iopub.execute_input": "2023-08-06T17:35:49.048485Z", + "iopub.status.busy": "2023-08-06T17:35:49.048378Z", + "iopub.status.idle": "2023-08-06T17:35:49.175538Z", + "shell.execute_reply": "2023-08-06T17:35:49.175268Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2443,7 +2457,7 @@ " 'Center'],\n", " intercept=False).fit_transform(D)\n", "F = coxph().fit(X, 'Wait time', 'Failed')\n", - "F.log_likelihood_ratio_test()" + "F.log_likelihood_ratio_test()\n" ] }, { @@ -2460,11 +2474,12 @@ "id": "7cab3789", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:40.006886Z", - "iopub.status.busy": "2023-07-31T02:15:40.006736Z", - "iopub.status.idle": "2023-07-31T02:15:40.134843Z", - "shell.execute_reply": "2023-07-31T02:15:40.134522Z" - } + "iopub.execute_input": "2023-08-06T17:35:49.177180Z", + "iopub.status.busy": "2023-08-06T17:35:49.177056Z", + "iopub.status.idle": "2023-08-06T17:35:49.306158Z", + "shell.execute_reply": "2023-08-06T17:35:49.305806Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2547,7 +2562,7 @@ " 'Time'],\n", " intercept=False).fit_transform(D)\n", "F = coxph().fit(X, 'Wait time', 'Failed')\n", - "F.log_likelihood_ratio_test()" + "F.log_likelihood_ratio_test()\n" ] }, { @@ -2567,11 +2582,12 @@ "id": "5cc4b898", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:40.136769Z", - "iopub.status.busy": "2023-07-31T02:15:40.136659Z", - "iopub.status.idle": "2023-07-31T02:15:40.462485Z", - "shell.execute_reply": "2023-07-31T02:15:40.457034Z" - } + "iopub.execute_input": "2023-08-06T17:35:49.308130Z", + "iopub.status.busy": "2023-08-06T17:35:49.307985Z", + "iopub.status.idle": "2023-08-06T17:35:49.596821Z", + "shell.execute_reply": "2023-08-06T17:35:49.585317Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2663,7 +2679,7 @@ " X,\n", " 'Wait time',\n", " 'Failed')\n", - "fit_queuing.summary[['coef', 'se(coef)', 'p']]" + "fit_queuing.summary[['coef', 'se(coef)', 'p']]\n" ] }, { @@ -2679,15 +2695,16 @@ " `Operators`, `Center = B`, `Center = C`, \n", "`Time = Even.` and `Time = Morn.` are $0.04$, $-0.3$,\n", "$0$, $0.2$, and $-0.2$, respectively. The coefficient estimates\n", - "from the fitted Cox model are fairly accurate." + "from the fitted Cox model are fairly accurate.\n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch12-unsup-lab.ipynb b/Ch12-unsup-lab.ipynb index b0f01b8..030e9f3 100644 --- a/Ch12-unsup-lab.ipynb +++ b/Ch12-unsup-lab.ipynb @@ -5,6 +5,7 @@ "id": "80f16ff6", "metadata": {}, "source": [ + "\n", "# Chapter 12\n", "\n", " # Lab: Unsupervised Learning\n", @@ -21,11 +22,12 @@ "id": "24559be0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:41.879970Z", - "iopub.status.busy": "2023-07-31T02:15:41.879508Z", - "iopub.status.idle": "2023-07-31T02:15:42.856920Z", - "shell.execute_reply": "2023-07-31T02:15:42.856210Z" - } + "iopub.execute_input": "2023-08-06T17:35:50.946303Z", + "iopub.status.busy": "2023-08-06T17:35:50.945891Z", + "iopub.status.idle": "2023-08-06T17:35:51.937962Z", + "shell.execute_reply": "2023-08-06T17:35:51.937388Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -35,7 +37,7 @@ "from statsmodels.datasets import get_rdataset\n", "from sklearn.decomposition import PCA\n", "from sklearn.preprocessing import StandardScaler\n", - "from ISLP import load_data" + "from ISLP import load_data\n" ] }, { @@ -53,10 +55,10 @@ "id": "06fff57d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:42.859595Z", - "iopub.status.busy": "2023-07-31T02:15:42.859101Z", - "iopub.status.idle": "2023-07-31T02:15:43.112055Z", - "shell.execute_reply": "2023-07-31T02:15:43.111717Z" + "iopub.execute_input": "2023-08-06T17:35:51.940380Z", + "iopub.status.busy": "2023-08-06T17:35:51.940035Z", + "iopub.status.idle": "2023-08-06T17:35:52.182557Z", + "shell.execute_reply": "2023-08-06T17:35:52.182174Z" } }, "outputs": [], @@ -67,7 +69,7 @@ "from scipy.cluster.hierarchy import \\\n", " (dendrogram,\n", " cut_tree)\n", - "from ISLP.cluster import compute_linkage" + "from ISLP.cluster import compute_linkage\n" ] }, { @@ -90,10 +92,10 @@ "id": "f425e07e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:43.113880Z", - "iopub.status.busy": "2023-07-31T02:15:43.113757Z", - "iopub.status.idle": "2023-07-31T02:15:44.064565Z", - "shell.execute_reply": "2023-07-31T02:15:44.064071Z" + "iopub.execute_input": "2023-08-06T17:35:52.184517Z", + "iopub.status.busy": "2023-08-06T17:35:52.184399Z", + "iopub.status.idle": "2023-08-06T17:35:53.499360Z", + "shell.execute_reply": "2023-08-06T17:35:53.498788Z" } }, "outputs": [ @@ -540,7 +542,7 @@ ], "source": [ "USArrests = get_rdataset('USArrests').data\n", - "USArrests" + "USArrests\n" ] }, { @@ -557,10 +559,10 @@ "id": "b127d014", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.067474Z", - "iopub.status.busy": "2023-07-31T02:15:44.067264Z", - "iopub.status.idle": "2023-07-31T02:15:44.071359Z", - "shell.execute_reply": "2023-07-31T02:15:44.070795Z" + "iopub.execute_input": "2023-08-06T17:35:53.502695Z", + "iopub.status.busy": "2023-08-06T17:35:53.502469Z", + "iopub.status.idle": "2023-08-06T17:35:53.506258Z", + "shell.execute_reply": "2023-08-06T17:35:53.505850Z" } }, "outputs": [ @@ -576,7 +578,7 @@ } ], "source": [ - "USArrests.columns" + "USArrests.columns\n" ] }, { @@ -593,11 +595,12 @@ "id": "c7343f72", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.073723Z", - "iopub.status.busy": "2023-07-31T02:15:44.073531Z", - "iopub.status.idle": "2023-07-31T02:15:44.079018Z", - "shell.execute_reply": "2023-07-31T02:15:44.078591Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.508693Z", + "iopub.status.busy": "2023-08-06T17:35:53.508529Z", + "iopub.status.idle": "2023-08-06T17:35:53.513068Z", + "shell.execute_reply": "2023-08-06T17:35:53.512687Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -616,7 +619,7 @@ } ], "source": [ - "USArrests.mean()" + "USArrests.mean()\n" ] }, { @@ -635,10 +638,10 @@ "id": "34501140", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.081447Z", - "iopub.status.busy": "2023-07-31T02:15:44.081236Z", - "iopub.status.idle": "2023-07-31T02:15:44.085505Z", - "shell.execute_reply": "2023-07-31T02:15:44.085102Z" + "iopub.execute_input": "2023-08-06T17:35:53.515314Z", + "iopub.status.busy": "2023-08-06T17:35:53.515139Z", + "iopub.status.idle": "2023-08-06T17:35:53.518912Z", + "shell.execute_reply": "2023-08-06T17:35:53.518569Z" } }, "outputs": [ @@ -658,7 +661,7 @@ } ], "source": [ - "USArrests.var()" + "USArrests.var()\n" ] }, { @@ -680,7 +683,7 @@ "This scaling can be done via the `StandardScaler()` transform imported above. We first `fit` the\n", "scaler, which computes the necessary means and standard\n", "deviations and then apply it to our data using the\n", - "`transform` method. As before, we combine these steps using the `fit_transform()` method." + "`transform` method. As before, we combine these steps using the `fit_transform()` method.\n" ] }, { @@ -689,17 +692,18 @@ "id": "daf119e8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.088730Z", - "iopub.status.busy": "2023-07-31T02:15:44.088542Z", - "iopub.status.idle": "2023-07-31T02:15:44.094101Z", - "shell.execute_reply": "2023-07-31T02:15:44.093712Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.521091Z", + "iopub.status.busy": "2023-08-06T17:35:53.520960Z", + "iopub.status.idle": "2023-08-06T17:35:53.525175Z", + "shell.execute_reply": "2023-08-06T17:35:53.524847Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "scaler = StandardScaler(with_std=True,\n", " with_mean=True)\n", - "USArrests_scaled = scaler.fit_transform(USArrests)" + "USArrests_scaled = scaler.fit_transform(USArrests)\n" ] }, { @@ -718,15 +722,16 @@ "id": "a0eda7c9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.096171Z", - "iopub.status.busy": "2023-07-31T02:15:44.096020Z", - "iopub.status.idle": "2023-07-31T02:15:44.098050Z", - "shell.execute_reply": "2023-07-31T02:15:44.097717Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.527052Z", + "iopub.status.busy": "2023-08-06T17:35:53.526916Z", + "iopub.status.idle": "2023-08-06T17:35:53.528807Z", + "shell.execute_reply": "2023-08-06T17:35:53.528507Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "pcaUS = PCA()" + "pcaUS = PCA()\n" ] }, { @@ -746,10 +751,10 @@ "id": "1430fb3c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.099875Z", - "iopub.status.busy": "2023-07-31T02:15:44.099755Z", - "iopub.status.idle": "2023-07-31T02:15:44.105977Z", - "shell.execute_reply": "2023-07-31T02:15:44.105615Z" + "iopub.execute_input": "2023-08-06T17:35:53.530511Z", + "iopub.status.busy": "2023-08-06T17:35:53.530398Z", + "iopub.status.idle": "2023-08-06T17:35:53.534557Z", + "shell.execute_reply": "2023-08-06T17:35:53.534277Z" } }, "outputs": [ @@ -768,7 +773,7 @@ } ], "source": [ - "pcaUS.fit(USArrests_scaled)" + "pcaUS.fit(USArrests_scaled)\n" ] }, { @@ -787,10 +792,10 @@ "id": "6131d8d1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.108075Z", - "iopub.status.busy": "2023-07-31T02:15:44.107938Z", - "iopub.status.idle": "2023-07-31T02:15:44.111407Z", - "shell.execute_reply": "2023-07-31T02:15:44.110881Z" + "iopub.execute_input": "2023-08-06T17:35:53.536106Z", + "iopub.status.busy": "2023-08-06T17:35:53.536010Z", + "iopub.status.idle": "2023-08-06T17:35:53.538352Z", + "shell.execute_reply": "2023-08-06T17:35:53.538107Z" } }, "outputs": [ @@ -806,7 +811,7 @@ } ], "source": [ - "pcaUS.mean_" + "pcaUS.mean_\n" ] }, { @@ -824,15 +829,16 @@ "id": "08246aad", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.114037Z", - "iopub.status.busy": "2023-07-31T02:15:44.113916Z", - "iopub.status.idle": "2023-07-31T02:15:44.116405Z", - "shell.execute_reply": "2023-07-31T02:15:44.115821Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.539900Z", + "iopub.status.busy": "2023-08-06T17:35:53.539817Z", + "iopub.status.idle": "2023-08-06T17:35:53.541716Z", + "shell.execute_reply": "2023-08-06T17:35:53.541426Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "scores = pcaUS.transform(USArrests_scaled)" + "scores = pcaUS.transform(USArrests_scaled)\n" ] }, { @@ -843,7 +849,7 @@ "We will plot these scores a bit further down.\n", "The `components_` attribute provides the principal component loadings:\n", "each row of `pcaUS.components_` contains the corresponding\n", - "principal component loading vector." + "principal component loading vector.\n" ] }, { @@ -852,10 +858,10 @@ "id": "b682b632", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.119132Z", - "iopub.status.busy": "2023-07-31T02:15:44.118910Z", - "iopub.status.idle": "2023-07-31T02:15:44.121993Z", - "shell.execute_reply": "2023-07-31T02:15:44.121638Z" + "iopub.execute_input": "2023-08-06T17:35:53.543126Z", + "iopub.status.busy": "2023-08-06T17:35:53.543023Z", + "iopub.status.idle": "2023-08-06T17:35:53.545038Z", + "shell.execute_reply": "2023-08-06T17:35:53.544799Z" } }, "outputs": [ @@ -874,7 +880,7 @@ } ], "source": [ - "pcaUS.components_ " + "pcaUS.components_ \n" ] }, { @@ -895,11 +901,12 @@ "id": "c165e990", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.124021Z", - "iopub.status.busy": "2023-07-31T02:15:44.123902Z", - "iopub.status.idle": "2023-07-31T02:15:44.326760Z", - "shell.execute_reply": "2023-07-31T02:15:44.325973Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.546528Z", + "iopub.status.busy": "2023-08-06T17:35:53.546434Z", + "iopub.status.idle": "2023-08-06T17:35:53.703738Z", + "shell.execute_reply": "2023-08-06T17:35:53.701839Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -923,7 +930,7 @@ " ax.arrow(0, 0, pcaUS.components_[i,k], pcaUS.components_[j,k])\n", " ax.text(pcaUS.components_[i,k],\n", " pcaUS.components_[j,k],\n", - " USArrests.columns[k])" + " USArrests.columns[k])\n" ] }, { @@ -944,10 +951,10 @@ "id": "848c9f35", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.331474Z", - "iopub.status.busy": "2023-07-31T02:15:44.331142Z", - "iopub.status.idle": "2023-07-31T02:15:44.477006Z", - "shell.execute_reply": "2023-07-31T02:15:44.476667Z" + "iopub.execute_input": "2023-08-06T17:35:53.707901Z", + "iopub.status.busy": "2023-08-06T17:35:53.707587Z", + "iopub.status.idle": "2023-08-06T17:35:53.873714Z", + "shell.execute_reply": "2023-08-06T17:35:53.873405Z" } }, "outputs": [ @@ -974,7 +981,7 @@ " ax.arrow(0, 0, s_*pcaUS.components_[i,k], s_*pcaUS.components_[j,k])\n", " ax.text(s_*pcaUS.components_[i,k],\n", " s_*pcaUS.components_[j,k],\n", - " USArrests.columns[k])" + " USArrests.columns[k])\n" ] }, { @@ -991,11 +998,12 @@ "id": "34fdfe21", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.478797Z", - "iopub.status.busy": "2023-07-31T02:15:44.478681Z", - "iopub.status.idle": "2023-07-31T02:15:44.481387Z", - "shell.execute_reply": "2023-07-31T02:15:44.481086Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.875331Z", + "iopub.status.busy": "2023-08-06T17:35:53.875218Z", + "iopub.status.idle": "2023-08-06T17:35:53.877664Z", + "shell.execute_reply": "2023-08-06T17:35:53.877409Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1028,11 +1036,12 @@ "id": "31b43c57", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.482964Z", - "iopub.status.busy": "2023-07-31T02:15:44.482858Z", - "iopub.status.idle": "2023-07-31T02:15:44.485137Z", - "shell.execute_reply": "2023-07-31T02:15:44.484860Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.879208Z", + "iopub.status.busy": "2023-08-06T17:35:53.879107Z", + "iopub.status.idle": "2023-08-06T17:35:53.881162Z", + "shell.execute_reply": "2023-08-06T17:35:53.880912Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1047,7 +1056,7 @@ } ], "source": [ - "pcaUS.explained_variance_" + "pcaUS.explained_variance_\n" ] }, { @@ -1065,11 +1074,12 @@ "id": "68e47d3a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.486657Z", - "iopub.status.busy": "2023-07-31T02:15:44.486550Z", - "iopub.status.idle": "2023-07-31T02:15:44.488838Z", - "shell.execute_reply": "2023-07-31T02:15:44.488560Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.882669Z", + "iopub.status.busy": "2023-08-06T17:35:53.882569Z", + "iopub.status.idle": "2023-08-06T17:35:53.884536Z", + "shell.execute_reply": "2023-08-06T17:35:53.884304Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1084,7 +1094,7 @@ } ], "source": [ - "pcaUS.explained_variance_ratio_" + "pcaUS.explained_variance_ratio_\n" ] }, { @@ -1105,11 +1115,12 @@ "id": "e87fe198", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.490567Z", - "iopub.status.busy": "2023-07-31T02:15:44.490460Z", - "iopub.status.idle": "2023-07-31T02:15:44.624499Z", - "shell.execute_reply": "2023-07-31T02:15:44.624178Z" - } + "iopub.execute_input": "2023-08-06T17:35:53.885937Z", + "iopub.status.busy": "2023-08-06T17:35:53.885846Z", + "iopub.status.idle": "2023-08-06T17:35:54.017444Z", + "shell.execute_reply": "2023-08-06T17:35:54.017056Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -1123,7 +1134,7 @@ "ax.set_xlabel('Principal Component');\n", "ax.set_ylabel('Proportion of Variance Explained')\n", "ax.set_ylim([0,1])\n", - "ax.set_xticks(ticks)" + "ax.set_xticks(ticks)\n" ] }, { @@ -1140,11 +1151,12 @@ "id": "409fb0c6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.626407Z", - "iopub.status.busy": "2023-07-31T02:15:44.626296Z", - "iopub.status.idle": "2023-07-31T02:15:44.730749Z", - "shell.execute_reply": "2023-07-31T02:15:44.730399Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.019369Z", + "iopub.status.busy": "2023-08-06T17:35:54.019233Z", + "iopub.status.idle": "2023-08-06T17:35:54.126102Z", + "shell.execute_reply": "2023-08-06T17:35:54.125778Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1168,7 +1180,7 @@ "ax.set_ylabel('Cumulative Proportion of Variance Explained')\n", "ax.set_ylim([0, 1])\n", "ax.set_xticks(ticks)\n", - "fig" + "fig\n" ] }, { @@ -1187,11 +1199,12 @@ "id": "e563e41b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.732589Z", - "iopub.status.busy": "2023-07-31T02:15:44.732464Z", - "iopub.status.idle": "2023-07-31T02:15:44.735051Z", - "shell.execute_reply": "2023-07-31T02:15:44.734749Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.128000Z", + "iopub.status.busy": "2023-08-06T17:35:54.127867Z", + "iopub.status.idle": "2023-08-06T17:35:54.130547Z", + "shell.execute_reply": "2023-08-06T17:35:54.130247Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1207,7 +1220,7 @@ ], "source": [ "a = np.array([1,2,8,-3])\n", - "np.cumsum(a)" + "np.cumsum(a)\n" ] }, { @@ -1226,7 +1239,7 @@ "components of the data. We use our scaled\n", "and centered `USArrests` data as $\\bf X$ below. The *singular value decomposition* \n", "(SVD) is a general algorithm for solving\n", - "(12.6)." + "(12.6). " ] }, { @@ -1235,11 +1248,12 @@ "id": "f83ad0bc", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.736580Z", - "iopub.status.busy": "2023-07-31T02:15:44.736478Z", - "iopub.status.idle": "2023-07-31T02:15:44.739101Z", - "shell.execute_reply": "2023-07-31T02:15:44.738830Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.132102Z", + "iopub.status.busy": "2023-08-06T17:35:54.131992Z", + "iopub.status.idle": "2023-08-06T17:35:54.134511Z", + "shell.execute_reply": "2023-08-06T17:35:54.134231Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1256,7 +1270,7 @@ "source": [ "X = USArrests_scaled\n", "U, D, V = np.linalg.svd(X, full_matrices=False)\n", - "U.shape, D.shape, V.shape" + "U.shape, D.shape, V.shape\n" ] }, { @@ -1275,10 +1289,10 @@ "id": "cb9bdc46", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.740634Z", - "iopub.status.busy": "2023-07-31T02:15:44.740515Z", - "iopub.status.idle": "2023-07-31T02:15:44.742822Z", - "shell.execute_reply": "2023-07-31T02:15:44.742562Z" + "iopub.execute_input": "2023-08-06T17:35:54.135963Z", + "iopub.status.busy": "2023-08-06T17:35:54.135871Z", + "iopub.status.idle": "2023-08-06T17:35:54.138169Z", + "shell.execute_reply": "2023-08-06T17:35:54.137815Z" } }, "outputs": [ @@ -1297,7 +1311,7 @@ } ], "source": [ - "V" + "V\n" ] }, { @@ -1306,11 +1320,12 @@ "id": "f23c101e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.744201Z", - "iopub.status.busy": "2023-07-31T02:15:44.744092Z", - "iopub.status.idle": "2023-07-31T02:15:44.746295Z", - "shell.execute_reply": "2023-07-31T02:15:44.746068Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.139741Z", + "iopub.status.busy": "2023-08-06T17:35:54.139635Z", + "iopub.status.idle": "2023-08-06T17:35:54.141804Z", + "shell.execute_reply": "2023-08-06T17:35:54.141560Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1328,7 +1343,7 @@ } ], "source": [ - "pcaUS.components_" + "pcaUS.components_\n" ] }, { @@ -1345,10 +1360,10 @@ "id": "4cc49622", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.747796Z", - "iopub.status.busy": "2023-07-31T02:15:44.747703Z", - "iopub.status.idle": "2023-07-31T02:15:44.750101Z", - "shell.execute_reply": "2023-07-31T02:15:44.749842Z" + "iopub.execute_input": "2023-08-06T17:35:54.143256Z", + "iopub.status.busy": "2023-08-06T17:35:54.143161Z", + "iopub.status.idle": "2023-08-06T17:35:54.145229Z", + "shell.execute_reply": "2023-08-06T17:35:54.144969Z" } }, "outputs": [ @@ -1366,7 +1381,7 @@ } ], "source": [ - "(U * D[None,:])[:3]" + "(U * D[None,:])[:3]\n" ] }, { @@ -1375,11 +1390,12 @@ "id": "c96c9fe1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.751617Z", - "iopub.status.busy": "2023-07-31T02:15:44.751510Z", - "iopub.status.idle": "2023-07-31T02:15:44.753664Z", - "shell.execute_reply": "2023-07-31T02:15:44.753419Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.146759Z", + "iopub.status.busy": "2023-08-06T17:35:54.146653Z", + "iopub.status.idle": "2023-08-06T17:35:54.148887Z", + "shell.execute_reply": "2023-08-06T17:35:54.148630Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1396,7 +1412,7 @@ } ], "source": [ - "scores[:3]" + "scores[:3]\n" ] }, { @@ -1419,10 +1435,10 @@ "id": "574409d6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.755144Z", - "iopub.status.busy": "2023-07-31T02:15:44.755024Z", - "iopub.status.idle": "2023-07-31T02:15:44.757455Z", - "shell.execute_reply": "2023-07-31T02:15:44.757198Z" + "iopub.execute_input": "2023-08-06T17:35:54.150348Z", + "iopub.status.busy": "2023-08-06T17:35:54.150251Z", + "iopub.status.idle": "2023-08-06T17:35:54.152569Z", + "shell.execute_reply": "2023-08-06T17:35:54.152331Z" } }, "outputs": [], @@ -1436,7 +1452,7 @@ " n_omit,\n", " replace=True)\n", "Xna = X.copy()\n", - "Xna[r_idx, c_idx] = np.nan" + "Xna[r_idx, c_idx] = np.nan\n" ] }, { @@ -1459,18 +1475,19 @@ "id": "89f190ae", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.758904Z", - "iopub.status.busy": "2023-07-31T02:15:44.758813Z", - "iopub.status.idle": "2023-07-31T02:15:44.760627Z", - "shell.execute_reply": "2023-07-31T02:15:44.760397Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.154068Z", + "iopub.status.busy": "2023-08-06T17:35:54.153976Z", + "iopub.status.idle": "2023-08-06T17:35:54.155943Z", + "shell.execute_reply": "2023-08-06T17:35:54.155667Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "def low_rank(X, M=1):\n", " U, D, V = np.linalg.svd(X)\n", " L = U[:,:M] * D[None,:M]\n", - " return L.dot(V[:M])" + " return L.dot(V[:M])\n" ] }, { @@ -1491,17 +1508,17 @@ "id": "322f339c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.762072Z", - "iopub.status.busy": "2023-07-31T02:15:44.761967Z", - "iopub.status.idle": "2023-07-31T02:15:44.763830Z", - "shell.execute_reply": "2023-07-31T02:15:44.763614Z" + "iopub.execute_input": "2023-08-06T17:35:54.157547Z", + "iopub.status.busy": "2023-08-06T17:35:54.157431Z", + "iopub.status.idle": "2023-08-06T17:35:54.159402Z", + "shell.execute_reply": "2023-08-06T17:35:54.159143Z" } }, "outputs": [], "source": [ "Xhat = Xna.copy()\n", "Xbar = np.nanmean(Xhat, axis=0)\n", - "Xhat[r_idx, c_idx] = Xbar[c_idx]" + "Xhat[r_idx, c_idx] = Xbar[c_idx]\n" ] }, { @@ -1519,11 +1536,12 @@ "id": "7e106d1a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.765257Z", - "iopub.status.busy": "2023-07-31T02:15:44.765166Z", - "iopub.status.idle": "2023-07-31T02:15:44.767082Z", - "shell.execute_reply": "2023-07-31T02:15:44.766829Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.160950Z", + "iopub.status.busy": "2023-08-06T17:35:54.160834Z", + "iopub.status.idle": "2023-08-06T17:35:54.162815Z", + "shell.execute_reply": "2023-08-06T17:35:54.162552Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -1532,7 +1550,7 @@ "count = 0\n", "ismiss = np.isnan(Xna)\n", "mssold = np.mean(Xhat[~ismiss]**2)\n", - "mss0 = np.mean(Xna[~ismiss]**2)" + "mss0 = np.mean(Xna[~ismiss]**2)\n" ] }, { @@ -1558,10 +1576,10 @@ "id": "7cb05ce4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.768575Z", - "iopub.status.busy": "2023-07-31T02:15:44.768471Z", - "iopub.status.idle": "2023-07-31T02:15:44.771807Z", - "shell.execute_reply": "2023-07-31T02:15:44.771537Z" + "iopub.execute_input": "2023-08-06T17:35:54.164360Z", + "iopub.status.busy": "2023-08-06T17:35:54.164263Z", + "iopub.status.idle": "2023-08-06T17:35:54.167306Z", + "shell.execute_reply": "2023-08-06T17:35:54.167033Z" } }, "outputs": [ @@ -1593,7 +1611,7 @@ " rel_err = (mssold - mss) / mss0\n", " mssold = mss\n", " print(\"Iteration: {0}, MSS:{1:.3f}, Rel.Err {2:.2e}\"\n", - " .format(count, mss, rel_err))" + " .format(count, mss, rel_err))\n" ] }, { @@ -1613,11 +1631,12 @@ "id": "6f245188", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.773365Z", - "iopub.status.busy": "2023-07-31T02:15:44.773280Z", - "iopub.status.idle": "2023-07-31T02:15:44.775827Z", - "shell.execute_reply": "2023-07-31T02:15:44.775546Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.168856Z", + "iopub.status.busy": "2023-08-06T17:35:54.168772Z", + "iopub.status.idle": "2023-08-06T17:35:54.171306Z", + "shell.execute_reply": "2023-08-06T17:35:54.171036Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1632,7 +1651,7 @@ } ], "source": [ - "np.corrcoef(Xapp[ismiss], X[ismiss])[0,1]" + "np.corrcoef(Xapp[ismiss], X[ismiss])[0,1]\n" ] }, { @@ -1670,18 +1689,19 @@ "id": "345fb41e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.777389Z", - "iopub.status.busy": "2023-07-31T02:15:44.777303Z", - "iopub.status.idle": "2023-07-31T02:15:44.779326Z", - "shell.execute_reply": "2023-07-31T02:15:44.779045Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.172898Z", + "iopub.status.busy": "2023-08-06T17:35:54.172820Z", + "iopub.status.idle": "2023-08-06T17:35:54.174844Z", + "shell.execute_reply": "2023-08-06T17:35:54.174573Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "np.random.seed(0);\n", "X = np.random.standard_normal((50,2));\n", "X[:25,0] += 3;\n", - "X[:25,1] -= 4;" + "X[:25,1] -= 4;\n" ] }, { @@ -1698,17 +1718,18 @@ "id": "3a8c21a2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:44.780749Z", - "iopub.status.busy": "2023-07-31T02:15:44.780675Z", - "iopub.status.idle": "2023-07-31T02:15:45.109432Z", - "shell.execute_reply": "2023-07-31T02:15:45.108830Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.176279Z", + "iopub.status.busy": "2023-08-06T17:35:54.176201Z", + "iopub.status.idle": "2023-08-06T17:35:54.490075Z", + "shell.execute_reply": "2023-08-06T17:35:54.489602Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "kmeans = KMeans(n_clusters=2,\n", " random_state=2,\n", - " n_init=20).fit(X)" + " n_init=20).fit(X)\n" ] }, { @@ -1725,11 +1746,12 @@ "id": "e3e35b5d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.111736Z", - "iopub.status.busy": "2023-07-31T02:15:45.111602Z", - "iopub.status.idle": "2023-07-31T02:15:45.114893Z", - "shell.execute_reply": "2023-07-31T02:15:45.114566Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.492349Z", + "iopub.status.busy": "2023-08-06T17:35:54.492209Z", + "iopub.status.idle": "2023-08-06T17:35:54.495557Z", + "shell.execute_reply": "2023-08-06T17:35:54.495020Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1746,7 +1768,7 @@ } ], "source": [ - "kmeans.labels_" + "kmeans.labels_\n" ] }, { @@ -1766,10 +1788,10 @@ "id": "d928650a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.116690Z", - "iopub.status.busy": "2023-07-31T02:15:45.116594Z", - "iopub.status.idle": "2023-07-31T02:15:45.227910Z", - "shell.execute_reply": "2023-07-31T02:15:45.227523Z" + "iopub.execute_input": "2023-08-06T17:35:54.497396Z", + "iopub.status.busy": "2023-08-06T17:35:54.497311Z", + "iopub.status.idle": "2023-08-06T17:35:54.605692Z", + "shell.execute_reply": "2023-08-06T17:35:54.605294Z" } }, "outputs": [ @@ -1787,7 +1809,7 @@ "source": [ "fig, ax = plt.subplots(1, 1, figsize=(8,8))\n", "ax.scatter(X[:,0], X[:,1], c=kmeans.labels_)\n", - "ax.set_title(\"K-Means Clustering Results with K=2\");" + "ax.set_title(\"K-Means Clustering Results with K=2\");\n" ] }, { @@ -1813,11 +1835,12 @@ "id": "92e5175c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.230054Z", - "iopub.status.busy": "2023-07-31T02:15:45.229932Z", - "iopub.status.idle": "2023-07-31T02:15:45.343327Z", - "shell.execute_reply": "2023-07-31T02:15:45.342951Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.608086Z", + "iopub.status.busy": "2023-08-06T17:35:54.607746Z", + "iopub.status.idle": "2023-08-06T17:35:54.725343Z", + "shell.execute_reply": "2023-08-06T17:35:54.725007Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1837,7 +1860,7 @@ " n_init=20).fit(X)\n", "fig, ax = plt.subplots(figsize=(8,8))\n", "ax.scatter(X[:,0], X[:,1], c=kmeans.labels_)\n", - "ax.set_title(\"K-Means Clustering Results with K=3\");" + "ax.set_title(\"K-Means Clustering Results with K=3\");\n" ] }, { @@ -1861,11 +1884,12 @@ "id": "4911ecc7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.345458Z", - "iopub.status.busy": "2023-07-31T02:15:45.345341Z", - "iopub.status.idle": "2023-07-31T02:15:45.358652Z", - "shell.execute_reply": "2023-07-31T02:15:45.358313Z" - } + "iopub.execute_input": "2023-08-06T17:35:54.727259Z", + "iopub.status.busy": "2023-08-06T17:35:54.727141Z", + "iopub.status.idle": "2023-08-06T17:35:54.742605Z", + "shell.execute_reply": "2023-08-06T17:35:54.742234Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1886,7 +1910,7 @@ "kmeans20 = KMeans(n_clusters=3,\n", " random_state=3,\n", " n_init=20).fit(X);\n", - "kmeans1.inertia_, kmeans20.inertia_" + "kmeans1.inertia_, kmeans20.inertia_\n" ] }, { @@ -1933,10 +1957,10 @@ "id": "1b42a700", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.360651Z", - "iopub.status.busy": "2023-07-31T02:15:45.360541Z", - "iopub.status.idle": "2023-07-31T02:15:45.366056Z", - "shell.execute_reply": "2023-07-31T02:15:45.365739Z" + "iopub.execute_input": "2023-08-06T17:35:54.745207Z", + "iopub.status.busy": "2023-08-06T17:35:54.744988Z", + "iopub.status.idle": "2023-08-06T17:35:54.750667Z", + "shell.execute_reply": "2023-08-06T17:35:54.750320Z" } }, "outputs": [ @@ -1962,7 +1986,7 @@ "hc_comp = HClust(distance_threshold=0,\n", " n_clusters=None,\n", " linkage='complete')\n", - "hc_comp.fit(X)" + "hc_comp.fit(X)\n" ] }, { @@ -1980,10 +2004,10 @@ "id": "50ef7eea", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.367837Z", - "iopub.status.busy": "2023-07-31T02:15:45.367733Z", - "iopub.status.idle": "2023-07-31T02:15:45.371125Z", - "shell.execute_reply": "2023-07-31T02:15:45.370797Z" + "iopub.execute_input": "2023-08-06T17:35:54.752542Z", + "iopub.status.busy": "2023-08-06T17:35:54.752422Z", + "iopub.status.idle": "2023-08-06T17:35:54.756021Z", + "shell.execute_reply": "2023-08-06T17:35:54.755609Z" } }, "outputs": [], @@ -1995,7 +2019,7 @@ "hc_sing = HClust(distance_threshold=0,\n", " n_clusters=None,\n", " linkage='single');\n", - "hc_sing.fit(X);" + "hc_sing.fit(X);\n" ] }, { @@ -2013,10 +2037,10 @@ "id": "bf7a2408", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.372859Z", - "iopub.status.busy": "2023-07-31T02:15:45.372770Z", - "iopub.status.idle": "2023-07-31T02:15:45.377578Z", - "shell.execute_reply": "2023-07-31T02:15:45.377273Z" + "iopub.execute_input": "2023-08-06T17:35:54.758124Z", + "iopub.status.busy": "2023-08-06T17:35:54.757853Z", + "iopub.status.idle": "2023-08-06T17:35:54.763112Z", + "shell.execute_reply": "2023-08-06T17:35:54.762785Z" } }, "outputs": [ @@ -2046,7 +2070,7 @@ " n_clusters=None,\n", " metric='precomputed',\n", " linkage='single')\n", - "hc_sing_pre.fit(D)" + "hc_sing_pre.fit(D)\n" ] }, { @@ -2073,10 +2097,10 @@ "id": "a118c0ab", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.379309Z", - "iopub.status.busy": "2023-07-31T02:15:45.379196Z", - "iopub.status.idle": "2023-07-31T02:15:45.604526Z", - "shell.execute_reply": "2023-07-31T02:15:45.604141Z" + "iopub.execute_input": "2023-08-06T17:35:54.764945Z", + "iopub.status.busy": "2023-08-06T17:35:54.764807Z", + "iopub.status.idle": "2023-08-06T17:35:54.996080Z", + "shell.execute_reply": "2023-08-06T17:35:54.995754Z" } }, "outputs": [ @@ -2098,7 +2122,7 @@ "fig, ax = plt.subplots(1, 1, figsize=(8, 8))\n", "dendrogram(linkage_comp,\n", " ax=ax,\n", - " **cargs);" + " **cargs);\n" ] }, { @@ -2118,10 +2142,10 @@ "id": "b1ff41c0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.606279Z", - "iopub.status.busy": "2023-07-31T02:15:45.606155Z", - "iopub.status.idle": "2023-07-31T02:15:45.829720Z", - "shell.execute_reply": "2023-07-31T02:15:45.829414Z" + "iopub.execute_input": "2023-08-06T17:35:54.998527Z", + "iopub.status.busy": "2023-08-06T17:35:54.998378Z", + "iopub.status.idle": "2023-08-06T17:35:55.224328Z", + "shell.execute_reply": "2023-08-06T17:35:55.224001Z" } }, "outputs": [ @@ -2141,7 +2165,7 @@ "dendrogram(linkage_comp,\n", " ax=ax,\n", " color_threshold=4,\n", - " above_threshold_color='black');" + " above_threshold_color='black');\n" ] }, { @@ -2160,10 +2184,10 @@ "id": "c2752a96", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.831473Z", - "iopub.status.busy": "2023-07-31T02:15:45.831358Z", - "iopub.status.idle": "2023-07-31T02:15:45.835095Z", - "shell.execute_reply": "2023-07-31T02:15:45.834802Z" + "iopub.execute_input": "2023-08-06T17:35:55.226138Z", + "iopub.status.busy": "2023-08-06T17:35:55.226012Z", + "iopub.status.idle": "2023-08-06T17:35:55.229625Z", + "shell.execute_reply": "2023-08-06T17:35:55.229330Z" } }, "outputs": [ @@ -2181,7 +2205,7 @@ } ], "source": [ - "cut_tree(linkage_comp, n_clusters=4).T" + "cut_tree(linkage_comp, n_clusters=4).T\n" ] }, { @@ -2202,10 +2226,10 @@ "id": "1407f7a4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.836612Z", - "iopub.status.busy": "2023-07-31T02:15:45.836515Z", - "iopub.status.idle": "2023-07-31T02:15:45.839886Z", - "shell.execute_reply": "2023-07-31T02:15:45.839587Z" + "iopub.execute_input": "2023-08-06T17:35:55.231139Z", + "iopub.status.busy": "2023-08-06T17:35:55.231047Z", + "iopub.status.idle": "2023-08-06T17:35:55.234414Z", + "shell.execute_reply": "2023-08-06T17:35:55.234103Z" } }, "outputs": [ @@ -2270,7 +2294,7 @@ } ], "source": [ - "cut_tree(linkage_comp, height=5)" + "cut_tree(linkage_comp, height=5)\n" ] }, { @@ -2288,10 +2312,10 @@ "id": "2d74f224", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:45.841445Z", - "iopub.status.busy": "2023-07-31T02:15:45.841337Z", - "iopub.status.idle": "2023-07-31T02:15:46.086770Z", - "shell.execute_reply": "2023-07-31T02:15:46.086434Z" + "iopub.execute_input": "2023-08-06T17:35:55.236000Z", + "iopub.status.busy": "2023-08-06T17:35:55.235892Z", + "iopub.status.idle": "2023-08-06T17:35:55.466992Z", + "shell.execute_reply": "2023-08-06T17:35:55.466654Z" } }, "outputs": [ @@ -2315,7 +2339,7 @@ "linkage_comp_scale = compute_linkage(hc_comp_scale)\n", "fig, ax = plt.subplots(1, 1, figsize=(8, 8))\n", "dendrogram(linkage_comp_scale, ax=ax, **cargs)\n", - "ax.set_title(\"Hierarchical Clustering with Scaled Features\");" + "ax.set_title(\"Hierarchical Clustering with Scaled Features\");\n" ] }, { @@ -2343,11 +2367,12 @@ "id": "b7f7da12", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.088532Z", - "iopub.status.busy": "2023-07-31T02:15:46.088413Z", - "iopub.status.idle": "2023-07-31T02:15:46.277686Z", - "shell.execute_reply": "2023-07-31T02:15:46.277383Z" - } + "iopub.execute_input": "2023-08-06T17:35:55.468711Z", + "iopub.status.busy": "2023-08-06T17:35:55.468585Z", + "iopub.status.idle": "2023-08-06T17:35:55.650076Z", + "shell.execute_reply": "2023-08-06T17:35:55.649676Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2372,7 +2397,7 @@ "linkage_cor = compute_linkage(hc_cor)\n", "fig, ax = plt.subplots(1, 1, figsize=(8, 8))\n", "dendrogram(linkage_cor, ax=ax, **cargs)\n", - "ax.set_title(\"Complete Linkage with Correlation-Based Dissimilarity\");" + "ax.set_title(\"Complete Linkage with Correlation-Based Dissimilarity\");\n" ] }, { @@ -2394,17 +2419,17 @@ "id": "b94424fc", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.279360Z", - "iopub.status.busy": "2023-07-31T02:15:46.279231Z", - "iopub.status.idle": "2023-07-31T02:15:46.285520Z", - "shell.execute_reply": "2023-07-31T02:15:46.285244Z" + "iopub.execute_input": "2023-08-06T17:35:55.651855Z", + "iopub.status.busy": "2023-08-06T17:35:55.651741Z", + "iopub.status.idle": "2023-08-06T17:35:55.658795Z", + "shell.execute_reply": "2023-08-06T17:35:55.658519Z" } }, "outputs": [], "source": [ "NCI60 = load_data('NCI60')\n", "nci_labs = NCI60['labels']\n", - "nci_data = NCI60['data']" + "nci_data = NCI60['data']\n" ] }, { @@ -2427,11 +2452,12 @@ "id": "cea54566", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.287328Z", - "iopub.status.busy": "2023-07-31T02:15:46.287220Z", - "iopub.status.idle": "2023-07-31T02:15:46.289574Z", - "shell.execute_reply": "2023-07-31T02:15:46.289308Z" - } + "iopub.execute_input": "2023-08-06T17:35:55.660436Z", + "iopub.status.busy": "2023-08-06T17:35:55.660347Z", + "iopub.status.idle": "2023-08-06T17:35:55.662725Z", + "shell.execute_reply": "2023-08-06T17:35:55.662438Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2446,7 +2472,7 @@ } ], "source": [ - "nci_data.shape" + "nci_data.shape\n" ] }, { @@ -2454,7 +2480,7 @@ "id": "6ebf27f1", "metadata": {}, "source": [ - "We begin by examining the cancer types for the cell lines." + "We begin by examining the cancer types for the cell lines.\n" ] }, { @@ -2463,11 +2489,12 @@ "id": "4dac41bb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.291057Z", - "iopub.status.busy": "2023-07-31T02:15:46.290960Z", - "iopub.status.idle": "2023-07-31T02:15:46.294539Z", - "shell.execute_reply": "2023-07-31T02:15:46.294249Z" - } + "iopub.execute_input": "2023-08-06T17:35:55.664308Z", + "iopub.status.busy": "2023-08-06T17:35:55.664169Z", + "iopub.status.idle": "2023-08-06T17:35:55.668246Z", + "shell.execute_reply": "2023-08-06T17:35:55.667892Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2497,7 +2524,7 @@ } ], "source": [ - "nci_labs.value_counts()" + "nci_labs.value_counts()\n" ] }, { @@ -2518,10 +2545,10 @@ "id": "d8ebadd6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.295958Z", - "iopub.status.busy": "2023-07-31T02:15:46.295878Z", - "iopub.status.idle": "2023-07-31T02:15:46.461104Z", - "shell.execute_reply": "2023-07-31T02:15:46.459544Z" + "iopub.execute_input": "2023-08-06T17:35:55.669892Z", + "iopub.status.busy": "2023-08-06T17:35:55.669796Z", + "iopub.status.idle": "2023-08-06T17:35:55.812837Z", + "shell.execute_reply": "2023-08-06T17:35:55.811884Z" } }, "outputs": [], @@ -2529,7 +2556,7 @@ "scaler = StandardScaler()\n", "nci_scaled = scaler.fit_transform(nci_data)\n", "nci_pca = PCA()\n", - "nci_scores = nci_pca.fit_transform(nci_scaled)" + "nci_scores = nci_pca.fit_transform(nci_scaled)\n" ] }, { @@ -2541,7 +2568,7 @@ "to visualize the data. The observations (cell lines) corresponding to\n", "a given cancer type will be plotted in the same color, so that we can\n", "see to what extent the observations within a cancer type are similar\n", - "to each other." + "to each other. " ] }, { @@ -2550,11 +2577,12 @@ "id": "63b5efe3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.465546Z", - "iopub.status.busy": "2023-07-31T02:15:46.465129Z", - "iopub.status.idle": "2023-07-31T02:15:46.678203Z", - "shell.execute_reply": "2023-07-31T02:15:46.677232Z" - } + "iopub.execute_input": "2023-08-06T17:35:55.818431Z", + "iopub.status.busy": "2023-08-06T17:35:55.818044Z", + "iopub.status.idle": "2023-08-06T17:35:56.078668Z", + "shell.execute_reply": "2023-08-06T17:35:56.078379Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2586,7 +2614,7 @@ " c=nci_groups,\n", " marker='o',\n", " s=50)\n", - "ax.set_xlabel('PC1'); ax.set_ylabel('PC3');" + "ax.set_xlabel('PC1'); ax.set_ylabel('PC3');\n" ] }, { @@ -2597,7 +2625,10 @@ "On the whole, cell lines corresponding to a single cancer type do tend to\n", "have similar values on the first few principal component score\n", "vectors. This indicates that cell lines from the same cancer type tend\n", - "to have pretty similar gene expression levels." + "to have pretty similar gene expression levels.\n", + "\n", + "\n", + " " ] }, { @@ -2616,11 +2647,12 @@ "id": "e20c3cc1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.684464Z", - "iopub.status.busy": "2023-07-31T02:15:46.683187Z", - "iopub.status.idle": "2023-07-31T02:15:46.840162Z", - "shell.execute_reply": "2023-07-31T02:15:46.839815Z" - } + "iopub.execute_input": "2023-08-06T17:35:56.080337Z", + "iopub.status.busy": "2023-08-06T17:35:56.080250Z", + "iopub.status.idle": "2023-08-06T17:35:56.227591Z", + "shell.execute_reply": "2023-08-06T17:35:56.227252Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2648,7 +2680,7 @@ " nci_pca.explained_variance_ratio_.cumsum(),\n", " marker='o');\n", "ax.set_xlabel('Principal Component')\n", - "ax.set_ylabel('Cumulative PVE');" + "ax.set_ylabel('Cumulative PVE');\n" ] }, { @@ -2688,10 +2720,10 @@ "id": "622de805", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.841987Z", - "iopub.status.busy": "2023-07-31T02:15:46.841869Z", - "iopub.status.idle": "2023-07-31T02:15:46.844428Z", - "shell.execute_reply": "2023-07-31T02:15:46.844159Z" + "iopub.execute_input": "2023-08-06T17:35:56.229339Z", + "iopub.status.busy": "2023-08-06T17:35:56.229217Z", + "iopub.status.idle": "2023-08-06T17:35:56.231787Z", + "shell.execute_reply": "2023-08-06T17:35:56.231485Z" } }, "outputs": [], @@ -2709,7 +2741,7 @@ " leaf_font_size=10,\n", " **cargs)\n", " ax.set_title('%s Linkage' % linkage)\n", - " return hc" + " return hc\n" ] }, { @@ -2726,11 +2758,12 @@ "id": "54d40449", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:46.845994Z", - "iopub.status.busy": "2023-07-31T02:15:46.845893Z", - "iopub.status.idle": "2023-07-31T02:15:48.160927Z", - "shell.execute_reply": "2023-07-31T02:15:48.160624Z" - } + "iopub.execute_input": "2023-08-06T17:35:56.233590Z", + "iopub.status.busy": "2023-08-06T17:35:56.233477Z", + "iopub.status.idle": "2023-08-06T17:35:57.584097Z", + "shell.execute_reply": "2023-08-06T17:35:57.583812Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2748,7 +2781,7 @@ "fig, axes = plt.subplots(3, 1, figsize=(15,30)) \n", "ax = axes[0]; hc_comp = plot_nci('Complete', ax)\n", "ax = axes[1]; hc_avg = plot_nci('Average', ax)\n", - "ax = axes[2]; hc_sing = plot_nci('Single', ax)" + "ax = axes[2]; hc_sing = plot_nci('Single', ax)\n" ] }, { @@ -2778,11 +2811,12 @@ "id": "dc80afc8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:48.162702Z", - "iopub.status.busy": "2023-07-31T02:15:48.162595Z", - "iopub.status.idle": "2023-07-31T02:15:48.173866Z", - "shell.execute_reply": "2023-07-31T02:15:48.173467Z" - } + "iopub.execute_input": "2023-08-06T17:35:57.585856Z", + "iopub.status.busy": "2023-08-06T17:35:57.585741Z", + "iopub.status.idle": "2023-08-06T17:35:57.597998Z", + "shell.execute_reply": "2023-08-06T17:35:57.597730Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2950,7 +2984,7 @@ "linkage_comp = compute_linkage(hc_comp)\n", "comp_cut = cut_tree(linkage_comp, n_clusters=4).reshape(-1)\n", "pd.crosstab(nci_labs['label'],\n", - " pd.Series(comp_cut.reshape(-1), name='Complete'))" + " pd.Series(comp_cut.reshape(-1), name='Complete'))\n" ] }, { @@ -2971,10 +3005,10 @@ "id": "40ff59f9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:48.175506Z", - "iopub.status.busy": "2023-07-31T02:15:48.175383Z", - "iopub.status.idle": "2023-07-31T02:15:48.588803Z", - "shell.execute_reply": "2023-07-31T02:15:48.588494Z" + "iopub.execute_input": "2023-08-06T17:35:57.599540Z", + "iopub.status.busy": "2023-08-06T17:35:57.599448Z", + "iopub.status.idle": "2023-08-06T17:35:58.032539Z", + "shell.execute_reply": "2023-08-06T17:35:58.032140Z" } }, "outputs": [ @@ -2992,7 +3026,7 @@ "source": [ "fig, ax = plt.subplots(figsize=(10,10))\n", "plot_nci('Complete', ax, cut=140)\n", - "ax.axhline(140, c='r', linewidth=4);" + "ax.axhline(140, c='r', linewidth=4);\n" ] }, { @@ -3020,10 +3054,10 @@ "id": "1587e83b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:48.590478Z", - "iopub.status.busy": "2023-07-31T02:15:48.590373Z", - "iopub.status.idle": "2023-07-31T02:15:48.959939Z", - "shell.execute_reply": "2023-07-31T02:15:48.959090Z" + "iopub.execute_input": "2023-08-06T17:35:58.034342Z", + "iopub.status.busy": "2023-08-06T17:35:58.034213Z", + "iopub.status.idle": "2023-08-06T17:35:58.251720Z", + "shell.execute_reply": "2023-08-06T17:35:58.251045Z" } }, "outputs": [ @@ -3113,7 +3147,7 @@ " random_state=0,\n", " n_init=20).fit(nci_scaled)\n", "pd.crosstab(pd.Series(comp_cut, name='HClust'),\n", - " pd.Series(nci_kmeans.labels_, name='K-means'))" + " pd.Series(nci_kmeans.labels_, name='K-means'))\n" ] }, { @@ -3145,11 +3179,12 @@ "id": "b09ceeab", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:48.964377Z", - "iopub.status.busy": "2023-07-31T02:15:48.963942Z", - "iopub.status.idle": "2023-07-31T02:15:49.459064Z", - "shell.execute_reply": "2023-07-31T02:15:49.458783Z" - } + "iopub.execute_input": "2023-08-06T17:35:58.255255Z", + "iopub.status.busy": "2023-08-06T17:35:58.254701Z", + "iopub.status.idle": "2023-08-06T17:35:58.741393Z", + "shell.execute_reply": "2023-08-06T17:35:58.741038Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3339,15 +3374,26 @@ "pca_labels = pd.Series(cut_tree(linkage_pca,\n", " n_clusters=4).reshape(-1),\n", " name='Complete-PCA')\n", - "pd.crosstab(nci_labs['label'], pca_labels)" + "pd.crosstab(nci_labs['label'], pca_labels)\n" + ] + }, + { + "cell_type": "markdown", + "id": "5e1733b5", + "metadata": {}, + "source": [ + "\n", + " \n", + " \n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch13-multiple-lab.ipynb b/Ch13-multiple-lab.ipynb index 709bfaa..83fad7d 100644 --- a/Ch13-multiple-lab.ipynb +++ b/Ch13-multiple-lab.ipynb @@ -5,9 +5,11 @@ "id": "75b2d75c", "metadata": {}, "source": [ + "\n", "# Chapter 13\n", "\n", - "# Lab: Multiple Testing" + "# Lab: Multiple Testing\n", + " " ] }, { @@ -24,10 +26,10 @@ "id": "1f928b2d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:50.715151Z", - "iopub.status.busy": "2023-07-31T02:15:50.714766Z", - "iopub.status.idle": "2023-07-31T02:15:51.778071Z", - "shell.execute_reply": "2023-07-31T02:15:51.777549Z" + "iopub.execute_input": "2023-08-06T17:36:00.152825Z", + "iopub.status.busy": "2023-08-06T17:36:00.151975Z", + "iopub.status.idle": "2023-08-06T17:36:01.254245Z", + "shell.execute_reply": "2023-08-06T17:36:01.253710Z" } }, "outputs": [], @@ -36,7 +38,7 @@ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import statsmodels.api as sm\n", - "from ISLP import load_data" + "from ISLP import load_data\n" ] }, { @@ -54,11 +56,12 @@ "id": "eb4b32aa", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.780386Z", - "iopub.status.busy": "2023-07-31T02:15:51.780091Z", - "iopub.status.idle": "2023-07-31T02:15:51.782579Z", - "shell.execute_reply": "2023-07-31T02:15:51.782295Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.256495Z", + "iopub.status.busy": "2023-08-06T17:36:01.256216Z", + "iopub.status.idle": "2023-08-06T17:36:01.258709Z", + "shell.execute_reply": "2023-08-06T17:36:01.258467Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ @@ -70,7 +73,7 @@ "from statsmodels.stats.multicomp import \\\n", " pairwise_tukeyhsd\n", "from statsmodels.stats.multitest import \\\n", - " multipletests as mult_test" + " multipletests as mult_test\n" ] }, { @@ -92,10 +95,10 @@ "id": "e12ac0cd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.784074Z", - "iopub.status.busy": "2023-07-31T02:15:51.783969Z", - "iopub.status.idle": "2023-07-31T02:15:51.786285Z", - "shell.execute_reply": "2023-07-31T02:15:51.786035Z" + "iopub.execute_input": "2023-08-06T17:36:01.260260Z", + "iopub.status.busy": "2023-08-06T17:36:01.260153Z", + "iopub.status.idle": "2023-08-06T17:36:01.262414Z", + "shell.execute_reply": "2023-08-06T17:36:01.262174Z" } }, "outputs": [], @@ -103,7 +106,7 @@ "rng = np.random.default_rng(12)\n", "X = rng.standard_normal((10, 100))\n", "true_mean = np.array([0.5]*50 + [0]*50)\n", - "X += true_mean[None,:]" + "X += true_mean[None,:]\n" ] }, { @@ -122,10 +125,10 @@ "id": "04d0f49e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.787724Z", - "iopub.status.busy": "2023-07-31T02:15:51.787627Z", - "iopub.status.idle": "2023-07-31T02:15:51.791755Z", - "shell.execute_reply": "2023-07-31T02:15:51.791495Z" + "iopub.execute_input": "2023-08-06T17:36:01.263887Z", + "iopub.status.busy": "2023-08-06T17:36:01.263792Z", + "iopub.status.idle": "2023-08-06T17:36:01.267718Z", + "shell.execute_reply": "2023-08-06T17:36:01.267462Z" } }, "outputs": [ @@ -142,7 +145,7 @@ ], "source": [ "result = ttest_1samp(X[:,0], 0)\n", - "result.pvalue" + "result.pvalue\n" ] }, { @@ -169,11 +172,12 @@ "id": "d1f0c695", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.793305Z", - "iopub.status.busy": "2023-07-31T02:15:51.793226Z", - "iopub.status.idle": "2023-07-31T02:15:51.815977Z", - "shell.execute_reply": "2023-07-31T02:15:51.815697Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.269204Z", + "iopub.status.busy": "2023-08-06T17:36:01.269116Z", + "iopub.status.idle": "2023-08-06T17:36:01.292380Z", + "shell.execute_reply": "2023-08-06T17:36:01.292124Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -186,7 +190,7 @@ " 'Do not reject H0'])\n", "truth = pd.Categorical(true_mean == 0,\n", " categories=[True, False],\n", - " ordered=True)" + " ordered=True)\n" ] }, { @@ -204,11 +208,12 @@ "id": "7a9594a0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.817571Z", - "iopub.status.busy": "2023-07-31T02:15:51.817485Z", - "iopub.status.idle": "2023-07-31T02:15:51.826998Z", - "shell.execute_reply": "2023-07-31T02:15:51.826728Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.293910Z", + "iopub.status.busy": "2023-08-06T17:36:01.293823Z", + "iopub.status.idle": "2023-08-06T17:36:01.302891Z", + "shell.execute_reply": "2023-08-06T17:36:01.302612Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -272,7 +277,7 @@ "pd.crosstab(decision,\n", " truth,\n", " rownames=['Decision'],\n", - " colnames=['H0'])" + " colnames=['H0'])\n" ] }, { @@ -294,7 +299,7 @@ "amounts to quite a weak signal, and it resulted in a high number of\n", "Type II errors. Let’s instead simulate data with a stronger signal,\n", "so that the ratio of the mean to the standard deviation for the false\n", - "null hypotheses equals $1$. We make only 10 Type II errors." + "null hypotheses equals $1$. We make only 10 Type II errors.\n" ] }, { @@ -303,11 +308,12 @@ "id": "25f7fc5d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.828557Z", - "iopub.status.busy": "2023-07-31T02:15:51.828471Z", - "iopub.status.idle": "2023-07-31T02:15:51.857144Z", - "shell.execute_reply": "2023-07-31T02:15:51.856863Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.304398Z", + "iopub.status.busy": "2023-08-06T17:36:01.304317Z", + "iopub.status.idle": "2023-08-06T17:36:01.331987Z", + "shell.execute_reply": "2023-08-06T17:36:01.331720Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -383,7 +389,15 @@ "pd.crosstab(decision,\n", " truth,\n", " rownames=['Decision'],\n", - " colnames=['H0'])" + " colnames=['H0'])\n" + ] + }, + { + "cell_type": "markdown", + "id": "bb70c597", + "metadata": {}, + "source": [ + " " ] }, { @@ -406,10 +420,10 @@ "id": "369b5bd3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:51.858641Z", - "iopub.status.busy": "2023-07-31T02:15:51.858551Z", - "iopub.status.idle": "2023-07-31T02:15:52.158944Z", - "shell.execute_reply": "2023-07-31T02:15:52.158640Z" + "iopub.execute_input": "2023-08-06T17:36:01.333446Z", + "iopub.status.busy": "2023-08-06T17:36:01.333362Z", + "iopub.status.idle": "2023-08-06T17:36:01.583878Z", + "shell.execute_reply": "2023-08-06T17:36:01.583084Z" } }, "outputs": [ @@ -435,7 +449,7 @@ "ax.set_xlabel('Number of Hypotheses')\n", "ax.set_ylabel('Family-Wise Error Rate')\n", "ax.legend()\n", - "ax.axhline(0.05, c='k', ls='--');" + "ax.axhline(0.05, c='k', ls='--');\n" ] }, { @@ -462,10 +476,10 @@ "id": "9ce7a19f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.160608Z", - "iopub.status.busy": "2023-07-31T02:15:52.160488Z", - "iopub.status.idle": "2023-07-31T02:15:52.198900Z", - "shell.execute_reply": "2023-07-31T02:15:52.198590Z" + "iopub.execute_input": "2023-08-06T17:36:01.592359Z", + "iopub.status.busy": "2023-08-06T17:36:01.591524Z", + "iopub.status.idle": "2023-08-06T17:36:01.636450Z", + "shell.execute_reply": "2023-08-06T17:36:01.636160Z" } }, "outputs": [ @@ -486,7 +500,7 @@ "fund_mini_pvals = np.empty(5)\n", "for i in range(5):\n", " fund_mini_pvals[i] = ttest_1samp(fund_mini.iloc[:,i], 0).pvalue\n", - "fund_mini_pvals" + "fund_mini_pvals\n" ] }, { @@ -530,11 +544,12 @@ "id": "de6cffed", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.200735Z", - "iopub.status.busy": "2023-07-31T02:15:52.200617Z", - "iopub.status.idle": "2023-07-31T02:15:52.202992Z", - "shell.execute_reply": "2023-07-31T02:15:52.202738Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.638004Z", + "iopub.status.busy": "2023-08-06T17:36:01.637923Z", + "iopub.status.idle": "2023-08-06T17:36:01.640151Z", + "shell.execute_reply": "2023-08-06T17:36:01.639891Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -550,7 +565,7 @@ ], "source": [ "reject, bonf = mult_test(fund_mini_pvals, method = \"bonferroni\")[:2]\n", - "reject" + "reject\n" ] }, { @@ -568,10 +583,10 @@ "id": "0de71500", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.204499Z", - "iopub.status.busy": "2023-07-31T02:15:52.204407Z", - "iopub.status.idle": "2023-07-31T02:15:52.206753Z", - "shell.execute_reply": "2023-07-31T02:15:52.206498Z" + "iopub.execute_input": "2023-08-06T17:36:01.641646Z", + "iopub.status.busy": "2023-08-06T17:36:01.641554Z", + "iopub.status.idle": "2023-08-06T17:36:01.643766Z", + "shell.execute_reply": "2023-08-06T17:36:01.643529Z" } }, "outputs": [ @@ -588,7 +603,7 @@ } ], "source": [ - "bonf, np.minimum(fund_mini_pvals * 5, 1)" + "bonf, np.minimum(fund_mini_pvals * 5, 1)\n" ] }, { @@ -610,11 +625,12 @@ "id": "f7e87bdb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.208134Z", - "iopub.status.busy": "2023-07-31T02:15:52.208036Z", - "iopub.status.idle": "2023-07-31T02:15:52.255948Z", - "shell.execute_reply": "2023-07-31T02:15:52.255602Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.645254Z", + "iopub.status.busy": "2023-08-06T17:36:01.645162Z", + "iopub.status.idle": "2023-08-06T17:36:01.687110Z", + "shell.execute_reply": "2023-08-06T17:36:01.686827Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -630,7 +646,7 @@ } ], "source": [ - "mult_test(fund_mini_pvals, method = \"holm\", alpha=0.05)[:2]" + "mult_test(fund_mini_pvals, method = \"holm\", alpha=0.05)[:2]\n" ] }, { @@ -648,11 +664,12 @@ "id": "e88be376", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.257656Z", - "iopub.status.busy": "2023-07-31T02:15:52.257540Z", - "iopub.status.idle": "2023-07-31T02:15:52.260759Z", - "shell.execute_reply": "2023-07-31T02:15:52.260443Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.688627Z", + "iopub.status.busy": "2023-08-06T17:36:01.688527Z", + "iopub.status.idle": "2023-08-06T17:36:01.691393Z", + "shell.execute_reply": "2023-08-06T17:36:01.691161Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -672,7 +689,7 @@ } ], "source": [ - "fund_mini.mean()" + "fund_mini.mean()\n" ] }, { @@ -691,10 +708,10 @@ "id": "41149af6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.262161Z", - "iopub.status.busy": "2023-07-31T02:15:52.262063Z", - "iopub.status.idle": "2023-07-31T02:15:52.264821Z", - "shell.execute_reply": "2023-07-31T02:15:52.264573Z" + "iopub.execute_input": "2023-08-06T17:36:01.692844Z", + "iopub.status.busy": "2023-08-06T17:36:01.692751Z", + "iopub.status.idle": "2023-08-06T17:36:01.695119Z", + "shell.execute_reply": "2023-08-06T17:36:01.694881Z" } }, "outputs": [ @@ -711,7 +728,7 @@ ], "source": [ "ttest_rel(fund_mini['Manager1'],\n", - " fund_mini['Manager2']).pvalue" + " fund_mini['Manager2']).pvalue\n" ] }, { @@ -743,11 +760,12 @@ "id": "61aabda7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.266290Z", - "iopub.status.busy": "2023-07-31T02:15:52.266197Z", - "iopub.status.idle": "2023-07-31T02:15:52.746435Z", - "shell.execute_reply": "2023-07-31T02:15:52.746118Z" - } + "iopub.execute_input": "2023-08-06T17:36:01.696563Z", + "iopub.status.busy": "2023-08-06T17:36:01.696465Z", + "iopub.status.idle": "2023-08-06T17:36:02.177873Z", + "shell.execute_reply": "2023-08-06T17:36:02.177587Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -776,7 +794,7 @@ "returns = np.hstack([fund_mini.iloc[:,i] for i in range(5)])\n", "managers = np.hstack([[i+1]*50 for i in range(5)])\n", "tukey = pairwise_tukeyhsd(returns, managers)\n", - "print(tukey.summary())" + "print(tukey.summary())\n" ] }, { @@ -802,10 +820,10 @@ "id": "cbcad4de", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.748078Z", - "iopub.status.busy": "2023-07-31T02:15:52.747975Z", - "iopub.status.idle": "2023-07-31T02:15:52.829340Z", - "shell.execute_reply": "2023-07-31T02:15:52.829068Z" + "iopub.execute_input": "2023-08-06T17:36:02.179444Z", + "iopub.status.busy": "2023-08-06T17:36:02.179343Z", + "iopub.status.idle": "2023-08-06T17:36:02.260168Z", + "shell.execute_reply": "2023-08-06T17:36:02.259865Z" } }, "outputs": [ @@ -822,7 +840,7 @@ ], "source": [ "fig, ax = plt.subplots(figsize=(8,8))\n", - "tukey.plot_simultaneous(ax=ax);" + "tukey.plot_simultaneous(ax=ax);\n" ] }, { @@ -843,17 +861,17 @@ "id": "b5842190", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:52.831064Z", - "iopub.status.busy": "2023-07-31T02:15:52.830953Z", - "iopub.status.idle": "2023-07-31T02:15:53.237615Z", - "shell.execute_reply": "2023-07-31T02:15:53.237218Z" + "iopub.execute_input": "2023-08-06T17:36:02.261922Z", + "iopub.status.busy": "2023-08-06T17:36:02.261817Z", + "iopub.status.idle": "2023-08-06T17:36:02.675908Z", + "shell.execute_reply": "2023-08-06T17:36:02.675505Z" } }, "outputs": [], "source": [ "fund_pvalues = np.empty(2000)\n", "for i, manager in enumerate(Fund.columns):\n", - " fund_pvalues[i] = ttest_1samp(Fund[manager], 0).pvalue" + " fund_pvalues[i] = ttest_1samp(Fund[manager], 0).pvalue\n" ] }, { @@ -872,10 +890,10 @@ "id": "7c9d8bed", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.239456Z", - "iopub.status.busy": "2023-07-31T02:15:53.239345Z", - "iopub.status.idle": "2023-07-31T02:15:53.242247Z", - "shell.execute_reply": "2023-07-31T02:15:53.241963Z" + "iopub.execute_input": "2023-08-06T17:36:02.677787Z", + "iopub.status.busy": "2023-08-06T17:36:02.677666Z", + "iopub.status.idle": "2023-08-06T17:36:02.680351Z", + "shell.execute_reply": "2023-08-06T17:36:02.680097Z" } }, "outputs": [ @@ -893,7 +911,7 @@ ], "source": [ "fund_qvalues = mult_test(fund_pvalues, method = \"fdr_bh\")[1]\n", - "fund_qvalues[:10]" + "fund_qvalues[:10]\n" ] }, { @@ -917,11 +935,12 @@ "id": "bfa39f7c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.243699Z", - "iopub.status.busy": "2023-07-31T02:15:53.243594Z", - "iopub.status.idle": "2023-07-31T02:15:53.245817Z", - "shell.execute_reply": "2023-07-31T02:15:53.245569Z" - } + "iopub.execute_input": "2023-08-06T17:36:02.681878Z", + "iopub.status.busy": "2023-08-06T17:36:02.681776Z", + "iopub.status.idle": "2023-08-06T17:36:02.684078Z", + "shell.execute_reply": "2023-08-06T17:36:02.683782Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -936,7 +955,7 @@ } ], "source": [ - "(fund_qvalues <= 0.1).sum()" + "(fund_qvalues <= 0.1).sum()\n" ] }, { @@ -960,11 +979,12 @@ "id": "70b69b47", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.247278Z", - "iopub.status.busy": "2023-07-31T02:15:53.247171Z", - "iopub.status.idle": "2023-07-31T02:15:53.249292Z", - "shell.execute_reply": "2023-07-31T02:15:53.249050Z" - } + "iopub.execute_input": "2023-08-06T17:36:02.685580Z", + "iopub.status.busy": "2023-08-06T17:36:02.685487Z", + "iopub.status.idle": "2023-08-06T17:36:02.687581Z", + "shell.execute_reply": "2023-08-06T17:36:02.687313Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -979,7 +999,7 @@ } ], "source": [ - "(fund_pvalues <= 0.1 / 2000).sum()" + "(fund_pvalues <= 0.1 / 2000).sum()\n" ] }, { @@ -1009,10 +1029,10 @@ "id": "4c0ddea1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.250720Z", - "iopub.status.busy": "2023-07-31T02:15:53.250626Z", - "iopub.status.idle": "2023-07-31T02:15:53.253039Z", - "shell.execute_reply": "2023-07-31T02:15:53.252775Z" + "iopub.execute_input": "2023-08-06T17:36:02.689041Z", + "iopub.status.busy": "2023-08-06T17:36:02.688941Z", + "iopub.status.idle": "2023-08-06T17:36:02.691386Z", + "shell.execute_reply": "2023-08-06T17:36:02.691129Z" } }, "outputs": [], @@ -1026,7 +1046,7 @@ " sorted_set_ = np.arange(sorted_set_.max())\n", "else:\n", " selected_ = []\n", - " sorted_set_ = []" + " sorted_set_ = []\n" ] }, { @@ -1043,11 +1063,12 @@ "id": "0314eac9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.254539Z", - "iopub.status.busy": "2023-07-31T02:15:53.254447Z", - "iopub.status.idle": "2023-07-31T02:15:53.487410Z", - "shell.execute_reply": "2023-07-31T02:15:53.487100Z" - } + "iopub.execute_input": "2023-08-06T17:36:02.692825Z", + "iopub.status.busy": "2023-08-06T17:36:02.692729Z", + "iopub.status.idle": "2023-08-06T17:36:02.922587Z", + "shell.execute_reply": "2023-08-06T17:36:02.922278Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1070,7 +1091,7 @@ "ax.set_ylabel('P-Value')\n", "ax.set_xlabel('Index')\n", "ax.scatter(sorted_set_+1, sorted_[sorted_set_], c='r', s=20)\n", - "ax.axline((0, 0), (1,q/m), c='k', ls='--', linewidth=3);" + "ax.axline((0, 0), (1,q/m), c='k', ls='--', linewidth=3);\n" ] }, { @@ -1092,11 +1113,12 @@ "id": "b59b8137", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.489154Z", - "iopub.status.busy": "2023-07-31T02:15:53.489039Z", - "iopub.status.idle": "2023-07-31T02:15:53.563916Z", - "shell.execute_reply": "2023-07-31T02:15:53.563610Z" - } + "iopub.execute_input": "2023-08-06T17:36:02.924316Z", + "iopub.status.busy": "2023-08-06T17:36:02.924196Z", + "iopub.status.idle": "2023-08-06T17:36:02.997644Z", + "shell.execute_reply": "2023-08-06T17:36:02.997332Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1118,7 +1140,7 @@ "Khan = load_data('Khan') \n", "D = pd.concat([Khan['xtrain'], Khan['xtest']])\n", "D['Y'] = pd.concat([Khan['ytrain'], Khan['ytest']])\n", - "D['Y'].value_counts()" + "D['Y'].value_counts()\n" ] }, { @@ -1142,11 +1164,12 @@ "id": "96fb2f61", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.565515Z", - "iopub.status.busy": "2023-07-31T02:15:53.565402Z", - "iopub.status.idle": "2023-07-31T02:15:53.569018Z", - "shell.execute_reply": "2023-07-31T02:15:53.568748Z" - } + "iopub.execute_input": "2023-08-06T17:36:02.999309Z", + "iopub.status.busy": "2023-08-06T17:36:02.999199Z", + "iopub.status.idle": "2023-08-06T17:36:03.003203Z", + "shell.execute_reply": "2023-08-06T17:36:03.002963Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1167,7 +1190,7 @@ "observedT, pvalue = ttest_ind(D2[gene_11],\n", " D4[gene_11],\n", " equal_var=True)\n", - "observedT, pvalue" + "observedT, pvalue\n" ] }, { @@ -1194,11 +1217,12 @@ "id": "fdc229fa", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:53.570437Z", - "iopub.status.busy": "2023-07-31T02:15:53.570359Z", - "iopub.status.idle": "2023-07-31T02:15:55.953846Z", - "shell.execute_reply": "2023-07-31T02:15:55.953572Z" - } + "iopub.execute_input": "2023-08-06T17:36:03.004671Z", + "iopub.status.busy": "2023-08-06T17:36:03.004588Z", + "iopub.status.idle": "2023-08-06T17:36:05.379699Z", + "shell.execute_reply": "2023-08-06T17:36:05.379380Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1224,7 +1248,7 @@ " D_null[n_:],\n", " equal_var=True)\n", " Tnull[b] = ttest_.statistic\n", - "(np.abs(Tnull) > np.abs(observedT)).mean()" + "(np.abs(Tnull) > np.abs(observedT)).mean()\n" ] }, { @@ -1244,11 +1268,12 @@ "id": "e3894695", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:55.955682Z", - "iopub.status.busy": "2023-07-31T02:15:55.955570Z", - "iopub.status.idle": "2023-07-31T02:15:56.168609Z", - "shell.execute_reply": "2023-07-31T02:15:56.168280Z" - } + "iopub.execute_input": "2023-08-06T17:36:05.381564Z", + "iopub.status.busy": "2023-08-06T17:36:05.381435Z", + "iopub.status.idle": "2023-08-06T17:36:05.597223Z", + "shell.execute_reply": "2023-08-06T17:36:05.596880Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1277,7 +1302,7 @@ " c='b',\n", " label='Observed')\n", "ax.legend()\n", - "ax.set_xlabel(\"Null Distribution of Test Statistic\");" + "ax.set_xlabel(\"Null Distribution of Test Statistic\");\n" ] }, { @@ -1303,10 +1328,10 @@ "id": "3b7392cb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:56.170411Z", - "iopub.status.busy": "2023-07-31T02:15:56.170304Z", - "iopub.status.idle": "2023-07-31T02:19:52.282774Z", - "shell.execute_reply": "2023-07-31T02:19:52.282319Z" + "iopub.execute_input": "2023-08-06T17:36:05.599334Z", + "iopub.status.busy": "2023-08-06T17:36:05.599205Z", + "iopub.status.idle": "2023-08-06T17:40:01.929123Z", + "shell.execute_reply": "2023-08-06T17:40:01.928341Z" } }, "outputs": [], @@ -1328,7 +1353,7 @@ " ttest_ = ttest_ind(D_null[:n_],\n", " D_null[n_:],\n", " equal_var=True)\n", - " Tnull_vals[j,b] = ttest_.statistic" + " Tnull_vals[j,b] = ttest_.statistic\n" ] }, { @@ -1349,10 +1374,10 @@ "id": "cac15616", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:52.285179Z", - "iopub.status.busy": "2023-07-31T02:19:52.285030Z", - "iopub.status.idle": "2023-07-31T02:19:52.430820Z", - "shell.execute_reply": "2023-07-31T02:19:52.430483Z" + "iopub.execute_input": "2023-08-06T17:40:01.931393Z", + "iopub.status.busy": "2023-08-06T17:40:01.931250Z", + "iopub.status.idle": "2023-08-06T17:40:02.050525Z", + "shell.execute_reply": "2023-08-06T17:40:02.050215Z" } }, "outputs": [], @@ -1364,7 +1389,7 @@ " V = np.sum(np.abs(Tnull_vals) >= cutoffs[j]) / B\n", " Rs[j] = R\n", " Vs[j] = V\n", - " FDRs[j] = V / R" + " FDRs[j] = V / R\n" ] }, { @@ -1390,10 +1415,10 @@ "id": "9661eb10", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:52.432747Z", - "iopub.status.busy": "2023-07-31T02:19:52.432615Z", - "iopub.status.idle": "2023-07-31T02:19:52.435385Z", - "shell.execute_reply": "2023-07-31T02:19:52.435090Z" + "iopub.execute_input": "2023-08-06T17:40:02.052324Z", + "iopub.status.busy": "2023-08-06T17:40:02.052224Z", + "iopub.status.idle": "2023-08-06T17:40:02.054968Z", + "shell.execute_reply": "2023-08-06T17:40:02.054729Z" } }, "outputs": [ @@ -1427,7 +1452,7 @@ } ], "source": [ - "sorted(idx[np.abs(T_vals) >= cutoffs[FDRs < 0.1].min()])" + "sorted(idx[np.abs(T_vals) >= cutoffs[FDRs < 0.1].min()])\n" ] }, { @@ -1445,10 +1470,10 @@ "id": "18ad4900", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:52.436985Z", - "iopub.status.busy": "2023-07-31T02:19:52.436868Z", - "iopub.status.idle": "2023-07-31T02:19:52.439478Z", - "shell.execute_reply": "2023-07-31T02:19:52.439213Z" + "iopub.execute_input": "2023-08-06T17:40:02.056480Z", + "iopub.status.busy": "2023-08-06T17:40:02.056382Z", + "iopub.status.idle": "2023-08-06T17:40:02.058766Z", + "shell.execute_reply": "2023-08-06T17:40:02.058503Z" } }, "outputs": [ @@ -1494,7 +1519,7 @@ } ], "source": [ - "sorted(idx[np.abs(T_vals) >= cutoffs[FDRs < 0.2].min()])" + "sorted(idx[np.abs(T_vals) >= cutoffs[FDRs < 0.2].min()])\n" ] }, { @@ -1513,11 +1538,12 @@ "id": "28c276b6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:52.441008Z", - "iopub.status.busy": "2023-07-31T02:19:52.440893Z", - "iopub.status.idle": "2023-07-31T02:19:52.515423Z", - "shell.execute_reply": "2023-07-31T02:19:52.515126Z" - } + "iopub.execute_input": "2023-08-06T17:40:02.060234Z", + "iopub.status.busy": "2023-08-06T17:40:02.060135Z", + "iopub.status.idle": "2023-08-06T17:40:02.135583Z", + "shell.execute_reply": "2023-08-06T17:40:02.135228Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1535,15 +1561,23 @@ "fig, ax = plt.subplots()\n", "ax.plot(Rs, FDRs, 'b', linewidth=3)\n", "ax.set_xlabel(\"Number of Rejections\")\n", - "ax.set_ylabel(\"False Discovery Rate\");" + "ax.set_ylabel(\"False Discovery Rate\");\n" + ] + }, + { + "cell_type": "markdown", + "id": "e4b5d621", + "metadata": {}, + "source": [ + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch2-statlearn-lab.ipynb b/Ch2-statlearn-lab.ipynb index b50a888..d4edc10 100644 --- a/Ch2-statlearn-lab.ipynb +++ b/Ch2-statlearn-lab.ipynb @@ -2,17 +2,19 @@ "cells": [ { "cell_type": "markdown", - "id": "46456e09", + "id": "4a4000ea", "metadata": {}, "source": [ + "\n", "# Chapter 2\n", "\n", - "# Lab: Introduction to Python" + "# Lab: Introduction to Python\n", + "\n" ] }, { "cell_type": "markdown", - "id": "e9222139", + "id": "ca503bf1", "metadata": {}, "source": [ "## Getting Started" @@ -20,26 +22,26 @@ }, { "cell_type": "markdown", - "id": "a84726ab", + "id": "4d90d49a", "metadata": {}, "source": [ "To run the labs in this book, you will need two things:\n", "\n", "* An installation of `Python3`, which is the specific version of `Python` used in the labs. \n", - "* Access to `Jupyter`, a very popular `Python` interface that runs code through a file called a *notebook*." + "* Access to `Jupyter`, a very popular `Python` interface that runs code through a file called a *notebook*. " ] }, { "cell_type": "markdown", - "id": "f922cc9e", + "id": "c05e9a74", "metadata": {}, "source": [ - "You can download and install `Python3` by following the instructions available at [anaconda.com](http://anaconda.com)." + "You can download and install `Python3` by following the instructions available at [anaconda.com](http://anaconda.com). " ] }, { "cell_type": "markdown", - "id": "baaeada6", + "id": "a4fa6a12", "metadata": {}, "source": [ " There are a number of ways to get access to `Jupyter`. Here are just a few:\n", @@ -56,29 +58,32 @@ "To run this lab, download the file `Ch2-statlearn-lab.ipynb` from the `Python` resources page. \n", "Now run the following code at the command line: `jupyter lab Ch2-statlearn-lab.ipynb`.\n", "\n", - "If you're using Windows, you can use the `start menu` to access `anaconda`, and follow the links. For example, to install `ISLP` and run this lab, you can run the same code above in an `anaconda` shell." + "If you're using Windows, you can use the `start menu` to access `anaconda`, and follow the links. For example, to install `ISLP` and run this lab, you can run the same code above in an `anaconda` shell.\n" ] }, { "cell_type": "markdown", - "id": "7a44fbd9", + "id": "fb245ea1", "metadata": {}, "source": [ - "## Basic Commands" + "## Basic Commands\n" ] }, { "cell_type": "markdown", - "id": "3831ff0d", + "id": "df72fe8e", "metadata": {}, "source": [ "In this lab, we will introduce some simple `Python` commands. \n", - " For more resources about `Python` in general, readers may want to consult the tutorial at [docs.python.org/3/tutorial/](https://docs.python.org/3/tutorial/)." + " For more resources about `Python` in general, readers may want to consult the tutorial at [docs.python.org/3/tutorial/](https://docs.python.org/3/tutorial/). \n", + "\n", + "\n", + " \n" ] }, { "cell_type": "markdown", - "id": "b5460488", + "id": "713233e6", "metadata": {}, "source": [ "Like most programming languages, `Python` uses *functions*\n", @@ -94,13 +99,13 @@ { "cell_type": "code", "execution_count": 1, - "id": "88d0bfff", + "id": "3e6aae64", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.930945Z", - "iopub.status.busy": "2023-07-31T02:19:54.930255Z", - "iopub.status.idle": "2023-07-31T02:19:54.946609Z", - "shell.execute_reply": "2023-07-31T02:19:54.945952Z" + "iopub.execute_input": "2023-08-06T17:44:43.285475Z", + "iopub.status.busy": "2023-08-06T17:44:43.285130Z", + "iopub.status.idle": "2023-08-06T17:44:43.294270Z", + "shell.execute_reply": "2023-08-06T17:44:43.293851Z" } }, "outputs": [ @@ -113,12 +118,12 @@ } ], "source": [ - "print('fit a model with', 11, 'variables')" + "print('fit a model with', 11, 'variables')\n" ] }, { "cell_type": "markdown", - "id": "9c07629a", + "id": "790e89ef", "metadata": {}, "source": [ " The following command will provide information about the `print()` function." @@ -127,23 +132,23 @@ { "cell_type": "code", "execution_count": 2, - "id": "ebe7aca8", + "id": "086066fd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.950081Z", - "iopub.status.busy": "2023-07-31T02:19:54.949852Z", - "iopub.status.idle": "2023-07-31T02:19:54.982824Z", - "shell.execute_reply": "2023-07-31T02:19:54.982548Z" + "iopub.execute_input": "2023-08-06T17:44:43.296567Z", + "iopub.status.busy": "2023-08-06T17:44:43.296382Z", + "iopub.status.idle": "2023-08-06T17:44:43.324226Z", + "shell.execute_reply": "2023-08-06T17:44:43.323953Z" } }, "outputs": [], "source": [ - "print?" + "print?\n" ] }, { "cell_type": "markdown", - "id": "b0c41d18", + "id": "1519b474", "metadata": {}, "source": [ "Adding two integers in `Python` is pretty intuitive." @@ -152,13 +157,13 @@ { "cell_type": "code", "execution_count": 3, - "id": "df2f8168", + "id": "cb86e827", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.984493Z", - "iopub.status.busy": "2023-07-31T02:19:54.984388Z", - "iopub.status.idle": "2023-07-31T02:19:54.987616Z", - "shell.execute_reply": "2023-07-31T02:19:54.987363Z" + "iopub.execute_input": "2023-08-06T17:44:43.325751Z", + "iopub.status.busy": "2023-08-06T17:44:43.325655Z", + "iopub.status.idle": "2023-08-06T17:44:43.328625Z", + "shell.execute_reply": "2023-08-06T17:44:43.328385Z" } }, "outputs": [ @@ -174,12 +179,12 @@ } ], "source": [ - "3 + 5" + "3 + 5\n" ] }, { "cell_type": "markdown", - "id": "7e7b4195", + "id": "995ac4a8", "metadata": {}, "source": [ "In `Python`, textual data is handled using\n", @@ -192,13 +197,13 @@ { "cell_type": "code", "execution_count": 4, - "id": "4cc5c2c1", + "id": "f4d45d80", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.989196Z", - "iopub.status.busy": "2023-07-31T02:19:54.989079Z", - "iopub.status.idle": "2023-07-31T02:19:54.991281Z", - "shell.execute_reply": "2023-07-31T02:19:54.990967Z" + "iopub.execute_input": "2023-08-06T17:44:43.330134Z", + "iopub.status.busy": "2023-08-06T17:44:43.330050Z", + "iopub.status.idle": "2023-08-06T17:44:43.332103Z", + "shell.execute_reply": "2023-08-06T17:44:43.331834Z" } }, "outputs": [ @@ -214,22 +219,22 @@ } ], "source": [ - "\"hello\" + \" \" + \"world\"" + "\"hello\" + \" \" + \"world\"\n" ] }, { "cell_type": "markdown", - "id": "cfda314a", + "id": "54a86535", "metadata": {}, "source": [ " A string is actually a type of *sequence*: this is a generic term for an ordered list. \n", " The three most important types of sequences are lists, tuples, and strings. \n", - "We introduce lists now." + "We introduce lists now. " ] }, { "cell_type": "markdown", - "id": "764ca7ea", + "id": "f2cd64af", "metadata": {}, "source": [ "The following command instructs `Python` to join together\n", @@ -241,13 +246,13 @@ { "cell_type": "code", "execution_count": 5, - "id": "e5d81180", + "id": "e386aff9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.992960Z", - "iopub.status.busy": "2023-07-31T02:19:54.992843Z", - "iopub.status.idle": "2023-07-31T02:19:54.994972Z", - "shell.execute_reply": "2023-07-31T02:19:54.994710Z" + "iopub.execute_input": "2023-08-06T17:44:43.333600Z", + "iopub.status.busy": "2023-08-06T17:44:43.333503Z", + "iopub.status.idle": "2023-08-06T17:44:43.335528Z", + "shell.execute_reply": "2023-08-06T17:44:43.335290Z" } }, "outputs": [ @@ -264,12 +269,12 @@ ], "source": [ "x = [3, 4, 5]\n", - "x" + "x\n" ] }, { "cell_type": "markdown", - "id": "a2e75dce", + "id": "185fdcfa", "metadata": {}, "source": [ "Note that we used the brackets\n", @@ -282,13 +287,13 @@ { "cell_type": "code", "execution_count": 6, - "id": "425a714c", + "id": "f81b1212", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.996450Z", - "iopub.status.busy": "2023-07-31T02:19:54.996354Z", - "iopub.status.idle": "2023-07-31T02:19:54.998412Z", - "shell.execute_reply": "2023-07-31T02:19:54.998136Z" + "iopub.execute_input": "2023-08-06T17:44:43.336973Z", + "iopub.status.busy": "2023-08-06T17:44:43.336873Z", + "iopub.status.idle": "2023-08-06T17:44:43.338920Z", + "shell.execute_reply": "2023-08-06T17:44:43.338661Z" } }, "outputs": [ @@ -305,48 +310,49 @@ ], "source": [ "y = [4, 9, 7]\n", - "x + y" + "x + y\n" ] }, { "cell_type": "markdown", - "id": "245f069e", + "id": "f421a679", "metadata": {}, "source": [ "The result may appear slightly counterintuitive: why did `Python` not add the entries of the lists\n", "element-by-element? \n", " In `Python`, lists hold *arbitrary* objects, and are added using *concatenation*. \n", - " In fact, concatenation is the behavior that we saw earlier when we entered `\"hello\" + \" \" + \"world\"`." + " In fact, concatenation is the behavior that we saw earlier when we entered `\"hello\" + \" \" + \"world\"`. \n", + " " ] }, { "cell_type": "markdown", - "id": "071caddd", + "id": "911db9e2", "metadata": {}, "source": [ "This example reflects the fact that \n", " `Python` is a general-purpose programming language. Much of `Python`'s data-specific\n", "functionality comes from other packages, notably `numpy`\n", "and `pandas`. \n", - "In the next section, we will introduce the `numpy` package. More information about `numpy` can be found at \n", - "[docs.scipy.org/doc/numpy/user/quickstart.html](https://docs.scipy.org/doc/numpy/user/quickstart.html)." + "In the next section, we will introduce the `numpy` package. \n", + "See [docs.scipy.org/doc/numpy/user/quickstart.html](https://docs.scipy.org/doc/numpy/user/quickstart.html) for more information about `numpy`.\n" ] }, { "cell_type": "markdown", - "id": "25581a8e", + "id": "2045f04d", "metadata": {}, "source": [ "## Introduction to Numerical Python\n", "\n", "As mentioned earlier, this book makes use of functionality that is contained in the `numpy` \n", " *library*, or *package*. A package is a collection of modules that are not necessarily included in \n", - " the base `Python` distribution. The name `numpy` is an abbreviation for *numerical Python*." + " the base `Python` distribution. The name `numpy` is an abbreviation for *numerical Python*. " ] }, { "cell_type": "markdown", - "id": "851a40d6", + "id": "b4ef08ea", "metadata": {}, "source": [ " To access `numpy`, we must first `import` it." @@ -355,14 +361,15 @@ { "cell_type": "code", "execution_count": 7, - "id": "2f88669a", + "id": "13739a14", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:54.999936Z", - "iopub.status.busy": "2023-07-31T02:19:54.999846Z", - "iopub.status.idle": "2023-07-31T02:19:55.074905Z", - "shell.execute_reply": "2023-07-31T02:19:55.074215Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.340405Z", + "iopub.status.busy": "2023-08-06T17:44:43.340311Z", + "iopub.status.idle": "2023-08-06T17:44:43.397337Z", + "shell.execute_reply": "2023-08-06T17:44:43.396647Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -371,7 +378,7 @@ }, { "cell_type": "markdown", - "id": "5bdc55d1", + "id": "587207d9", "metadata": {}, "source": [ "In the previous line, we named the `numpy` *module* `np`; an abbreviation for easier referencing." @@ -379,7 +386,7 @@ }, { "cell_type": "markdown", - "id": "7b2cbe8b", + "id": "c485aeb9", "metadata": {}, "source": [ "In `numpy`, an *array* is a generic term for a multidimensional\n", @@ -390,14 +397,15 @@ { "cell_type": "code", "execution_count": 8, - "id": "e8ec382a", + "id": "f3f62d0a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.080476Z", - "iopub.status.busy": "2023-07-31T02:19:55.079040Z", - "iopub.status.idle": "2023-07-31T02:19:55.085010Z", - "shell.execute_reply": "2023-07-31T02:19:55.084396Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.401823Z", + "iopub.status.busy": "2023-08-06T17:44:43.401514Z", + "iopub.status.idle": "2023-08-06T17:44:43.406194Z", + "shell.execute_reply": "2023-08-06T17:44:43.404998Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -407,35 +415,36 @@ }, { "cell_type": "markdown", - "id": "3a5ce193", + "id": "d5e7e5e3", "metadata": {}, "source": [ "Note that if you forgot to run the `import numpy as np` command earlier, then\n", "you will encounter an error in calling the `np.array()` function in the previous line. \n", " The syntax `np.array()` indicates that the function being called\n", - "is part of the `numpy` package, which we have abbreviated as `np`." + "is part of the `numpy` package, which we have abbreviated as `np`. " ] }, { "cell_type": "markdown", - "id": "b21e6ebd", + "id": "5ba313c6", "metadata": {}, "source": [ "Since `x` and `y` have been defined using `np.array()`, we get a sensible result when we add them together. Compare this to our results in the previous section,\n", - " when we tried to add two lists without using `numpy`." + " when we tried to add two lists without using `numpy`. " ] }, { "cell_type": "code", "execution_count": 9, - "id": "04de39ad", + "id": "3cff111f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.093437Z", - "iopub.status.busy": "2023-07-31T02:19:55.091813Z", - "iopub.status.idle": "2023-07-31T02:19:55.099515Z", - "shell.execute_reply": "2023-07-31T02:19:55.098725Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.410267Z", + "iopub.status.busy": "2023-08-06T17:44:43.410044Z", + "iopub.status.idle": "2023-08-06T17:44:43.416300Z", + "shell.execute_reply": "2023-08-06T17:44:43.415133Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -455,24 +464,34 @@ }, { "cell_type": "markdown", - "id": "33df3775", + "id": "96db430f", + "metadata": {}, + "source": [ + " \n", + " \n" + ] + }, + { + "cell_type": "markdown", + "id": "801647e7", "metadata": {}, "source": [ "In `numpy`, matrices are typically represented as two-dimensional arrays, and vectors as one-dimensional arrays. {While it is also possible to create matrices using `np.matrix()`, we will use `np.array()` throughout the labs in this book.}\n", - "We can create a two-dimensional array as follows." + "We can create a two-dimensional array as follows. " ] }, { "cell_type": "code", "execution_count": 10, - "id": "fee5d798", + "id": "30d6c7f8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.105177Z", - "iopub.status.busy": "2023-07-31T02:19:55.104776Z", - "iopub.status.idle": "2023-07-31T02:19:55.111056Z", - "shell.execute_reply": "2023-07-31T02:19:55.110390Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.420244Z", + "iopub.status.busy": "2023-08-06T17:44:43.419921Z", + "iopub.status.idle": "2023-08-06T17:44:43.426497Z", + "shell.execute_reply": "2023-08-06T17:44:43.425722Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -494,25 +513,34 @@ }, { "cell_type": "markdown", - "id": "86de84a5", + "id": "5df2b6c3", + "metadata": {}, + "source": [ + " \n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "d7804f5e", "metadata": {}, "source": [ "The object `x` has several \n", "*attributes*, or associated objects. To access an attribute of `x`, we type `x.attribute`, where we replace `attribute`\n", "with the name of the attribute. \n", - "For instance, we can access the `ndim` attribute of `x` as follows." + "For instance, we can access the `ndim` attribute of `x` as follows. " ] }, { "cell_type": "code", "execution_count": 11, - "id": "5871ca00", + "id": "42d49be4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.114118Z", - "iopub.status.busy": "2023-07-31T02:19:55.113892Z", - "iopub.status.idle": "2023-07-31T02:19:55.118784Z", - "shell.execute_reply": "2023-07-31T02:19:55.118098Z" + "iopub.execute_input": "2023-08-06T17:44:43.430547Z", + "iopub.status.busy": "2023-08-06T17:44:43.430144Z", + "iopub.status.idle": "2023-08-06T17:44:43.436651Z", + "shell.execute_reply": "2023-08-06T17:44:43.435793Z" } }, "outputs": [ @@ -533,7 +561,7 @@ }, { "cell_type": "markdown", - "id": "71a44f8e", + "id": "765e1496", "metadata": {}, "source": [ "The output indicates that `x` is a two-dimensional array. \n", @@ -544,14 +572,15 @@ { "cell_type": "code", "execution_count": 12, - "id": "5a32759c", + "id": "de32b275", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.121874Z", - "iopub.status.busy": "2023-07-31T02:19:55.121557Z", - "iopub.status.idle": "2023-07-31T02:19:55.125886Z", - "shell.execute_reply": "2023-07-31T02:19:55.125226Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.440754Z", + "iopub.status.busy": "2023-08-06T17:44:43.440389Z", + "iopub.status.idle": "2023-08-06T17:44:43.447906Z", + "shell.execute_reply": "2023-08-06T17:44:43.447260Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -571,26 +600,27 @@ }, { "cell_type": "markdown", - "id": "e770da51", + "id": "044bf011", "metadata": {}, "source": [ "Why is `x` comprised of integers? This is because we created `x` by passing in exclusively integers to the `np.array()` function.\n", " If\n", "we had passed in any decimals, then we would have obtained an array of\n", - "*floating point numbers* (i.e. real-valued numbers)." + "*floating point numbers* (i.e. real-valued numbers). " ] }, { "cell_type": "code", "execution_count": 13, - "id": "55f01b16", + "id": "528c3fa0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.129292Z", - "iopub.status.busy": "2023-07-31T02:19:55.128953Z", - "iopub.status.idle": "2023-07-31T02:19:55.133425Z", - "shell.execute_reply": "2023-07-31T02:19:55.132824Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.451815Z", + "iopub.status.busy": "2023-08-06T17:44:43.451466Z", + "iopub.status.idle": "2023-08-06T17:44:43.459974Z", + "shell.execute_reply": "2023-08-06T17:44:43.459261Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -605,39 +635,40 @@ } ], "source": [ - "np.array([[1, 2], [3.0, 4]]).dtype" + "np.array([[1, 2], [3.0, 4]]).dtype\n" ] }, { "cell_type": "markdown", - "id": "4595300f", + "id": "053da117", "metadata": {}, "source": [ "Typing `fun?` will cause `Python` to display \n", "documentation associated with the function `fun`, if it exists.\n", - "We can try this for `np.array()`." + "We can try this for `np.array()`. " ] }, { "cell_type": "code", "execution_count": 14, - "id": "2a9de618", + "id": "fbf8763b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.136626Z", - "iopub.status.busy": "2023-07-31T02:19:55.136412Z", - "iopub.status.idle": "2023-07-31T02:19:55.140205Z", - "shell.execute_reply": "2023-07-31T02:19:55.139252Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.463710Z", + "iopub.status.busy": "2023-08-06T17:44:43.463173Z", + "iopub.status.idle": "2023-08-06T17:44:43.468333Z", + "shell.execute_reply": "2023-08-06T17:44:43.467532Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "np.array?" + "np.array?\n" ] }, { "cell_type": "markdown", - "id": "9640f3fe", + "id": "0df45f3d", "metadata": {}, "source": [ "This documentation indicates that we could create a floating point array by passing a `dtype` argument into `np.array()`." @@ -646,14 +677,15 @@ { "cell_type": "code", "execution_count": 15, - "id": "33e3e6ea", + "id": "482d0c05", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.143610Z", - "iopub.status.busy": "2023-07-31T02:19:55.143298Z", - "iopub.status.idle": "2023-07-31T02:19:55.150031Z", - "shell.execute_reply": "2023-07-31T02:19:55.148539Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.472515Z", + "iopub.status.busy": "2023-08-06T17:44:43.472028Z", + "iopub.status.idle": "2023-08-06T17:44:43.479510Z", + "shell.execute_reply": "2023-08-06T17:44:43.478563Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -668,12 +700,12 @@ } ], "source": [ - "np.array([[1, 2], [3, 4]], float).dtype" + "np.array([[1, 2], [3, 4]], float).dtype\n" ] }, { "cell_type": "markdown", - "id": "fbf59c0e", + "id": "757c10a0", "metadata": {}, "source": [ "The array `x` is two-dimensional. We can find out the number of rows and columns by looking\n", @@ -683,14 +715,15 @@ { "cell_type": "code", "execution_count": 16, - "id": "623f8434", + "id": "192cdf26", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.153298Z", - "iopub.status.busy": "2023-07-31T02:19:55.153076Z", - "iopub.status.idle": "2023-07-31T02:19:55.157147Z", - "shell.execute_reply": "2023-07-31T02:19:55.156560Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.483171Z", + "iopub.status.busy": "2023-08-06T17:44:43.482882Z", + "iopub.status.idle": "2023-08-06T17:44:43.489459Z", + "shell.execute_reply": "2023-08-06T17:44:43.488833Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -705,12 +738,12 @@ } ], "source": [ - "x.shape" + "x.shape\n" ] }, { "cell_type": "markdown", - "id": "81f0bbae", + "id": "b3d091f4", "metadata": {}, "source": [ "A *method* is a function that is associated with an\n", @@ -725,14 +758,15 @@ { "cell_type": "code", "execution_count": 17, - "id": "235738a7", + "id": "4420b967", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.161000Z", - "iopub.status.busy": "2023-07-31T02:19:55.160710Z", - "iopub.status.idle": "2023-07-31T02:19:55.165032Z", - "shell.execute_reply": "2023-07-31T02:19:55.164369Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.493523Z", + "iopub.status.busy": "2023-08-06T17:44:43.493057Z", + "iopub.status.idle": "2023-08-06T17:44:43.499969Z", + "shell.execute_reply": "2023-08-06T17:44:43.499303Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -753,23 +787,24 @@ }, { "cell_type": "markdown", - "id": "72373ccf", + "id": "ca0ff297", "metadata": {}, "source": [ - "We could also sum the elements of `x` by passing in `x` as an argument to the `np.sum()` function." + "We could also sum the elements of `x` by passing in `x` as an argument to the `np.sum()` function. " ] }, { "cell_type": "code", "execution_count": 18, - "id": "7f3494e1", + "id": "5af5e20f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.168035Z", - "iopub.status.busy": "2023-07-31T02:19:55.167814Z", - "iopub.status.idle": "2023-07-31T02:19:55.172036Z", - "shell.execute_reply": "2023-07-31T02:19:55.171424Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.503658Z", + "iopub.status.busy": "2023-08-06T17:44:43.503289Z", + "iopub.status.idle": "2023-08-06T17:44:43.510540Z", + "shell.execute_reply": "2023-08-06T17:44:43.509832Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -790,7 +825,7 @@ }, { "cell_type": "markdown", - "id": "69967e23", + "id": "355ad58f", "metadata": {}, "source": [ " As another example, the\n", @@ -807,13 +842,13 @@ { "cell_type": "code", "execution_count": 19, - "id": "0ca8f936", + "id": "77a0df31", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.175473Z", - "iopub.status.busy": "2023-07-31T02:19:55.175049Z", - "iopub.status.idle": "2023-07-31T02:19:55.179255Z", - "shell.execute_reply": "2023-07-31T02:19:55.178621Z" + "iopub.execute_input": "2023-08-06T17:44:43.514507Z", + "iopub.status.busy": "2023-08-06T17:44:43.514084Z", + "iopub.status.idle": "2023-08-06T17:44:43.520423Z", + "shell.execute_reply": "2023-08-06T17:44:43.519754Z" } }, "outputs": [ @@ -833,21 +868,21 @@ "x = np.array([1, 2, 3, 4, 5, 6])\n", "print('beginning x:\\n', x)\n", "x_reshape = x.reshape((2, 3))\n", - "print('reshaped x:\\n', x_reshape)" + "print('reshaped x:\\n', x_reshape)\n" ] }, { "cell_type": "markdown", - "id": "0c1e36ab", + "id": "e68cddfa", "metadata": {}, "source": [ "The previous output reveals that `numpy` arrays are specified as a sequence\n", - "of *rows*. This is called *row-major ordering*, as opposed to *column-major ordering*." + "of *rows*. This is called *row-major ordering*, as opposed to *column-major ordering*. " ] }, { "cell_type": "markdown", - "id": "45263db2", + "id": "4b16c07d", "metadata": {}, "source": [ "`Python` (and hence `numpy`) uses 0-based\n", @@ -858,14 +893,15 @@ { "cell_type": "code", "execution_count": 20, - "id": "23fba624", + "id": "c57ce2ca", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.183850Z", - "iopub.status.busy": "2023-07-31T02:19:55.183200Z", - "iopub.status.idle": "2023-07-31T02:19:55.188356Z", - "shell.execute_reply": "2023-07-31T02:19:55.187726Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.524768Z", + "iopub.status.busy": "2023-08-06T17:44:43.524519Z", + "iopub.status.idle": "2023-08-06T17:44:43.537593Z", + "shell.execute_reply": "2023-08-06T17:44:43.536180Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -885,24 +921,25 @@ }, { "cell_type": "markdown", - "id": "26f1717c", + "id": "9a4feee5", "metadata": {}, "source": [ "Similarly, `x_reshape[1,2]` yields the element in the second row and the third column \n", - "of `x_reshape`." + "of `x_reshape`. " ] }, { "cell_type": "code", "execution_count": 21, - "id": "1a1df926", + "id": "ea55b034", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.191472Z", - "iopub.status.busy": "2023-07-31T02:19:55.191240Z", - "iopub.status.idle": "2023-07-31T02:19:55.195433Z", - "shell.execute_reply": "2023-07-31T02:19:55.194720Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.541338Z", + "iopub.status.busy": "2023-08-06T17:44:43.541124Z", + "iopub.status.idle": "2023-08-06T17:44:43.551129Z", + "shell.execute_reply": "2023-08-06T17:44:43.550354Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -922,25 +959,26 @@ }, { "cell_type": "markdown", - "id": "c6d6d359", + "id": "7a3c27dd", "metadata": {}, "source": [ "Similarly, `x[2]` yields the\n", "third entry of `x`. \n", "\n", - "Now, let's modify the top left element of `x_reshape`. To our surprise, we discover that the first element of `x` has been modified as well!" + "Now, let's modify the top left element of `x_reshape`. To our surprise, we discover that the first element of `x` has been modified as well!\n", + "\n" ] }, { "cell_type": "code", "execution_count": 22, - "id": "4bfcc1e1", + "id": "b897a965", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.199275Z", - "iopub.status.busy": "2023-07-31T02:19:55.198815Z", - "iopub.status.idle": "2023-07-31T02:19:55.203321Z", - "shell.execute_reply": "2023-07-31T02:19:55.202715Z" + "iopub.execute_input": "2023-08-06T17:44:43.555575Z", + "iopub.status.busy": "2023-08-06T17:44:43.555273Z", + "iopub.status.idle": "2023-08-06T17:44:43.561872Z", + "shell.execute_reply": "2023-08-06T17:44:43.560597Z" } }, "outputs": [ @@ -966,20 +1004,23 @@ "print('x_reshape before we modify x_reshape:\\n', x_reshape)\n", "x_reshape[0, 0] = 5\n", "print('x_reshape after we modify its top left element:\\n', x_reshape)\n", - "print('x after we modify top left element of x_reshape:\\n', x)" + "print('x after we modify top left element of x_reshape:\\n', x)\n" ] }, { "cell_type": "markdown", - "id": "10ff8c21", + "id": "77ab8534", "metadata": {}, "source": [ - "Modifying `x_reshape` also modified `x` because the two objects occupy the same space in memory." + "Modifying `x_reshape` also modified `x` because the two objects occupy the same space in memory.\n", + " \n", + "\n", + " " ] }, { "cell_type": "markdown", - "id": "ff267ecb", + "id": "8d5214bc", "metadata": {}, "source": [ "We just saw that we can modify an element of an array. Can we also modify a tuple? It turns out that we cannot --- and trying to do so introduces\n", @@ -989,14 +1030,15 @@ { "cell_type": "code", "execution_count": 23, - "id": "973c562a", + "id": "1de2f886", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.207215Z", - "iopub.status.busy": "2023-07-31T02:19:55.206957Z", - "iopub.status.idle": "2023-07-31T02:19:55.336832Z", - "shell.execute_reply": "2023-07-31T02:19:55.336545Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.573227Z", + "iopub.status.busy": "2023-08-06T17:44:43.572937Z", + "iopub.status.idle": "2023-08-06T17:44:43.703228Z", + "shell.execute_reply": "2023-08-06T17:44:43.702951Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1013,28 +1055,28 @@ ], "source": [ "my_tuple = (3, 4, 5)\n", - "my_tuple[0] = 2" + "my_tuple[0] = 2\n" ] }, { "cell_type": "markdown", - "id": "56393fe3", + "id": "5f8a5095", "metadata": {}, "source": [ "We now briefly mention some attributes of arrays that will come in handy. An array's `shape` attribute contains its dimension; this is always a tuple.\n", - "The `ndim` attribute yields the number of dimensions, and `T` provides its transpose." + "The `ndim` attribute yields the number of dimensions, and `T` provides its transpose. " ] }, { "cell_type": "code", "execution_count": 24, - "id": "56b5c382", + "id": "634a18d8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.338558Z", - "iopub.status.busy": "2023-07-31T02:19:55.338442Z", - "iopub.status.idle": "2023-07-31T02:19:55.340894Z", - "shell.execute_reply": "2023-07-31T02:19:55.340636Z" + "iopub.execute_input": "2023-08-06T17:44:43.704897Z", + "iopub.status.busy": "2023-08-06T17:44:43.704794Z", + "iopub.status.idle": "2023-08-06T17:44:43.707079Z", + "shell.execute_reply": "2023-08-06T17:44:43.706824Z" } }, "outputs": [ @@ -1054,31 +1096,31 @@ } ], "source": [ - "x_reshape.shape, x_reshape.ndim, x_reshape.T" + "x_reshape.shape, x_reshape.ndim, x_reshape.T\n" ] }, { "cell_type": "markdown", - "id": "22408350", + "id": "1db9f878", "metadata": {}, "source": [ "Notice that the three individual outputs `(2,3)`, `2`, and `array([[5, 4],[2, 5], [3,6]])` are themselves output as a tuple. \n", " \n", "We will often want to apply functions to arrays. \n", "For instance, we can compute the\n", - "square root of the entries using the `np.sqrt()` function:" + "square root of the entries using the `np.sqrt()` function: " ] }, { "cell_type": "code", "execution_count": 25, - "id": "2e624622", + "id": "38563574", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.342419Z", - "iopub.status.busy": "2023-07-31T02:19:55.342311Z", - "iopub.status.idle": "2023-07-31T02:19:55.344447Z", - "shell.execute_reply": "2023-07-31T02:19:55.344186Z" + "iopub.execute_input": "2023-08-06T17:44:43.708463Z", + "iopub.status.busy": "2023-08-06T17:44:43.708366Z", + "iopub.status.idle": "2023-08-06T17:44:43.710497Z", + "shell.execute_reply": "2023-08-06T17:44:43.710237Z" } }, "outputs": [ @@ -1095,12 +1137,12 @@ } ], "source": [ - "np.sqrt(x)" + "np.sqrt(x)\n" ] }, { "cell_type": "markdown", - "id": "6c3e074d", + "id": "cdee1904", "metadata": {}, "source": [ "We can also square the elements:" @@ -1109,13 +1151,13 @@ { "cell_type": "code", "execution_count": 26, - "id": "6f45bd25", + "id": "6d7eb044", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.345962Z", - "iopub.status.busy": "2023-07-31T02:19:55.345864Z", - "iopub.status.idle": "2023-07-31T02:19:55.347930Z", - "shell.execute_reply": "2023-07-31T02:19:55.347615Z" + "iopub.execute_input": "2023-08-06T17:44:43.711918Z", + "iopub.status.busy": "2023-08-06T17:44:43.711824Z", + "iopub.status.idle": "2023-08-06T17:44:43.713705Z", + "shell.execute_reply": "2023-08-06T17:44:43.713469Z" } }, "outputs": [ @@ -1131,12 +1173,12 @@ } ], "source": [ - "x**2" + "x**2\n" ] }, { "cell_type": "markdown", - "id": "481ca03c", + "id": "7322f04a", "metadata": {}, "source": [ "We can compute the square roots using the same notation, raising to the power of $1/2$ instead of 2." @@ -1145,14 +1187,15 @@ { "cell_type": "code", "execution_count": 27, - "id": "6980f628", + "id": "dcf49c32", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.349275Z", - "iopub.status.busy": "2023-07-31T02:19:55.349187Z", - "iopub.status.idle": "2023-07-31T02:19:55.351235Z", - "shell.execute_reply": "2023-07-31T02:19:55.350993Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.715100Z", + "iopub.status.busy": "2023-08-06T17:44:43.715015Z", + "iopub.status.idle": "2023-08-06T17:44:43.717032Z", + "shell.execute_reply": "2023-08-06T17:44:43.716796Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1168,12 +1211,12 @@ } ], "source": [ - "x**0.5" + "x**0.5\n" ] }, { "cell_type": "markdown", - "id": "bc357745", + "id": "a4ccea4f", "metadata": {}, "source": [ "Throughout this book, we will often want to generate random data. \n", @@ -1185,35 +1228,35 @@ " By default, this function will generate random normal variable(s) with mean (`loc`) $0$ and standard deviation (`scale`) $1$; furthermore, \n", " a single random variable will be generated unless the argument to `size` is changed. \n", "\n", - "We now generate 50 independent random variables from a $N(0,1)$ distribution." + "We now generate 50 independent random variables from a $N(0,1)$ distribution. " ] }, { "cell_type": "code", "execution_count": 28, - "id": "89e32100", + "id": "dec2f36f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.352623Z", - "iopub.status.busy": "2023-07-31T02:19:55.352535Z", - "iopub.status.idle": "2023-07-31T02:19:55.354759Z", - "shell.execute_reply": "2023-07-31T02:19:55.354511Z" + "iopub.execute_input": "2023-08-06T17:44:43.718403Z", + "iopub.status.busy": "2023-08-06T17:44:43.718308Z", + "iopub.status.idle": "2023-08-06T17:44:43.720577Z", + "shell.execute_reply": "2023-08-06T17:44:43.720323Z" } }, "outputs": [ { "data": { "text/plain": [ - "array([-0.32811487, 2.23248403, -1.52447344, 0.87877484, 0.96469789,\n", - " 0.30865486, 0.27267724, -0.60057925, -1.05393735, -0.50796536,\n", - " -0.37084711, -2.06355835, -0.33046415, -0.42649073, 0.89919736,\n", - " 1.42958323, 1.21817925, -1.09955402, 0.53118572, -1.6542446 ,\n", - " 0.01086168, 0.41526654, -1.35753179, 0.45375349, 1.11132718,\n", - " 1.19292713, 1.18995843, 0.63104856, -0.78136416, -0.3738745 ,\n", - " -0.10391399, -0.25248889, 1.7725557 , -0.01959626, -0.34732798,\n", - " 1.03993987, 0.23681907, 1.07380138, -0.04976414, 2.0716395 ,\n", - " -1.60225312, -1.3209919 , 0.24733062, -0.01605715, 0.01309674,\n", - " 2.15909284, -2.13624645, 0.64257243, -0.33452604, 0.84815965])" + "array([-0.98985585, 0.78794313, -1.59659373, 1.11006429, -0.19527724,\n", + " -1.49222447, -1.63557764, 2.0998599 , -1.05798913, 0.22654563,\n", + " -2.48042733, 1.53705085, 1.17455819, 0.19093254, -0.2819633 ,\n", + " -1.11688619, -1.58430027, -0.58351755, 0.52620187, -0.14465477,\n", + " 0.84609267, -0.06187834, -0.37385525, 1.27932599, 0.85681759,\n", + " -0.11171155, 0.30777588, -1.08741173, 0.60531981, -0.48213946,\n", + " -0.70477606, 0.34160113, -0.44446051, -0.67950574, 1.02276341,\n", + " 2.18072377, 0.46699258, 0.28226576, -0.26951424, 2.06603321,\n", + " -0.0803351 , 1.04171103, -0.54035202, -1.89733049, -1.86300407,\n", + " -0.06721318, 0.4822852 , -0.29686638, -0.19377943, 2.03320645])" ] }, "execution_count": 28, @@ -1223,12 +1266,12 @@ ], "source": [ "x = np.random.normal(size=50)\n", - "x" + "x\n" ] }, { "cell_type": "markdown", - "id": "80939b41", + "id": "9c60001d", "metadata": {}, "source": [ "We create an array `y` by adding an independent $N(50,1)$ random variable to each element of `x`." @@ -1237,14 +1280,15 @@ { "cell_type": "code", "execution_count": 29, - "id": "e3428155", + "id": "f535fba4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.356099Z", - "iopub.status.busy": "2023-07-31T02:19:55.356006Z", - "iopub.status.idle": "2023-07-31T02:19:55.357674Z", - "shell.execute_reply": "2023-07-31T02:19:55.357434Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.721992Z", + "iopub.status.busy": "2023-08-06T17:44:43.721881Z", + "iopub.status.idle": "2023-08-06T17:44:43.723589Z", + "shell.execute_reply": "2023-08-06T17:44:43.723344Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -1253,31 +1297,31 @@ }, { "cell_type": "markdown", - "id": "17f93000", + "id": "b267be24", "metadata": {}, "source": [ "The `np.corrcoef()` function computes the correlation matrix between `x` and `y`. The off-diagonal elements give the \n", - "correlation between `x` and `y`." + "correlation between `x` and `y`. " ] }, { "cell_type": "code", "execution_count": 30, - "id": "df70172e", + "id": "faf3be25", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.359035Z", - "iopub.status.busy": "2023-07-31T02:19:55.358958Z", - "iopub.status.idle": "2023-07-31T02:19:55.361240Z", - "shell.execute_reply": "2023-07-31T02:19:55.361002Z" + "iopub.execute_input": "2023-08-06T17:44:43.724943Z", + "iopub.status.busy": "2023-08-06T17:44:43.724855Z", + "iopub.status.idle": "2023-08-06T17:44:43.727100Z", + "shell.execute_reply": "2023-08-06T17:44:43.726847Z" } }, "outputs": [ { "data": { "text/plain": [ - "array([[1. , 0.62232452],\n", - " [0.62232452, 1. ]])" + "array([[1. , 0.78790794],\n", + " [0.78790794, 1. ]])" ] }, "execution_count": 30, @@ -1291,7 +1335,7 @@ }, { "cell_type": "markdown", - "id": "8fb44ec4", + "id": "c6d0e0ce", "metadata": {}, "source": [ "If you're following along in your own `Jupyter` notebook, then you probably noticed that you got a different set of results when you ran the past few \n", @@ -1303,33 +1347,42 @@ { "cell_type": "code", "execution_count": 31, - "id": "1d996956", + "id": "b6a756e0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.362596Z", - "iopub.status.busy": "2023-07-31T02:19:55.362498Z", - "iopub.status.idle": "2023-07-31T02:19:55.364433Z", - "shell.execute_reply": "2023-07-31T02:19:55.364198Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.728472Z", + "iopub.status.busy": "2023-08-06T17:44:43.728385Z", + "iopub.status.idle": "2023-08-06T17:44:43.730292Z", + "shell.execute_reply": "2023-08-06T17:44:43.730062Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[5.36436837 4.4802098 ]\n", - "[5.8496351 4.14855633]\n" + "[3.08077237 4.8023279 ]\n", + "[-1.55255532 6.09934933]\n" ] } ], "source": [ "print(np.random.normal(scale=5, size=2))\n", - "print(np.random.normal(scale=5, size=2)) " + "print(np.random.normal(scale=5, size=2)) \n" ] }, { "cell_type": "markdown", - "id": "988ca34a", + "id": "a1071413", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "31d9911e", "metadata": {}, "source": [ "In order to ensure that our code provides exactly the same results\n", @@ -1345,13 +1398,13 @@ { "cell_type": "code", "execution_count": 32, - "id": "37b3a30b", + "id": "921b634a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.365832Z", - "iopub.status.busy": "2023-07-31T02:19:55.365741Z", - "iopub.status.idle": "2023-07-31T02:19:55.367967Z", - "shell.execute_reply": "2023-07-31T02:19:55.367727Z" + "iopub.execute_input": "2023-08-06T17:44:43.731733Z", + "iopub.status.busy": "2023-08-06T17:44:43.731639Z", + "iopub.status.idle": "2023-08-06T17:44:43.733796Z", + "shell.execute_reply": "2023-08-06T17:44:43.733577Z" } }, "outputs": [ @@ -1373,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "039e7f65", + "id": "7a4da703", "metadata": {}, "source": [ "Throughout the labs in this book, we use `np.random.default_rng()` whenever we\n", @@ -1391,14 +1444,15 @@ { "cell_type": "code", "execution_count": 33, - "id": "b4f99e0e", + "id": "fe28973e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.369367Z", - "iopub.status.busy": "2023-07-31T02:19:55.369272Z", - "iopub.status.idle": "2023-07-31T02:19:55.371528Z", - "shell.execute_reply": "2023-07-31T02:19:55.371273Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.735204Z", + "iopub.status.busy": "2023-08-06T17:44:43.735110Z", + "iopub.status.idle": "2023-08-06T17:44:43.737316Z", + "shell.execute_reply": "2023-08-06T17:44:43.737055Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1418,17 +1472,26 @@ "np.mean(y), y.mean()" ] }, + { + "cell_type": "markdown", + "id": "b6092d9c", + "metadata": {}, + "source": [ + " \n" + ] + }, { "cell_type": "code", "execution_count": 34, - "id": "dbd70319", + "id": "04c26742", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.372848Z", - "iopub.status.busy": "2023-07-31T02:19:55.372755Z", - "iopub.status.idle": "2023-07-31T02:19:55.374988Z", - "shell.execute_reply": "2023-07-31T02:19:55.374743Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.738692Z", + "iopub.status.busy": "2023-08-06T17:44:43.738597Z", + "iopub.status.idle": "2023-08-06T17:44:43.740858Z", + "shell.execute_reply": "2023-08-06T17:44:43.740608Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1448,23 +1511,23 @@ }, { "cell_type": "markdown", - "id": "ba51f245", + "id": "b9212f82", "metadata": {}, "source": [ "Notice that by default `np.var()` divides by the sample size $n$ rather\n", - "than $n-1$; see the `ddof` argument in `np.var?`." + "than $n-1$; see the `ddof` argument in `np.var?`.\n" ] }, { "cell_type": "code", "execution_count": 35, - "id": "bf281844", + "id": "e35cdcbf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.376355Z", - "iopub.status.busy": "2023-07-31T02:19:55.376270Z", - "iopub.status.idle": "2023-07-31T02:19:55.378293Z", - "shell.execute_reply": "2023-07-31T02:19:55.378046Z" + "iopub.execute_input": "2023-08-06T17:44:43.742198Z", + "iopub.status.busy": "2023-08-06T17:44:43.742113Z", + "iopub.status.idle": "2023-08-06T17:44:43.744175Z", + "shell.execute_reply": "2023-08-06T17:44:43.743929Z" } }, "outputs": [ @@ -1485,23 +1548,23 @@ }, { "cell_type": "markdown", - "id": "877ca8e0", + "id": "41eb4c38", "metadata": {}, "source": [ "The `np.mean()`, `np.var()`, and `np.std()` functions can also be applied to the rows and columns of a matrix. \n", - "To see this, we construct a $10 \\times 3$ matrix of $N(0,1)$ random variables, and consider computing its row sums." + "To see this, we construct a $10 \\times 3$ matrix of $N(0,1)$ random variables, and consider computing its row sums. " ] }, { "cell_type": "code", "execution_count": 36, - "id": "f751b1dd", + "id": "fbd49766", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.379674Z", - "iopub.status.busy": "2023-07-31T02:19:55.379580Z", - "iopub.status.idle": "2023-07-31T02:19:55.381747Z", - "shell.execute_reply": "2023-07-31T02:19:55.381495Z" + "iopub.execute_input": "2023-08-06T17:44:43.745532Z", + "iopub.status.busy": "2023-08-06T17:44:43.745443Z", + "iopub.status.idle": "2023-08-06T17:44:43.747554Z", + "shell.execute_reply": "2023-08-06T17:44:43.747310Z" } }, "outputs": [ @@ -1532,22 +1595,22 @@ }, { "cell_type": "markdown", - "id": "f9028e1a", + "id": "5520aeae", "metadata": {}, "source": [ - "Since arrays are row-major ordered, the first axis, i.e. `axis=0`, refers to its rows. We pass this argument into the `mean()` method for the object `X`." + "Since arrays are row-major ordered, the first axis, i.e. `axis=0`, refers to its rows. We pass this argument into the `mean()` method for the object `X`. " ] }, { "cell_type": "code", "execution_count": 37, - "id": "cbf92de5", + "id": "f5865859", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.383175Z", - "iopub.status.busy": "2023-07-31T02:19:55.383088Z", - "iopub.status.idle": "2023-07-31T02:19:55.385113Z", - "shell.execute_reply": "2023-07-31T02:19:55.384859Z" + "iopub.execute_input": "2023-08-06T17:44:43.748912Z", + "iopub.status.busy": "2023-08-06T17:44:43.748822Z", + "iopub.status.idle": "2023-08-06T17:44:43.750823Z", + "shell.execute_reply": "2023-08-06T17:44:43.750599Z" } }, "outputs": [ @@ -1568,7 +1631,7 @@ }, { "cell_type": "markdown", - "id": "009195d4", + "id": "8aedc41d", "metadata": {}, "source": [ "The following yields the same result." @@ -1577,14 +1640,15 @@ { "cell_type": "code", "execution_count": 38, - "id": "efacc213", + "id": "e27b30bf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.386470Z", - "iopub.status.busy": "2023-07-31T02:19:55.386379Z", - "iopub.status.idle": "2023-07-31T02:19:55.388376Z", - "shell.execute_reply": "2023-07-31T02:19:55.388149Z" - } + "iopub.execute_input": "2023-08-06T17:44:43.752212Z", + "iopub.status.busy": "2023-08-06T17:44:43.752121Z", + "iopub.status.idle": "2023-08-06T17:44:43.754183Z", + "shell.execute_reply": "2023-08-06T17:44:43.753947Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1604,7 +1668,15 @@ }, { "cell_type": "markdown", - "id": "e33fa3fc", + "id": "4ee7f516", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "80ab3209", "metadata": {}, "source": [ "## Graphics\n", @@ -1638,13 +1710,13 @@ { "cell_type": "code", "execution_count": 39, - "id": "637fb67d", + "id": "fed2376c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.389779Z", - "iopub.status.busy": "2023-07-31T02:19:55.389694Z", - "iopub.status.idle": "2023-07-31T02:19:55.691223Z", - "shell.execute_reply": "2023-07-31T02:19:55.690903Z" + "iopub.execute_input": "2023-08-06T17:44:43.755592Z", + "iopub.status.busy": "2023-08-06T17:44:43.755504Z", + "iopub.status.idle": "2023-08-06T17:44:44.060228Z", + "shell.execute_reply": "2023-08-06T17:44:44.059891Z" } }, "outputs": [ @@ -1664,12 +1736,12 @@ "fig, ax = subplots(figsize=(8, 8))\n", "x = rng.standard_normal(100)\n", "y = rng.standard_normal(100)\n", - "ax.plot(x, y);" + "ax.plot(x, y);\n" ] }, { "cell_type": "markdown", - "id": "ca04f15f", + "id": "9b697b2a", "metadata": {}, "source": [ "We pause here to note that we have *unpacked* the tuple of length two returned by `subplots()` into the two distinct\n", @@ -1680,13 +1752,13 @@ { "cell_type": "code", "execution_count": 40, - "id": "109d681d", + "id": "228ee04d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.693013Z", - "iopub.status.busy": "2023-07-31T02:19:55.692861Z", - "iopub.status.idle": "2023-07-31T02:19:55.764802Z", - "shell.execute_reply": "2023-07-31T02:19:55.764451Z" + "iopub.execute_input": "2023-08-06T17:44:44.062068Z", + "iopub.status.busy": "2023-08-06T17:44:44.061933Z", + "iopub.status.idle": "2023-08-06T17:44:44.133359Z", + "shell.execute_reply": "2023-08-06T17:44:44.133077Z" } }, "outputs": [ @@ -1709,7 +1781,7 @@ }, { "cell_type": "markdown", - "id": "5509508c", + "id": "e040ba84", "metadata": {}, "source": [ "We see that our earlier cell produced a line plot, which is the default. To create a scatterplot, we provide an additional argument to `ax.plot()`, indicating that circles should be displayed." @@ -1718,14 +1790,15 @@ { "cell_type": "code", "execution_count": 41, - "id": "e905982c", + "id": "e1dc79d2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.767203Z", - "iopub.status.busy": "2023-07-31T02:19:55.767067Z", - "iopub.status.idle": "2023-07-31T02:19:55.845613Z", - "shell.execute_reply": "2023-07-31T02:19:55.845305Z" - } + "iopub.execute_input": "2023-08-06T17:44:44.135074Z", + "iopub.status.busy": "2023-08-06T17:44:44.134956Z", + "iopub.status.idle": "2023-08-06T17:44:44.210381Z", + "shell.execute_reply": "2023-08-06T17:44:44.210084Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1746,17 +1819,17 @@ }, { "cell_type": "markdown", - "id": "42166016", + "id": "960d0ceb", "metadata": {}, "source": [ "Different values\n", "of this additional argument can be used to produce different colored lines\n", - "as well as different linestyles." + "as well as different linestyles. \n" ] }, { "cell_type": "markdown", - "id": "a99dac78", + "id": "833d6751", "metadata": {}, "source": [ "As an alternative, we could use the `ax.scatter()` function to create a scatterplot." @@ -1765,13 +1838,13 @@ { "cell_type": "code", "execution_count": 42, - "id": "27133a4e", + "id": "d6e6bf34", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.847384Z", - "iopub.status.busy": "2023-07-31T02:19:55.847263Z", - "iopub.status.idle": "2023-07-31T02:19:55.926583Z", - "shell.execute_reply": "2023-07-31T02:19:55.926281Z" + "iopub.execute_input": "2023-08-06T17:44:44.212226Z", + "iopub.status.busy": "2023-08-06T17:44:44.212111Z", + "iopub.status.idle": "2023-08-06T17:44:44.290879Z", + "shell.execute_reply": "2023-08-06T17:44:44.290584Z" } }, "outputs": [ @@ -1793,32 +1866,33 @@ }, { "cell_type": "markdown", - "id": "000c125e", + "id": "ff56b51f", "metadata": {}, "source": [ "Notice that in the code blocks above, we have ended\n", "the last line with a semicolon. This prevents `ax.plot(x, y)` from printing\n", "text to the notebook. However, it does not prevent a plot from being produced. \n", - " If we omit the trailing semi-colon, then we obtain the following output:" + " If we omit the trailing semi-colon, then we obtain the following output: " ] }, { "cell_type": "code", "execution_count": 43, - "id": "ef41f90d", + "id": "9c1ea81c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:55.928298Z", - "iopub.status.busy": "2023-07-31T02:19:55.928181Z", - "iopub.status.idle": "2023-07-31T02:19:56.006857Z", - "shell.execute_reply": "2023-07-31T02:19:56.006569Z" - } + "iopub.execute_input": "2023-08-06T17:44:44.292652Z", + "iopub.status.busy": "2023-08-06T17:44:44.292524Z", + "iopub.status.idle": "2023-08-06T17:44:44.371306Z", + "shell.execute_reply": "2023-08-06T17:44:44.371033Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 43, @@ -1838,38 +1912,42 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "ax.scatter(x, y, marker='o')" + "ax.scatter(x, y, marker='o')\n" ] }, { "cell_type": "markdown", - "id": "014f66e5", + "id": "abdc9ceb", "metadata": {}, "source": [ "In what follows, we will use\n", " trailing semicolons whenever the text that would be output is not\n", - "germane to the discussion at hand." + "germane to the discussion at hand.\n", + "\n", + "\n", + "\n" ] }, { "cell_type": "markdown", - "id": "98a1db4a", + "id": "4b9491f5", "metadata": {}, "source": [ "To label our plot, we make use of the `set_xlabel()`, `set_ylabel()`, and `set_title()` methods\n", - "of `ax`." + "of `ax`.\n", + " " ] }, { "cell_type": "code", "execution_count": 44, - "id": "16a9cb99", + "id": "e6217bc8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:56.008735Z", - "iopub.status.busy": "2023-07-31T02:19:56.008603Z", - "iopub.status.idle": "2023-07-31T02:19:56.103925Z", - "shell.execute_reply": "2023-07-31T02:19:56.103640Z" + "iopub.execute_input": "2023-08-06T17:44:44.373100Z", + "iopub.status.busy": "2023-08-06T17:44:44.372978Z", + "iopub.status.idle": "2023-08-06T17:44:44.469578Z", + "shell.execute_reply": "2023-08-06T17:44:44.469292Z" } }, "outputs": [ @@ -1894,24 +1972,25 @@ }, { "cell_type": "markdown", - "id": "7f0af2d9", + "id": "e8228a39", "metadata": {}, "source": [ " Having access to the figure object `fig` itself means that we can go in and change some aspects and then redisplay it. Here, we change\n", - " the size from `(8, 8)` to `(12, 3)`." + " the size from `(8, 8)` to `(12, 3)`.\n" ] }, { "cell_type": "code", "execution_count": 45, - "id": "6707420e", + "id": "2feef77c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:56.105616Z", - "iopub.status.busy": "2023-07-31T02:19:56.105506Z", - "iopub.status.idle": "2023-07-31T02:19:56.168565Z", - "shell.execute_reply": "2023-07-31T02:19:56.168059Z" - } + "iopub.execute_input": "2023-08-06T17:44:44.471293Z", + "iopub.status.busy": "2023-08-06T17:44:44.471177Z", + "iopub.status.idle": "2023-08-06T17:44:44.533248Z", + "shell.execute_reply": "2023-08-06T17:44:44.532956Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1933,7 +2012,15 @@ }, { "cell_type": "markdown", - "id": "3cf4ed3f", + "id": "d22f3886", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "e9187ea8", "metadata": {}, "source": [ "Occasionally we will want to create several plots within a figure. This can be\n", @@ -1943,20 +2030,21 @@ "situations, there is often a relationship between the axes in the plots. For example,\n", "all plots may have a common $x$-axis. The `subplots()` function can automatically handle\n", "this situation when passed the keyword argument `sharex=True`.\n", - "The `axes` object below is an array pointing to different plots in the figure." + "The `axes` object below is an array pointing to different plots in the figure. " ] }, { "cell_type": "code", "execution_count": 46, - "id": "6c78ef8b", + "id": "24c9bd3c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:56.172243Z", - "iopub.status.busy": "2023-07-31T02:19:56.172045Z", - "iopub.status.idle": "2023-07-31T02:19:56.596626Z", - "shell.execute_reply": "2023-07-31T02:19:56.596325Z" - } + "iopub.execute_input": "2023-08-06T17:44:44.534878Z", + "iopub.status.busy": "2023-08-06T17:44:44.534763Z", + "iopub.status.idle": "2023-08-06T17:44:44.819697Z", + "shell.execute_reply": "2023-08-06T17:44:44.819421Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1978,7 +2066,7 @@ }, { "cell_type": "markdown", - "id": "40d89b7c", + "id": "7c6bdba5", "metadata": {}, "source": [ "We now produce a scatter plot with `'o'` in the second column of the first row and\n", @@ -1988,14 +2076,15 @@ { "cell_type": "code", "execution_count": 47, - "id": "a18402fb", + "id": "dbe7d87c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:56.598317Z", - "iopub.status.busy": "2023-07-31T02:19:56.598208Z", - "iopub.status.idle": "2023-07-31T02:19:56.792609Z", - "shell.execute_reply": "2023-07-31T02:19:56.792223Z" - } + "iopub.execute_input": "2023-08-06T17:44:44.821358Z", + "iopub.status.busy": "2023-08-06T17:44:44.821244Z", + "iopub.status.idle": "2023-08-06T17:44:45.004111Z", + "shell.execute_reply": "2023-08-06T17:44:45.003828Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2018,16 +2107,18 @@ }, { "cell_type": "markdown", - "id": "d29648ec", + "id": "81d8fa9f", "metadata": {}, "source": [ "Type `subplots?` to learn more about \n", - "`subplots()`." + "`subplots()`. \n", + "\n", + "\n" ] }, { "cell_type": "markdown", - "id": "2a6a0c9e", + "id": "d3760a25", "metadata": {}, "source": [ "To save the output of `fig`, we call its `savefig()`\n", @@ -2038,39 +2129,40 @@ { "cell_type": "code", "execution_count": 48, - "id": "80e18950", + "id": "c86bffe6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:56.794381Z", - "iopub.status.busy": "2023-07-31T02:19:56.794260Z", - "iopub.status.idle": "2023-07-31T02:19:57.918552Z", - "shell.execute_reply": "2023-07-31T02:19:57.918233Z" - } + "iopub.execute_input": "2023-08-06T17:44:45.005700Z", + "iopub.status.busy": "2023-08-06T17:44:45.005580Z", + "iopub.status.idle": "2023-08-06T17:44:46.085677Z", + "shell.execute_reply": "2023-08-06T17:44:46.085363Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ "fig.savefig(\"Figure.png\", dpi=400)\n", - "fig.savefig(\"Figure.pdf\", dpi=200);" + "fig.savefig(\"Figure.pdf\", dpi=200);\n" ] }, { "cell_type": "markdown", - "id": "b8e17a71", + "id": "fd9dbb47", "metadata": {}, "source": [ - "We can continue to modify `fig` using step-by-step updates; for example, we can modify the range of the $x$-axis, re-save the figure, and even re-display it." + "We can continue to modify `fig` using step-by-step updates; for example, we can modify the range of the $x$-axis, re-save the figure, and even re-display it. " ] }, { "cell_type": "code", "execution_count": 49, - "id": "fe8c404d", + "id": "07f180e1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:57.920860Z", - "iopub.status.busy": "2023-07-31T02:19:57.920410Z", - "iopub.status.idle": "2023-07-31T02:19:58.160796Z", - "shell.execute_reply": "2023-07-31T02:19:58.160490Z" + "iopub.execute_input": "2023-08-06T17:44:46.087595Z", + "iopub.status.busy": "2023-08-06T17:44:46.087433Z", + "iopub.status.idle": "2023-08-06T17:44:46.317762Z", + "shell.execute_reply": "2023-08-06T17:44:46.317456Z" } }, "outputs": [ @@ -2094,7 +2186,7 @@ }, { "cell_type": "markdown", - "id": "55bff84e", + "id": "8e013a6f", "metadata": {}, "source": [ "We now create some more sophisticated plots. The \n", @@ -2107,21 +2199,22 @@ "* A matrix whose elements correspond to the `z` value (the third\n", "dimension) for each pair of `(x,y)` coordinates.\n", "\n", - "To create `x` and `y`, we’ll use the function `np.linspace()`. The command `np.linspace(a, b, n)` \n", - "returns a vector of `n` numbers starting at `a` and ending at `b`." + "To create `x` and `y`, we’ll use the command `np.linspace(a, b, n)`, \n", + "which returns a vector of `n` numbers starting at `a` and ending at `b`." ] }, { "cell_type": "code", "execution_count": 50, - "id": "a99034cb", + "id": "a465c3aa", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.162589Z", - "iopub.status.busy": "2023-07-31T02:19:58.162476Z", - "iopub.status.idle": "2023-07-31T02:19:58.263958Z", - "shell.execute_reply": "2023-07-31T02:19:58.263617Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.319492Z", + "iopub.status.busy": "2023-08-06T17:44:46.319369Z", + "iopub.status.idle": "2023-08-06T17:44:46.420916Z", + "shell.execute_reply": "2023-08-06T17:44:46.420589Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2140,12 +2233,12 @@ "x = np.linspace(-np.pi, np.pi, 50)\n", "y = x\n", "f = np.multiply.outer(np.cos(y), 1 / (1 + x**2))\n", - "ax.contour(x, y, f);" + "ax.contour(x, y, f);\n" ] }, { "cell_type": "markdown", - "id": "fd6d00e6", + "id": "df35daed", "metadata": {}, "source": [ "We can increase the resolution by adding more levels to the image." @@ -2154,14 +2247,15 @@ { "cell_type": "code", "execution_count": 51, - "id": "c613a5df", + "id": "469979b0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.265796Z", - "iopub.status.busy": "2023-07-31T02:19:58.265669Z", - "iopub.status.idle": "2023-07-31T02:19:58.395234Z", - "shell.execute_reply": "2023-07-31T02:19:58.394853Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.422857Z", + "iopub.status.busy": "2023-08-06T17:44:46.422743Z", + "iopub.status.idle": "2023-08-06T17:44:46.549561Z", + "shell.execute_reply": "2023-08-06T17:44:46.549260Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2182,7 +2276,7 @@ }, { "cell_type": "markdown", - "id": "c1f2c4bd", + "id": "e6aa9a72", "metadata": {}, "source": [ "To fine-tune the output of the\n", @@ -2199,14 +2293,15 @@ { "cell_type": "code", "execution_count": 52, - "id": "bef21527", + "id": "31092abb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.397112Z", - "iopub.status.busy": "2023-07-31T02:19:58.397015Z", - "iopub.status.idle": "2023-07-31T02:19:58.499871Z", - "shell.execute_reply": "2023-07-31T02:19:58.499547Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.551373Z", + "iopub.status.busy": "2023-08-06T17:44:46.551279Z", + "iopub.status.idle": "2023-08-06T17:44:46.654104Z", + "shell.execute_reply": "2023-08-06T17:44:46.653775Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2222,12 +2317,12 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "ax.imshow(f);" + "ax.imshow(f);\n" ] }, { "cell_type": "markdown", - "id": "35ed7b29", + "id": "aba44db2", "metadata": {}, "source": [ "## Sequences and Slice Notation" @@ -2235,7 +2330,7 @@ }, { "cell_type": "markdown", - "id": "bb0cee76", + "id": "f0edc818", "metadata": {}, "source": [ "As seen above, the\n", @@ -2246,14 +2341,15 @@ { "cell_type": "code", "execution_count": 53, - "id": "4435ed50", + "id": "4e834c17", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.501674Z", - "iopub.status.busy": "2023-07-31T02:19:58.501545Z", - "iopub.status.idle": "2023-07-31T02:19:58.504084Z", - "shell.execute_reply": "2023-07-31T02:19:58.503742Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.655794Z", + "iopub.status.busy": "2023-08-06T17:44:46.655683Z", + "iopub.status.idle": "2023-08-06T17:44:46.658245Z", + "shell.execute_reply": "2023-08-06T17:44:46.657943Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2269,12 +2365,12 @@ ], "source": [ "seq1 = np.linspace(0, 10, 11)\n", - "seq1" + "seq1\n" ] }, { "cell_type": "markdown", - "id": "f1495e1b", + "id": "e95ff002", "metadata": {}, "source": [ "The function `np.arange()`\n", @@ -2285,13 +2381,13 @@ { "cell_type": "code", "execution_count": 54, - "id": "7a2c664a", + "id": "65d67d22", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.505674Z", - "iopub.status.busy": "2023-07-31T02:19:58.505572Z", - "iopub.status.idle": "2023-07-31T02:19:58.507829Z", - "shell.execute_reply": "2023-07-31T02:19:58.507555Z" + "iopub.execute_input": "2023-08-06T17:44:46.659770Z", + "iopub.status.busy": "2023-08-06T17:44:46.659662Z", + "iopub.status.idle": "2023-08-06T17:44:46.661932Z", + "shell.execute_reply": "2023-08-06T17:44:46.661619Z" } }, "outputs": [ @@ -2308,12 +2404,12 @@ ], "source": [ "seq2 = np.arange(0, 10)\n", - "seq2" + "seq2\n" ] }, { "cell_type": "markdown", - "id": "7b0e1b2f", + "id": "09d51db7", "metadata": {}, "source": [ "Why isn't $10$ output above? This has to do with *slice* notation in `Python`. \n", @@ -2326,14 +2422,15 @@ { "cell_type": "code", "execution_count": 55, - "id": "810eafdf", + "id": "676ab564", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.509309Z", - "iopub.status.busy": "2023-07-31T02:19:58.509204Z", - "iopub.status.idle": "2023-07-31T02:19:58.511443Z", - "shell.execute_reply": "2023-07-31T02:19:58.511173Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.663547Z", + "iopub.status.busy": "2023-08-06T17:44:46.663431Z", + "iopub.status.idle": "2023-08-06T17:44:46.665689Z", + "shell.execute_reply": "2023-08-06T17:44:46.665413Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2353,23 +2450,23 @@ }, { "cell_type": "markdown", - "id": "d73d0b54", + "id": "d51b85fc", "metadata": {}, "source": [ "In the code block above, the notation `3:6` is shorthand for `slice(3,6)` when used inside\n", - "`[]`." + "`[]`. " ] }, { "cell_type": "code", "execution_count": 56, - "id": "f7a9f652", + "id": "569f45ab", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.512897Z", - "iopub.status.busy": "2023-07-31T02:19:58.512794Z", - "iopub.status.idle": "2023-07-31T02:19:58.514883Z", - "shell.execute_reply": "2023-07-31T02:19:58.514637Z" + "iopub.execute_input": "2023-08-06T17:44:46.667253Z", + "iopub.status.busy": "2023-08-06T17:44:46.667154Z", + "iopub.status.idle": "2023-08-06T17:44:46.669257Z", + "shell.execute_reply": "2023-08-06T17:44:46.669007Z" } }, "outputs": [ @@ -2385,22 +2482,42 @@ } ], "source": [ - "\"hello world\"[slice(3,6)]" + "\"hello world\"[slice(3,6)]\n" ] }, { "cell_type": "markdown", - "id": "be578cf4", + "id": "b82b891c", "metadata": {}, "source": [ "You might have expected `slice(3,6)` to output the fourth through seventh characters in the text string (recalling that `Python` begins its indexing at zero), but instead it output the fourth through sixth. \n", " This also explains why the earlier `np.arange(0, 10)` command output only the integers from $0$ to $9$. \n", - "See the documentation `slice?` for useful options in creating slices." + "See the documentation `slice?` for useful options in creating slices. \n", + "\n", + " \n", + "\n", + "\n", + "\n", + " \n", + "\n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + "\n", + " \n" ] }, { "cell_type": "markdown", - "id": "7a9c183a", + "id": "46aa45f7", "metadata": {}, "source": [ "## Indexing Data\n", @@ -2410,13 +2527,13 @@ { "cell_type": "code", "execution_count": 57, - "id": "24427538", + "id": "7cf343bd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.516445Z", - "iopub.status.busy": "2023-07-31T02:19:58.516346Z", - "iopub.status.idle": "2023-07-31T02:19:58.518539Z", - "shell.execute_reply": "2023-07-31T02:19:58.518299Z" + "iopub.execute_input": "2023-08-06T17:44:46.670804Z", + "iopub.status.busy": "2023-08-06T17:44:46.670697Z", + "iopub.status.idle": "2023-08-06T17:44:46.673052Z", + "shell.execute_reply": "2023-08-06T17:44:46.672801Z" } }, "outputs": [ @@ -2436,12 +2553,12 @@ ], "source": [ "A = np.array(np.arange(16)).reshape((4, 4))\n", - "A" + "A\n" ] }, { "cell_type": "markdown", - "id": "d2c583a0", + "id": "a396d5a6", "metadata": {}, "source": [ "Typing `A[1,2]` retrieves the element corresponding to the second row and third\n", @@ -2451,13 +2568,13 @@ { "cell_type": "code", "execution_count": 58, - "id": "18684ed5", + "id": "2f4c1b37", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.520019Z", - "iopub.status.busy": "2023-07-31T02:19:58.519923Z", - "iopub.status.idle": "2023-07-31T02:19:58.521980Z", - "shell.execute_reply": "2023-07-31T02:19:58.521677Z" + "iopub.execute_input": "2023-08-06T17:44:46.674647Z", + "iopub.status.busy": "2023-08-06T17:44:46.674533Z", + "iopub.status.idle": "2023-08-06T17:44:46.676931Z", + "shell.execute_reply": "2023-08-06T17:44:46.676679Z" } }, "outputs": [ @@ -2473,12 +2590,12 @@ } ], "source": [ - "A[1,2]" + "A[1,2]\n" ] }, { "cell_type": "markdown", - "id": "b25734ec", + "id": "839feee0", "metadata": {}, "source": [ "The first number after the open-bracket symbol `[`\n", @@ -2492,13 +2609,13 @@ { "cell_type": "code", "execution_count": 59, - "id": "34d27b73", + "id": "a8ef1be5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.523496Z", - "iopub.status.busy": "2023-07-31T02:19:58.523397Z", - "iopub.status.idle": "2023-07-31T02:19:58.525560Z", - "shell.execute_reply": "2023-07-31T02:19:58.525249Z" + "iopub.execute_input": "2023-08-06T17:44:46.678456Z", + "iopub.status.busy": "2023-08-06T17:44:46.678345Z", + "iopub.status.idle": "2023-08-06T17:44:46.680588Z", + "shell.execute_reply": "2023-08-06T17:44:46.680306Z" } }, "outputs": [ @@ -2515,12 +2632,12 @@ } ], "source": [ - "A[[1,3]]" + "A[[1,3]]\n" ] }, { "cell_type": "markdown", - "id": "97149703", + "id": "abe68415", "metadata": {}, "source": [ "To select the first and third columns, we pass in `[0,2]` as the second argument in the square brackets.\n", @@ -2531,13 +2648,13 @@ { "cell_type": "code", "execution_count": 60, - "id": "1bb799c5", + "id": "830897a9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.527101Z", - "iopub.status.busy": "2023-07-31T02:19:58.526990Z", - "iopub.status.idle": "2023-07-31T02:19:58.529215Z", - "shell.execute_reply": "2023-07-31T02:19:58.528954Z" + "iopub.execute_input": "2023-08-06T17:44:46.682117Z", + "iopub.status.busy": "2023-08-06T17:44:46.682023Z", + "iopub.status.idle": "2023-08-06T17:44:46.684256Z", + "shell.execute_reply": "2023-08-06T17:44:46.683990Z" } }, "outputs": [ @@ -2556,12 +2673,12 @@ } ], "source": [ - "A[:,[0,2]]" + "A[:,[0,2]]\n" ] }, { "cell_type": "markdown", - "id": "2b9ce4a3", + "id": "004f3600", "metadata": {}, "source": [ "Now, suppose that we want to select the submatrix made up of the second and fourth \n", @@ -2572,13 +2689,13 @@ { "cell_type": "code", "execution_count": 61, - "id": "de853e7c", + "id": "12e88036", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.530658Z", - "iopub.status.busy": "2023-07-31T02:19:58.530558Z", - "iopub.status.idle": "2023-07-31T02:19:58.532880Z", - "shell.execute_reply": "2023-07-31T02:19:58.532627Z" + "iopub.execute_input": "2023-08-06T17:44:46.685848Z", + "iopub.status.busy": "2023-08-06T17:44:46.685735Z", + "iopub.status.idle": "2023-08-06T17:44:46.687944Z", + "shell.execute_reply": "2023-08-06T17:44:46.687676Z" } }, "outputs": [ @@ -2594,27 +2711,27 @@ } ], "source": [ - "A[[1,3],[0,2]]" + "A[[1,3],[0,2]]\n" ] }, { "cell_type": "markdown", - "id": "dd57a0bf", + "id": "9b978348", "metadata": {}, "source": [ - " Oops --- what happened? We got a one-dimensional array of length 2 identical to" + " Oops --- what happened? We got a one-dimensional array of length two identical to" ] }, { "cell_type": "code", "execution_count": 62, - "id": "e71bf672", + "id": "c4098144", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.534505Z", - "iopub.status.busy": "2023-07-31T02:19:58.534389Z", - "iopub.status.idle": "2023-07-31T02:19:58.536830Z", - "shell.execute_reply": "2023-07-31T02:19:58.536568Z" + "iopub.execute_input": "2023-08-06T17:44:46.689456Z", + "iopub.status.busy": "2023-08-06T17:44:46.689356Z", + "iopub.status.idle": "2023-08-06T17:44:46.691673Z", + "shell.execute_reply": "2023-08-06T17:44:46.691401Z" } }, "outputs": [ @@ -2630,12 +2747,12 @@ } ], "source": [ - "np.array([A[1,0],A[3,2]])" + "np.array([A[1,0],A[3,2]])\n" ] }, { "cell_type": "markdown", - "id": "9cd50d44", + "id": "2dcd98eb", "metadata": {}, "source": [ " Similarly, the following code fails to extract the submatrix comprised of the second and fourth rows and the first, third, and fourth columns:" @@ -2644,13 +2761,13 @@ { "cell_type": "code", "execution_count": 63, - "id": "458fe5c9", + "id": "b4d6bd49", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.538377Z", - "iopub.status.busy": "2023-07-31T02:19:58.538273Z", - "iopub.status.idle": "2023-07-31T02:19:58.561070Z", - "shell.execute_reply": "2023-07-31T02:19:58.560804Z" + "iopub.execute_input": "2023-08-06T17:44:46.693166Z", + "iopub.status.busy": "2023-08-06T17:44:46.693066Z", + "iopub.status.idle": "2023-08-06T17:44:46.715905Z", + "shell.execute_reply": "2023-08-06T17:44:46.715629Z" } }, "outputs": [ @@ -2667,30 +2784,31 @@ } ], "source": [ - "A[[1,3],[0,2,3]]" + "A[[1,3],[0,2,3]]\n" ] }, { "cell_type": "markdown", - "id": "67657309", + "id": "dcac422f", "metadata": {}, "source": [ "We can see what has gone wrong here. When supplied with two indexing lists, the `numpy` interpretation is that these provide pairs of $i,j$ indices for a series of entries. That is why the pair of lists must have the same length. However, that was not our intent, since we are looking for a submatrix.\n", "\n", - "One easy way to do this is as follows. We first create a submatrix by subsetting the rows of `A`, and then on the fly we make a further submatrix by subsetting its columns." + "One easy way to do this is as follows. We first create a submatrix by subsetting the rows of `A`, and then on the fly we make a further submatrix by subsetting its columns.\n" ] }, { "cell_type": "code", "execution_count": 64, - "id": "703832ac", + "id": "e46c3267", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.562524Z", - "iopub.status.busy": "2023-07-31T02:19:58.562447Z", - "iopub.status.idle": "2023-07-31T02:19:58.564964Z", - "shell.execute_reply": "2023-07-31T02:19:58.564682Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.717564Z", + "iopub.status.busy": "2023-08-06T17:44:46.717458Z", + "iopub.status.idle": "2023-08-06T17:44:46.719793Z", + "shell.execute_reply": "2023-08-06T17:44:46.719525Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2706,12 +2824,20 @@ } ], "source": [ - "A[[1,3]][:,[0,2]]" + "A[[1,3]][:,[0,2]]\n" ] }, { "cell_type": "markdown", - "id": "25c3a988", + "id": "d14bb320", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "a3d7e667", "metadata": {}, "source": [ "There are more efficient ways of achieving the same result.\n", @@ -2723,14 +2849,15 @@ { "cell_type": "code", "execution_count": 65, - "id": "dbf328b7", + "id": "96d2355e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.566513Z", - "iopub.status.busy": "2023-07-31T02:19:58.566403Z", - "iopub.status.idle": "2023-07-31T02:19:58.568835Z", - "shell.execute_reply": "2023-07-31T02:19:58.568568Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.721325Z", + "iopub.status.busy": "2023-08-06T17:44:46.721214Z", + "iopub.status.idle": "2023-08-06T17:44:46.723623Z", + "shell.execute_reply": "2023-08-06T17:44:46.723345Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2747,12 +2874,12 @@ ], "source": [ "idx = np.ix_([1,3],[0,2,3])\n", - "A[idx]" + "A[idx]\n" ] }, { "cell_type": "markdown", - "id": "13f73d32", + "id": "d462675f", "metadata": {}, "source": [ "Alternatively, we can subset matrices efficiently using slices.\n", @@ -2765,14 +2892,15 @@ { "cell_type": "code", "execution_count": 66, - "id": "65784eb0", + "id": "326ef740", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.570355Z", - "iopub.status.busy": "2023-07-31T02:19:58.570245Z", - "iopub.status.idle": "2023-07-31T02:19:58.572567Z", - "shell.execute_reply": "2023-07-31T02:19:58.572289Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.725067Z", + "iopub.status.busy": "2023-08-06T17:44:46.724962Z", + "iopub.status.idle": "2023-08-06T17:44:46.727352Z", + "shell.execute_reply": "2023-08-06T17:44:46.727075Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2788,41 +2916,61 @@ } ], "source": [ - "A[1:4:2,0:3:2]" + "A[1:4:2,0:3:2]\n" ] }, { "cell_type": "markdown", - "id": "481bc57a", + "id": "e2eeed28", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "5139b99f", "metadata": {}, "source": [ "Why are we able to retrieve a submatrix directly using slices but not using lists?\n", "Its because they are different `Python` types, and\n", "are treated differently by `numpy`.\n", - "Slices can be used to extract objects from arbitrary sequences, such as strings, lists, and tuples, while the use of lists for indexing is more limited." + "Slices can be used to extract objects from arbitrary sequences, such as strings, lists, and tuples, while the use of lists for indexing is more limited.\n", + "\n", + "\n", + "\n", + "\n", + " \n", + "\n", + " \n", + "\n", + " \n", + "\n", + " " ] }, { "cell_type": "markdown", - "id": "f1c55b8a", + "id": "417c640e", "metadata": {}, "source": [ "### Boolean Indexing\n", "In `numpy`, a *Boolean* is a type that equals either `True` or `False` (also represented as $1$ and $0$, respectively).\n", - "The next line creates a vector of $0$'s, represented as Booleans, of length equal to the first dimension of `A`." + "The next line creates a vector of $0$'s, represented as Booleans, of length equal to the first dimension of `A`. " ] }, { "cell_type": "code", "execution_count": 67, - "id": "3ddb0d83", + "id": "62ad65f2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.574085Z", - "iopub.status.busy": "2023-07-31T02:19:58.573986Z", - "iopub.status.idle": "2023-07-31T02:19:58.576126Z", - "shell.execute_reply": "2023-07-31T02:19:58.575865Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.728977Z", + "iopub.status.busy": "2023-08-06T17:44:46.728881Z", + "iopub.status.idle": "2023-08-06T17:44:46.731155Z", + "shell.execute_reply": "2023-08-06T17:44:46.730869Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2843,22 +2991,22 @@ }, { "cell_type": "markdown", - "id": "f3007c8d", + "id": "117d1718", "metadata": {}, "source": [ - "We now set two of the elements to `True`." + "We now set two of the elements to `True`. " ] }, { "cell_type": "code", "execution_count": 68, - "id": "90e72009", + "id": "683f49a3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.577766Z", - "iopub.status.busy": "2023-07-31T02:19:58.577642Z", - "iopub.status.idle": "2023-07-31T02:19:58.579940Z", - "shell.execute_reply": "2023-07-31T02:19:58.579655Z" + "iopub.execute_input": "2023-08-06T17:44:46.732749Z", + "iopub.status.busy": "2023-08-06T17:44:46.732642Z", + "iopub.status.idle": "2023-08-06T17:44:46.734812Z", + "shell.execute_reply": "2023-08-06T17:44:46.734546Z" } }, "outputs": [ @@ -2875,12 +3023,12 @@ ], "source": [ "keep_rows[[1,3]] = True\n", - "keep_rows" + "keep_rows\n" ] }, { "cell_type": "markdown", - "id": "932dac22", + "id": "5036e0f2", "metadata": {}, "source": [ "Note that the elements of `keep_rows`, when viewed as integers, are the same as the\n", @@ -2891,13 +3039,13 @@ { "cell_type": "code", "execution_count": 69, - "id": "fb3b6534", + "id": "ede73656", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.581598Z", - "iopub.status.busy": "2023-07-31T02:19:58.581485Z", - "iopub.status.idle": "2023-07-31T02:19:58.583765Z", - "shell.execute_reply": "2023-07-31T02:19:58.583490Z" + "iopub.execute_input": "2023-08-06T17:44:46.736256Z", + "iopub.status.busy": "2023-08-06T17:44:46.736141Z", + "iopub.status.idle": "2023-08-06T17:44:46.738461Z", + "shell.execute_reply": "2023-08-06T17:44:46.738206Z" } }, "outputs": [ @@ -2913,12 +3061,12 @@ } ], "source": [ - "np.all(keep_rows == np.array([0,1,0,1]))" + "np.all(keep_rows == np.array([0,1,0,1]))\n" ] }, { "cell_type": "markdown", - "id": "a8cb48c0", + "id": "45587df2", "metadata": {}, "source": [ "(Here, the function `np.all()` has checked whether\n", @@ -2927,23 +3075,23 @@ }, { "cell_type": "markdown", - "id": "ac824821", + "id": "cd3e2b53", "metadata": {}, "source": [ " However, even though `np.array([0,1,0,1])` and `keep_rows` are equal according to `==`, they index different sets of rows!\n", - "The former retrieves the first, second, first, and second rows of `A`." + "The former retrieves the first, second, first, and second rows of `A`. " ] }, { "cell_type": "code", "execution_count": 70, - "id": "b146db22", + "id": "f65c75d6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.585330Z", - "iopub.status.busy": "2023-07-31T02:19:58.585230Z", - "iopub.status.idle": "2023-07-31T02:19:58.587540Z", - "shell.execute_reply": "2023-07-31T02:19:58.587269Z" + "iopub.execute_input": "2023-08-06T17:44:46.740063Z", + "iopub.status.busy": "2023-08-06T17:44:46.739965Z", + "iopub.status.idle": "2023-08-06T17:44:46.742303Z", + "shell.execute_reply": "2023-08-06T17:44:46.742014Z" } }, "outputs": [ @@ -2962,27 +3110,27 @@ } ], "source": [ - "A[np.array([0,1,0,1])]" + "A[np.array([0,1,0,1])]\n" ] }, { "cell_type": "markdown", - "id": "c0b18644", + "id": "12479298", "metadata": {}, "source": [ - " By contrast, `keep_rows` retrieves only the second and fourth rows of `A` --- i.e. the rows for which the Boolean equals `TRUE`." + " By contrast, `keep_rows` retrieves only the second and fourth rows of `A` --- i.e. the rows for which the Boolean equals `TRUE`. " ] }, { "cell_type": "code", "execution_count": 71, - "id": "6bf7b4a3", + "id": "31a8ff76", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.588980Z", - "iopub.status.busy": "2023-07-31T02:19:58.588882Z", - "iopub.status.idle": "2023-07-31T02:19:58.591016Z", - "shell.execute_reply": "2023-07-31T02:19:58.590750Z" + "iopub.execute_input": "2023-08-06T17:44:46.743800Z", + "iopub.status.busy": "2023-08-06T17:44:46.743693Z", + "iopub.status.idle": "2023-08-06T17:44:46.745942Z", + "shell.execute_reply": "2023-08-06T17:44:46.745692Z" } }, "outputs": [ @@ -2999,12 +3147,12 @@ } ], "source": [ - "A[keep_rows]" + "A[keep_rows]\n" ] }, { "cell_type": "markdown", - "id": "80686b74", + "id": "40932333", "metadata": {}, "source": [ "This example shows that Booleans and integers are treated differently by `numpy`." @@ -3012,7 +3160,7 @@ }, { "cell_type": "markdown", - "id": "d7905166", + "id": "8751cf99", "metadata": {}, "source": [ "We again make use of the `np.ix_()` function\n", @@ -3023,13 +3171,13 @@ { "cell_type": "code", "execution_count": 72, - "id": "288011d9", + "id": "c91f330e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.592530Z", - "iopub.status.busy": "2023-07-31T02:19:58.592425Z", - "iopub.status.idle": "2023-07-31T02:19:58.595045Z", - "shell.execute_reply": "2023-07-31T02:19:58.594768Z" + "iopub.execute_input": "2023-08-06T17:44:46.747553Z", + "iopub.status.busy": "2023-08-06T17:44:46.747444Z", + "iopub.status.idle": "2023-08-06T17:44:46.750009Z", + "shell.execute_reply": "2023-08-06T17:44:46.749713Z" } }, "outputs": [ @@ -3049,12 +3197,12 @@ "keep_cols = np.zeros(A.shape[1], bool)\n", "keep_cols[[0, 2, 3]] = True\n", "idx_bool = np.ix_(keep_rows, keep_cols)\n", - "A[idx_bool]" + "A[idx_bool]\n" ] }, { "cell_type": "markdown", - "id": "37900313", + "id": "e8b9619b", "metadata": {}, "source": [ "We can also mix a list with an array of Booleans in the arguments to `np.ix_()`:" @@ -3063,14 +3211,15 @@ { "cell_type": "code", "execution_count": 73, - "id": "3e3b1954", + "id": "fb53de70", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.596526Z", - "iopub.status.busy": "2023-07-31T02:19:58.596423Z", - "iopub.status.idle": "2023-07-31T02:19:58.598772Z", - "shell.execute_reply": "2023-07-31T02:19:58.598514Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.751453Z", + "iopub.status.busy": "2023-08-06T17:44:46.751351Z", + "iopub.status.idle": "2023-08-06T17:44:46.753544Z", + "shell.execute_reply": "2023-08-06T17:44:46.753283Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3087,21 +3236,29 @@ ], "source": [ "idx_mixed = np.ix_([1,3], keep_cols)\n", - "A[idx_mixed]" + "A[idx_mixed]\n" ] }, { "cell_type": "markdown", - "id": "2f4d70f3", + "id": "18f16a0a", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "f6e932f4", "metadata": {}, "source": [ "For more details on indexing in `numpy`, readers are referred\n", - "to the `numpy` tutorial mentioned earlier." + "to the `numpy` tutorial mentioned earlier.\n" ] }, { "cell_type": "markdown", - "id": "3c59c8fb", + "id": "8c59352f", "metadata": {}, "source": [ "## Loading Data\n", @@ -3118,7 +3275,7 @@ }, { "cell_type": "markdown", - "id": "95297c29", + "id": "4417d4d4", "metadata": {}, "source": [ "### Reading in a Data Set\n", @@ -3132,27 +3289,27 @@ "as this notebook file, then we are all set. \n", "Otherwise, \n", "the command\n", - "`os.chdir()` can be used to *change directory*. (You will need to call `import os` before calling `os.chdir()`.)" + "`os.chdir()` can be used to *change directory*. (You will need to call `import os` before calling `os.chdir()`.) " ] }, { "cell_type": "markdown", - "id": "42760180", + "id": "f9fd0896", "metadata": {}, "source": [ - "We will begin by reading in `Auto.csv`, available on the book website. This is a comma-separated file, and can be read in using `pd.read_csv()`:" + "We will begin by reading in `Auto.csv`, available on the book website. This is a comma-separated file, and can be read in using `pd.read_csv()`: " ] }, { "cell_type": "code", "execution_count": 74, - "id": "d02bfb28", + "id": "cc87ed8c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.600410Z", - "iopub.status.busy": "2023-07-31T02:19:58.600309Z", - "iopub.status.idle": "2023-07-31T02:19:58.820725Z", - "shell.execute_reply": "2023-07-31T02:19:58.820427Z" + "iopub.execute_input": "2023-08-06T17:44:46.755171Z", + "iopub.status.busy": "2023-08-06T17:44:46.755065Z", + "iopub.status.idle": "2023-08-06T17:44:46.984772Z", + "shell.execute_reply": "2023-08-06T17:44:46.984442Z" } }, "outputs": [ @@ -3364,12 +3521,12 @@ "source": [ "import pandas as pd\n", "Auto = pd.read_csv('Auto.csv')\n", - "Auto" + "Auto\n" ] }, { "cell_type": "markdown", - "id": "5acc3596", + "id": "5c4cf682", "metadata": {}, "source": [ "The book website also has a whitespace-delimited version of this data, called `Auto.data`. This can be read in as follows:" @@ -3378,49 +3535,52 @@ { "cell_type": "code", "execution_count": 75, - "id": "ca6090af", + "id": "69b34e00", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.822300Z", - "iopub.status.busy": "2023-07-31T02:19:58.822200Z", - "iopub.status.idle": "2023-07-31T02:19:58.825666Z", - "shell.execute_reply": "2023-07-31T02:19:58.825417Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.986269Z", + "iopub.status.busy": "2023-08-06T17:44:46.986168Z", + "iopub.status.idle": "2023-08-06T17:44:46.989605Z", + "shell.execute_reply": "2023-08-06T17:44:46.989331Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "Auto = pd.read_csv('Auto.data', delim_whitespace=True)" + "Auto = pd.read_csv('Auto.data', delim_whitespace=True)\n" ] }, { "cell_type": "markdown", - "id": "350f1f42", + "id": "61b12987", "metadata": {}, "source": [ " Both `Auto.csv` and `Auto.data` are simply text\n", "files. Before loading data into `Python`, it is a good idea to view it using\n", - "a text editor or other software, such as Microsoft Excel." + "a text editor or other software, such as Microsoft Excel.\n", + "\n" ] }, { "cell_type": "markdown", - "id": "1cae3ad2", + "id": "8de34877", "metadata": {}, "source": [ - "We now take a look at the column of `Auto` corresponding to the variable `horsepower`:" + "We now take a look at the column of `Auto` corresponding to the variable `horsepower`: " ] }, { "cell_type": "code", "execution_count": 76, - "id": "7220aa87", + "id": "c45b3e32", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.827227Z", - "iopub.status.busy": "2023-07-31T02:19:58.827134Z", - "iopub.status.idle": "2023-07-31T02:19:58.829740Z", - "shell.execute_reply": "2023-07-31T02:19:58.829490Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.991142Z", + "iopub.status.busy": "2023-08-06T17:44:46.991052Z", + "iopub.status.idle": "2023-08-06T17:44:46.993697Z", + "shell.execute_reply": "2023-08-06T17:44:46.993441Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3446,12 +3606,12 @@ } ], "source": [ - "Auto['horsepower']" + "Auto['horsepower']\n" ] }, { "cell_type": "markdown", - "id": "c0adabf1", + "id": "7b5df8f9", "metadata": {}, "source": [ "We see that the `dtype` of this column is `object`. \n", @@ -3463,14 +3623,15 @@ { "cell_type": "code", "execution_count": 77, - "id": "ca1939f0", + "id": "fdac0ada", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.831176Z", - "iopub.status.busy": "2023-07-31T02:19:58.831087Z", - "iopub.status.idle": "2023-07-31T02:19:58.833413Z", - "shell.execute_reply": "2023-07-31T02:19:58.833176Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.995126Z", + "iopub.status.busy": "2023-08-06T17:44:46.995036Z", + "iopub.status.idle": "2023-08-06T17:44:46.997375Z", + "shell.execute_reply": "2023-08-06T17:44:46.997124Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3498,20 +3659,21 @@ } ], "source": [ - "np.unique(Auto['horsepower'])" + "np.unique(Auto['horsepower'])\n" ] }, { "cell_type": "markdown", - "id": "c35e48dc", + "id": "dc6e92aa", "metadata": {}, "source": [ - "We see the culprit is the value `?`, which is being used to encode missing values." + "We see the culprit is the value `?`, which is being used to encode missing values.\n", + "\n" ] }, { "cell_type": "markdown", - "id": "ccf8e5de", + "id": "f15457ad", "metadata": {}, "source": [ "To fix the problem, we must provide `pd.read_csv()` with an argument called `na_values`.\n", @@ -3522,14 +3684,15 @@ { "cell_type": "code", "execution_count": 78, - "id": "cfb084e7", + "id": "883e0b73", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.834807Z", - "iopub.status.busy": "2023-07-31T02:19:58.834718Z", - "iopub.status.idle": "2023-07-31T02:19:58.838363Z", - "shell.execute_reply": "2023-07-31T02:19:58.838120Z" - } + "iopub.execute_input": "2023-08-06T17:44:46.998839Z", + "iopub.status.busy": "2023-08-06T17:44:46.998751Z", + "iopub.status.idle": "2023-08-06T17:44:47.002360Z", + "shell.execute_reply": "2023-08-06T17:44:47.002105Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -3547,12 +3710,12 @@ "Auto = pd.read_csv('Auto.data',\n", " na_values=['?'],\n", " delim_whitespace=True)\n", - "Auto['horsepower'].sum()" + "Auto['horsepower'].sum()\n" ] }, { "cell_type": "markdown", - "id": "2e8e504f", + "id": "cbc53f2a", "metadata": {}, "source": [ "The `Auto.shape` attribute tells us that the data has 397\n", @@ -3562,13 +3725,13 @@ { "cell_type": "code", "execution_count": 79, - "id": "2e02b6a5", + "id": "c733c1e8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.839782Z", - "iopub.status.busy": "2023-07-31T02:19:58.839709Z", - "iopub.status.idle": "2023-07-31T02:19:58.841717Z", - "shell.execute_reply": "2023-07-31T02:19:58.841484Z" + "iopub.execute_input": "2023-08-06T17:44:47.003760Z", + "iopub.status.busy": "2023-08-06T17:44:47.003683Z", + "iopub.status.idle": "2023-08-06T17:44:47.005701Z", + "shell.execute_reply": "2023-08-06T17:44:47.005460Z" } }, "outputs": [ @@ -3584,12 +3747,12 @@ } ], "source": [ - "Auto.shape" + "Auto.shape\n" ] }, { "cell_type": "markdown", - "id": "df109192", + "id": "94c32cfb", "metadata": {}, "source": [ "There are\n", @@ -3601,14 +3764,15 @@ { "cell_type": "code", "execution_count": 80, - "id": "d391f8d0", + "id": "0e0e9956", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.843111Z", - "iopub.status.busy": "2023-07-31T02:19:58.843031Z", - "iopub.status.idle": "2023-07-31T02:19:58.845585Z", - "shell.execute_reply": "2023-07-31T02:19:58.845354Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.007197Z", + "iopub.status.busy": "2023-08-06T17:44:47.007116Z", + "iopub.status.idle": "2023-08-06T17:44:47.009545Z", + "shell.execute_reply": "2023-08-06T17:44:47.009321Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -3624,12 +3788,12 @@ ], "source": [ "Auto_new = Auto.dropna()\n", - "Auto_new.shape" + "Auto_new.shape\n" ] }, { "cell_type": "markdown", - "id": "e1ddfb53", + "id": "7250498b", "metadata": {}, "source": [ "### Basics of Selecting Rows and Columns\n", @@ -3640,14 +3804,15 @@ { "cell_type": "code", "execution_count": 81, - "id": "a222ca60", + "id": "0477b4ff", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.846908Z", - "iopub.status.busy": "2023-07-31T02:19:58.846837Z", - "iopub.status.idle": "2023-07-31T02:19:58.848998Z", - "shell.execute_reply": "2023-07-31T02:19:58.848769Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.010883Z", + "iopub.status.busy": "2023-08-06T17:44:47.010793Z", + "iopub.status.idle": "2023-08-06T17:44:47.012894Z", + "shell.execute_reply": "2023-08-06T17:44:47.012633Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -3665,12 +3830,12 @@ ], "source": [ "Auto = Auto_new # overwrite the previous value\n", - "Auto.columns" + "Auto.columns\n" ] }, { "cell_type": "markdown", - "id": "be6f2daf", + "id": "c2084300", "metadata": {}, "source": [ "Accessing the rows and columns of a data frame is similar, but not identical, to accessing the rows and columns of an array. \n", @@ -3683,14 +3848,15 @@ { "cell_type": "code", "execution_count": 82, - "id": "a75921ac", + "id": "a989e541", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.850348Z", - "iopub.status.busy": "2023-07-31T02:19:58.850276Z", - "iopub.status.idle": "2023-07-31T02:19:58.854632Z", - "shell.execute_reply": "2023-07-31T02:19:58.854378Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.014269Z", + "iopub.status.busy": "2023-08-06T17:44:47.014179Z", + "iopub.status.idle": "2023-08-06T17:44:47.018504Z", + "shell.execute_reply": "2023-08-06T17:44:47.018245Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3784,12 +3950,12 @@ } ], "source": [ - "Auto[:3]" + "Auto[:3]\n" ] }, { "cell_type": "markdown", - "id": "17c02ad7", + "id": "b5af114e", "metadata": {}, "source": [ "Similarly, an array of Booleans can be used to subset the rows:" @@ -3798,14 +3964,15 @@ { "cell_type": "code", "execution_count": 83, - "id": "7469ff2b", + "id": "d336e7ce", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.856018Z", - "iopub.status.busy": "2023-07-31T02:19:58.855938Z", - "iopub.status.idle": "2023-07-31T02:19:58.868410Z", - "shell.execute_reply": "2023-07-31T02:19:58.868163Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.019899Z", + "iopub.status.busy": "2023-08-06T17:44:47.019821Z", + "iopub.status.idle": "2023-08-06T17:44:47.032395Z", + "shell.execute_reply": "2023-08-06T17:44:47.032144Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -4670,28 +4837,29 @@ ], "source": [ "idx_80 = Auto['year'] > 80\n", - "Auto[idx_80]" + "Auto[idx_80]\n" ] }, { "cell_type": "markdown", - "id": "27eb1780", + "id": "2f09c4df", "metadata": {}, "source": [ - "However, if we pass in a list of strings to the `[]` method, then we obtain a data frame containing the corresponding set of *columns*." + "However, if we pass in a list of strings to the `[]` method, then we obtain a data frame containing the corresponding set of *columns*. " ] }, { "cell_type": "code", "execution_count": 84, - "id": "ac455404", + "id": "88e9a63b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.869894Z", - "iopub.status.busy": "2023-07-31T02:19:58.869804Z", - "iopub.status.idle": "2023-07-31T02:19:58.874286Z", - "shell.execute_reply": "2023-07-31T02:19:58.874040Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.033786Z", + "iopub.status.busy": "2023-08-06T17:44:47.033705Z", + "iopub.status.idle": "2023-08-06T17:44:47.038029Z", + "shell.execute_reply": "2023-08-06T17:44:47.037800Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -4803,12 +4971,12 @@ } ], "source": [ - "Auto[['mpg', 'horsepower']]" + "Auto[['mpg', 'horsepower']]\n" ] }, { "cell_type": "markdown", - "id": "1629d302", + "id": "b372687d", "metadata": {}, "source": [ "Since we did not specify an *index* column when we loaded our data frame, the rows are labeled using integers\n", @@ -4818,14 +4986,15 @@ { "cell_type": "code", "execution_count": 85, - "id": "f41235d4", + "id": "aed049d8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.875720Z", - "iopub.status.busy": "2023-07-31T02:19:58.875641Z", - "iopub.status.idle": "2023-07-31T02:19:58.877794Z", - "shell.execute_reply": "2023-07-31T02:19:58.877564Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.039393Z", + "iopub.status.busy": "2023-08-06T17:44:47.039316Z", + "iopub.status.idle": "2023-08-06T17:44:47.041519Z", + "shell.execute_reply": "2023-08-06T17:44:47.041279Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -4843,28 +5012,28 @@ } ], "source": [ - "Auto.index" + "Auto.index\n" ] }, { "cell_type": "markdown", - "id": "79d3cebb", + "id": "f18f3695", "metadata": {}, "source": [ "We can use the\n", - "`set_index()` method to re-name the rows using the contents of `Auto['name']`." + "`set_index()` method to re-name the rows using the contents of `Auto['name']`. " ] }, { "cell_type": "code", "execution_count": 86, - "id": "31caba24", + "id": "c93cefd3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.879194Z", - "iopub.status.busy": "2023-07-31T02:19:58.879116Z", - "iopub.status.idle": "2023-07-31T02:19:58.885170Z", - "shell.execute_reply": "2023-07-31T02:19:58.884897Z" + "iopub.execute_input": "2023-08-06T17:44:47.043059Z", + "iopub.status.busy": "2023-08-06T17:44:47.042954Z", + "iopub.status.idle": "2023-08-06T17:44:47.048986Z", + "shell.execute_reply": "2023-08-06T17:44:47.048726Z" } }, "outputs": [ @@ -5076,20 +5245,21 @@ ], "source": [ "Auto_re = Auto.set_index('name')\n", - "Auto_re" + "Auto_re\n" ] }, { "cell_type": "code", "execution_count": 87, - "id": "594bedfa", + "id": "84947a78", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.886600Z", - "iopub.status.busy": "2023-07-31T02:19:58.886516Z", - "iopub.status.idle": "2023-07-31T02:19:58.888663Z", - "shell.execute_reply": "2023-07-31T02:19:58.888411Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.050266Z", + "iopub.status.busy": "2023-08-06T17:44:47.050189Z", + "iopub.status.idle": "2023-08-06T17:44:47.052314Z", + "shell.execute_reply": "2023-08-06T17:44:47.052075Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -5106,12 +5276,12 @@ } ], "source": [ - "Auto_re.columns" + "Auto_re.columns\n" ] }, { "cell_type": "markdown", - "id": "184977f2", + "id": "fc160806", "metadata": {}, "source": [ "We see that the column `'name'` is no longer there.\n", @@ -5124,14 +5294,15 @@ { "cell_type": "code", "execution_count": 88, - "id": "9a59b083", + "id": "7ee59fae", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.890089Z", - "iopub.status.busy": "2023-07-31T02:19:58.890009Z", - "iopub.status.idle": "2023-07-31T02:19:58.894256Z", - "shell.execute_reply": "2023-07-31T02:19:58.894030Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.053681Z", + "iopub.status.busy": "2023-08-06T17:44:47.053604Z", + "iopub.status.idle": "2023-08-06T17:44:47.057791Z", + "shell.execute_reply": "2023-08-06T17:44:47.057552Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -5222,12 +5393,12 @@ ], "source": [ "rows = ['amc rebel sst', 'ford torino']\n", - "Auto_re.loc[rows]" + "Auto_re.loc[rows]\n" ] }, { "cell_type": "markdown", - "id": "066af73b", + "id": "232fe34c", "metadata": {}, "source": [ "As an alternative to using the index name, we could retrieve the 4th and 5th rows of `Auto` using the `{iloc[]`} method:" @@ -5236,14 +5407,15 @@ { "cell_type": "code", "execution_count": 89, - "id": "54457a11", + "id": "4b5a0e01", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.895674Z", - "iopub.status.busy": "2023-07-31T02:19:58.895595Z", - "iopub.status.idle": "2023-07-31T02:19:58.899819Z", - "shell.execute_reply": "2023-07-31T02:19:58.899555Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.059126Z", + "iopub.status.busy": "2023-08-06T17:44:47.059053Z", + "iopub.status.idle": "2023-08-06T17:44:47.063134Z", + "shell.execute_reply": "2023-08-06T17:44:47.062896Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -5333,12 +5505,12 @@ } ], "source": [ - "Auto_re.iloc[[3,4]]" + "Auto_re.iloc[[3,4]]\n" ] }, { "cell_type": "markdown", - "id": "069ca71e", + "id": "6c409a01", "metadata": {}, "source": [ "We can also use it to retrieve the 1st, 3rd and and 4th columns of `Auto_re`:" @@ -5347,14 +5519,15 @@ { "cell_type": "code", "execution_count": 90, - "id": "8a4f3faf", + "id": "8814803e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.901242Z", - "iopub.status.busy": "2023-07-31T02:19:58.901166Z", - "iopub.status.idle": "2023-07-31T02:19:58.905836Z", - "shell.execute_reply": "2023-07-31T02:19:58.905588Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.064565Z", + "iopub.status.busy": "2023-08-06T17:44:47.064486Z", + "iopub.status.idle": "2023-08-06T17:44:47.069061Z", + "shell.execute_reply": "2023-08-06T17:44:47.068830Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -5485,12 +5658,12 @@ } ], "source": [ - "Auto_re.iloc[:,[0,2,3]]" + "Auto_re.iloc[:,[0,2,3]]\n" ] }, { "cell_type": "markdown", - "id": "c6f4f9a2", + "id": "f02f0d24", "metadata": {}, "source": [ "We can extract the 4th and 5th rows, as well as the 1st, 3rd and 4th columns, using\n", @@ -5500,14 +5673,15 @@ { "cell_type": "code", "execution_count": 91, - "id": "8f1e6e56", + "id": "c7567dd0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.907325Z", - "iopub.status.busy": "2023-07-31T02:19:58.907236Z", - "iopub.status.idle": "2023-07-31T02:19:58.910862Z", - "shell.execute_reply": "2023-07-31T02:19:58.910565Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.070446Z", + "iopub.status.busy": "2023-08-06T17:44:47.070375Z", + "iopub.status.idle": "2023-08-06T17:44:47.073852Z", + "shell.execute_reply": "2023-08-06T17:44:47.073601Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -5572,12 +5746,12 @@ } ], "source": [ - "Auto_re.iloc[[3,4],[0,2,3]]" + "Auto_re.iloc[[3,4],[0,2,3]]\n" ] }, { "cell_type": "markdown", - "id": "6e4b778c", + "id": "3073ab09", "metadata": {}, "source": [ "Index entries need not be unique: there are several cars in the data frame named `ford galaxie 500`." @@ -5586,14 +5760,15 @@ { "cell_type": "code", "execution_count": 92, - "id": "f1d0e795", + "id": "63638341", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.912283Z", - "iopub.status.busy": "2023-07-31T02:19:58.912205Z", - "iopub.status.idle": "2023-07-31T02:19:58.915809Z", - "shell.execute_reply": "2023-07-31T02:19:58.915515Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.075218Z", + "iopub.status.busy": "2023-08-06T17:44:47.075139Z", + "iopub.status.idle": "2023-08-06T17:44:47.078529Z", + "shell.execute_reply": "2023-08-06T17:44:47.078280Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -5660,12 +5835,12 @@ } ], "source": [ - "Auto_re.loc['ford galaxie 500', ['mpg', 'origin']]" + "Auto_re.loc['ford galaxie 500', ['mpg', 'origin']]\n" ] }, { "cell_type": "markdown", - "id": "b10eabb7", + "id": "2fbe4a9b", "metadata": {}, "source": [ "### More on Selecting Rows and Columns\n", @@ -5678,14 +5853,15 @@ { "cell_type": "code", "execution_count": 93, - "id": "392f10a1", + "id": "57d6de11", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.917357Z", - "iopub.status.busy": "2023-07-31T02:19:58.917238Z", - "iopub.status.idle": "2023-07-31T02:19:58.923725Z", - "shell.execute_reply": "2023-07-31T02:19:58.923444Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.079924Z", + "iopub.status.busy": "2023-08-06T17:44:47.079849Z", + "iopub.status.idle": "2023-08-06T17:44:47.085281Z", + "shell.execute_reply": "2023-08-06T17:44:47.085034Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -6083,28 +6259,29 @@ ], "source": [ "idx_80 = Auto_re['year'] > 80\n", - "Auto_re.loc[idx_80, ['weight', 'origin']]" + "Auto_re.loc[idx_80, ['weight', 'origin']]\n" ] }, { "cell_type": "markdown", - "id": "d3f85975", + "id": "a58067ce", "metadata": {}, "source": [ - "To do this more concisely, we can use an anonymous function called a `lambda`:" + "To do this more concisely, we can use an anonymous function called a `lambda`: " ] }, { "cell_type": "code", "execution_count": 94, - "id": "5f5b7906", + "id": "ed95866c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.925315Z", - "iopub.status.busy": "2023-07-31T02:19:58.925200Z", - "iopub.status.idle": "2023-07-31T02:19:58.931279Z", - "shell.execute_reply": "2023-07-31T02:19:58.931014Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.086682Z", + "iopub.status.busy": "2023-08-06T17:44:47.086607Z", + "iopub.status.idle": "2023-08-06T17:44:47.092129Z", + "shell.execute_reply": "2023-08-06T17:44:47.091888Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -6501,12 +6678,12 @@ } ], "source": [ - "Auto_re.loc[lambda df: df['year'] > 80, ['weight', 'origin']]" + "Auto_re.loc[lambda df: df['year'] > 80, ['weight', 'origin']]\n" ] }, { "cell_type": "markdown", - "id": "cc67849e", + "id": "13bb6d1f", "metadata": {}, "source": [ "The `lambda` call creates a function that takes a single\n", @@ -6520,14 +6697,15 @@ { "cell_type": "code", "execution_count": 95, - "id": "b13c5728", + "id": "e3725c98", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.932750Z", - "iopub.status.busy": "2023-07-31T02:19:58.932655Z", - "iopub.status.idle": "2023-07-31T02:19:58.937659Z", - "shell.execute_reply": "2023-07-31T02:19:58.937405Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.093438Z", + "iopub.status.busy": "2023-08-06T17:44:47.093366Z", + "iopub.status.idle": "2023-08-06T17:44:47.098000Z", + "shell.execute_reply": "2023-08-06T17:44:47.097769Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -6782,12 +6960,12 @@ "source": [ "Auto_re.loc[lambda df: (df['year'] > 80) & (df['mpg'] > 30),\n", " ['weight', 'origin']\n", - " ]" + " ]\n" ] }, { "cell_type": "markdown", - "id": "7885bba9", + "id": "6da7a099", "metadata": {}, "source": [ "The symbol `&` computes an element-wise *and* operation.\n", @@ -6799,14 +6977,15 @@ { "cell_type": "code", "execution_count": 96, - "id": "d5a2c3be", + "id": "f617c333", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.939058Z", - "iopub.status.busy": "2023-07-31T02:19:58.938981Z", - "iopub.status.idle": "2023-07-31T02:19:58.944784Z", - "shell.execute_reply": "2023-07-31T02:19:58.944527Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.099319Z", + "iopub.status.busy": "2023-08-06T17:44:47.099241Z", + "iopub.status.idle": "2023-08-06T17:44:47.105067Z", + "shell.execute_reply": "2023-08-06T17:44:47.104849Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7165,12 +7344,12 @@ " & (df.index.str.contains('ford')\n", " | df.index.str.contains('datsun')),\n", " ['weight', 'origin']\n", - " ]" + " ]\n" ] }, { "cell_type": "markdown", - "id": "8a7a6c62", + "id": "924428a0", "metadata": {}, "source": [ "Here, the symbol `|` computes an element-wise *or* operation.\n", @@ -7189,14 +7368,15 @@ { "cell_type": "code", "execution_count": 97, - "id": "a6278441", + "id": "17f13a72", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.946180Z", - "iopub.status.busy": "2023-07-31T02:19:58.946101Z", - "iopub.status.idle": "2023-07-31T02:19:58.948018Z", - "shell.execute_reply": "2023-07-31T02:19:58.947792Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.106536Z", + "iopub.status.busy": "2023-08-06T17:44:47.106458Z", + "iopub.status.idle": "2023-08-06T17:44:47.108316Z", + "shell.execute_reply": "2023-08-06T17:44:47.108072Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7211,12 +7391,12 @@ "total = 0\n", "for value in [3,2,19]:\n", " total += value\n", - "print('Total is: {0}'.format(total))" + "print('Total is: {0}'.format(total))\n" ] }, { "cell_type": "markdown", - "id": "92948288", + "id": "15f0c1b1", "metadata": {}, "source": [ "The indented code beneath the line with the `for` statement is run\n", @@ -7232,14 +7412,15 @@ { "cell_type": "code", "execution_count": 98, - "id": "2aa065a8", + "id": "07e6a011", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.949452Z", - "iopub.status.busy": "2023-07-31T02:19:58.949334Z", - "iopub.status.idle": "2023-07-31T02:19:58.951372Z", - "shell.execute_reply": "2023-07-31T02:19:58.951143Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.109780Z", + "iopub.status.busy": "2023-08-06T17:44:47.109691Z", + "iopub.status.idle": "2023-08-06T17:44:47.111636Z", + "shell.execute_reply": "2023-08-06T17:44:47.111408Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7260,7 +7441,7 @@ }, { "cell_type": "markdown", - "id": "aaeb60c5", + "id": "fd8124cb", "metadata": {}, "source": [ "Above, we summed over each combination of `value` and `weight`.\n", @@ -7283,13 +7464,13 @@ { "cell_type": "code", "execution_count": 99, - "id": "832c1b7d", + "id": "377ab16f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.952776Z", - "iopub.status.busy": "2023-07-31T02:19:58.952701Z", - "iopub.status.idle": "2023-07-31T02:19:58.954676Z", - "shell.execute_reply": "2023-07-31T02:19:58.954428Z" + "iopub.execute_input": "2023-08-06T17:44:47.113038Z", + "iopub.status.busy": "2023-08-06T17:44:47.112949Z", + "iopub.status.idle": "2023-08-06T17:44:47.114837Z", + "shell.execute_reply": "2023-08-06T17:44:47.114609Z" } }, "outputs": [ @@ -7306,12 +7487,12 @@ "for value, weight in zip([2,3,19],\n", " [0.2,0.3,0.5]):\n", " total += weight * value\n", - "print('Weighted average is: {0}'.format(total))" + "print('Weighted average is: {0}'.format(total))\n" ] }, { "cell_type": "markdown", - "id": "ac163d59", + "id": "345a595b", "metadata": {}, "source": [ "### String Formatting\n", @@ -7338,14 +7519,15 @@ { "cell_type": "code", "execution_count": 100, - "id": "2ca2e7cd", + "id": "91276344", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.956035Z", - "iopub.status.busy": "2023-07-31T02:19:58.955955Z", - "iopub.status.idle": "2023-07-31T02:19:58.960636Z", - "shell.execute_reply": "2023-07-31T02:19:58.960393Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.116243Z", + "iopub.status.busy": "2023-08-06T17:44:47.116152Z", + "iopub.status.idle": "2023-08-06T17:44:47.120630Z", + "shell.execute_reply": "2023-08-06T17:44:47.120383Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -7427,20 +7609,21 @@ " 'pickle',\n", " 'snack',\n", " 'popcorn'])\n", - "D[:3]" + "D[:3]\n" ] }, { "cell_type": "code", "execution_count": 101, - "id": "d8ae1dcc", + "id": "c655fcd1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.962038Z", - "iopub.status.busy": "2023-07-31T02:19:58.961965Z", - "iopub.status.idle": "2023-07-31T02:19:58.964439Z", - "shell.execute_reply": "2023-07-31T02:19:58.964187Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.122014Z", + "iopub.status.busy": "2023-08-06T17:44:47.121932Z", + "iopub.status.idle": "2023-08-06T17:44:47.124432Z", + "shell.execute_reply": "2023-08-06T17:44:47.124188Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7459,12 +7642,12 @@ "for col in D.columns:\n", " template = 'Column \"{0}\" has {1:.2%} missing values'\n", " print(template.format(col,\n", - " np.isnan(D[col]).mean()))" + " np.isnan(D[col]).mean()))\n" ] }, { "cell_type": "markdown", - "id": "e4687a4a", + "id": "7267a350", "metadata": {}, "source": [ "We see that the `template.format()` method expects two arguments `{0}`\n", @@ -7478,7 +7661,7 @@ }, { "cell_type": "markdown", - "id": "22226024", + "id": "763fe84a", "metadata": {}, "source": [ "## Additional Graphical and Numerical Summaries\n", @@ -7489,14 +7672,15 @@ { "cell_type": "code", "execution_count": 102, - "id": "30a8a663", + "id": "cd9e0046", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:58.965855Z", - "iopub.status.busy": "2023-07-31T02:19:58.965769Z", - "iopub.status.idle": "2023-07-31T02:19:59.059137Z", - "shell.execute_reply": "2023-07-31T02:19:59.058798Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.125901Z", + "iopub.status.busy": "2023-08-06T17:44:47.125812Z", + "iopub.status.idle": "2023-08-06T17:44:47.219348Z", + "shell.execute_reply": "2023-08-06T17:44:47.219031Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7528,7 +7712,7 @@ }, { "cell_type": "markdown", - "id": "f09f4e10", + "id": "0f0f16b8", "metadata": {}, "source": [ "We can address this by accessing the columns directly:" @@ -7537,14 +7721,15 @@ { "cell_type": "code", "execution_count": 103, - "id": "81fdedb1", + "id": "49d239e5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.060801Z", - "iopub.status.busy": "2023-07-31T02:19:59.060700Z", - "iopub.status.idle": "2023-07-31T02:19:59.151129Z", - "shell.execute_reply": "2023-07-31T02:19:59.150780Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.221132Z", + "iopub.status.busy": "2023-08-06T17:44:47.221021Z", + "iopub.status.idle": "2023-08-06T17:44:47.309097Z", + "shell.execute_reply": "2023-08-06T17:44:47.308817Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7560,32 +7745,33 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "ax.plot(Auto['horsepower'], Auto['mpg'], 'o');" + "ax.plot(Auto['horsepower'], Auto['mpg'], 'o');\n" ] }, { "cell_type": "markdown", - "id": "a64455fa", + "id": "154e405c", "metadata": {}, "source": [ "Alternatively, we can use the `plot()` method with the call `Auto.plot()`.\n", "Using this method,\n", "the variables can be accessed by name.\n", "The plot methods of a data frame return a familiar object:\n", - "an axes. We can use it to update the plot as we did previously:" + "an axes. We can use it to update the plot as we did previously: " ] }, { "cell_type": "code", "execution_count": 104, - "id": "61850515", + "id": "5c892a6a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.152898Z", - "iopub.status.busy": "2023-07-31T02:19:59.152782Z", - "iopub.status.idle": "2023-07-31T02:19:59.249760Z", - "shell.execute_reply": "2023-07-31T02:19:59.249444Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.310772Z", + "iopub.status.busy": "2023-08-06T17:44:47.310600Z", + "iopub.status.idle": "2023-08-06T17:44:47.408029Z", + "shell.execute_reply": "2023-08-06T17:44:47.407733Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7616,7 +7802,7 @@ }, { "cell_type": "markdown", - "id": "7c73790f", + "id": "74ed42da", "metadata": {}, "source": [ "If we want to save\n", @@ -7627,13 +7813,13 @@ { "cell_type": "code", "execution_count": 105, - "id": "f2e0c165", + "id": "92a626b0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.251454Z", - "iopub.status.busy": "2023-07-31T02:19:59.251353Z", - "iopub.status.idle": "2023-07-31T02:19:59.291857Z", - "shell.execute_reply": "2023-07-31T02:19:59.291567Z" + "iopub.execute_input": "2023-08-06T17:44:47.409678Z", + "iopub.status.busy": "2023-08-06T17:44:47.409555Z", + "iopub.status.idle": "2023-08-06T17:44:47.449669Z", + "shell.execute_reply": "2023-08-06T17:44:47.449382Z" } }, "outputs": [], @@ -7644,7 +7830,7 @@ }, { "cell_type": "markdown", - "id": "2378a5bb", + "id": "7c47c9a8", "metadata": {}, "source": [ "We can further instruct the data frame to plot to a particular axes object. In this\n", @@ -7658,13 +7844,13 @@ { "cell_type": "code", "execution_count": 106, - "id": "35c72e77", + "id": "bf9771b9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.293503Z", - "iopub.status.busy": "2023-07-31T02:19:59.293415Z", - "iopub.status.idle": "2023-07-31T02:19:59.462765Z", - "shell.execute_reply": "2023-07-31T02:19:59.462430Z" + "iopub.execute_input": "2023-08-06T17:44:47.451420Z", + "iopub.status.busy": "2023-08-06T17:44:47.451314Z", + "iopub.status.idle": "2023-08-06T17:44:47.622582Z", + "shell.execute_reply": "2023-08-06T17:44:47.622279Z" } }, "outputs": [ @@ -7681,20 +7867,20 @@ ], "source": [ "fig, axes = subplots(ncols=3, figsize=(15, 5))\n", - "Auto.plot.scatter('horsepower', 'mpg', ax=axes[1]);" + "Auto.plot.scatter('horsepower', 'mpg', ax=axes[1]);\n" ] }, { "cell_type": "markdown", - "id": "95b0f3de", + "id": "a27e61c6", "metadata": {}, "source": [ - "Note also that the columns of a data frame can be accessed as attributes: try typing in `Auto.horsepower`." + "Note also that the columns of a data frame can be accessed as attributes: try typing in `Auto.horsepower`. " ] }, { "cell_type": "markdown", - "id": "5c6c4fa2", + "id": "7d4e028a", "metadata": {}, "source": [ "We now consider the `cylinders` variable. Typing in `Auto.cylinders.dtype` reveals that it is being treated as a quantitative variable. \n", @@ -7706,14 +7892,15 @@ { "cell_type": "code", "execution_count": 107, - "id": "2b6fb1ad", + "id": "745d2c5f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.464559Z", - "iopub.status.busy": "2023-07-31T02:19:59.464441Z", - "iopub.status.idle": "2023-07-31T02:19:59.467500Z", - "shell.execute_reply": "2023-07-31T02:19:59.467197Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.624352Z", + "iopub.status.busy": "2023-08-06T17:44:47.624220Z", + "iopub.status.idle": "2023-08-06T17:44:47.627666Z", + "shell.execute_reply": "2023-08-06T17:44:47.627359Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7729,12 +7916,12 @@ ], "source": [ "Auto.cylinders = pd.Series(Auto.cylinders, dtype='category')\n", - "Auto.cylinders.dtype" + "Auto.cylinders.dtype\n" ] }, { "cell_type": "markdown", - "id": "2038c16d", + "id": "d9c6dc9e", "metadata": {}, "source": [ " Now that `cylinders` is qualitative, we can display it using\n", @@ -7744,13 +7931,13 @@ { "cell_type": "code", "execution_count": 108, - "id": "1f19f48c", + "id": "8b1069bc", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.469015Z", - "iopub.status.busy": "2023-07-31T02:19:59.468931Z", - "iopub.status.idle": "2023-07-31T02:19:59.576174Z", - "shell.execute_reply": "2023-07-31T02:19:59.575830Z" + "iopub.execute_input": "2023-08-06T17:44:47.629273Z", + "iopub.status.busy": "2023-08-06T17:44:47.629176Z", + "iopub.status.idle": "2023-08-06T17:44:47.736110Z", + "shell.execute_reply": "2023-08-06T17:44:47.735790Z" } }, "outputs": [ @@ -7767,12 +7954,12 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "Auto.boxplot('mpg', by='cylinders', ax=ax);" + "Auto.boxplot('mpg', by='cylinders', ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "4ae72e1b", + "id": "f96288b4", "metadata": {}, "source": [ "The `hist()` method can be used to plot a *histogram*." @@ -7781,14 +7968,15 @@ { "cell_type": "code", "execution_count": 109, - "id": "929b6901", + "id": "d9faa85a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.577889Z", - "iopub.status.busy": "2023-07-31T02:19:59.577777Z", - "iopub.status.idle": "2023-07-31T02:19:59.680396Z", - "shell.execute_reply": "2023-07-31T02:19:59.680097Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.737744Z", + "iopub.status.busy": "2023-08-06T17:44:47.737633Z", + "iopub.status.idle": "2023-08-06T17:44:47.840290Z", + "shell.execute_reply": "2023-08-06T17:44:47.839977Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7804,12 +7992,12 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "Auto.hist('mpg', ax=ax);" + "Auto.hist('mpg', ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "db7f6e7c", + "id": "8f743bb2", "metadata": {}, "source": [ "The color of the bars and the number of bins can be changed:" @@ -7818,14 +8006,15 @@ { "cell_type": "code", "execution_count": 110, - "id": "8d48f1e9", + "id": "59d4a0b6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.682075Z", - "iopub.status.busy": "2023-07-31T02:19:59.681968Z", - "iopub.status.idle": "2023-07-31T02:19:59.779240Z", - "shell.execute_reply": "2023-07-31T02:19:59.778959Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.841851Z", + "iopub.status.busy": "2023-08-06T17:44:47.841742Z", + "iopub.status.idle": "2023-08-06T17:44:47.938350Z", + "shell.execute_reply": "2023-08-06T17:44:47.938066Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7841,12 +8030,12 @@ ], "source": [ "fig, ax = subplots(figsize=(8, 8))\n", - "Auto.hist('mpg', color='red', bins=12, ax=ax);" + "Auto.hist('mpg', color='red', bins=12, ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "0e53b8b6", + "id": "59d4f72f", "metadata": {}, "source": [ " See `Auto.hist?` for more plotting\n", @@ -7859,14 +8048,15 @@ { "cell_type": "code", "execution_count": 111, - "id": "400690e6", + "id": "fb5ed57d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:19:59.781028Z", - "iopub.status.busy": "2023-07-31T02:19:59.780913Z", - "iopub.status.idle": "2023-07-31T02:20:00.729186Z", - "shell.execute_reply": "2023-07-31T02:20:00.728923Z" - } + "iopub.execute_input": "2023-08-06T17:44:47.940123Z", + "iopub.status.busy": "2023-08-06T17:44:47.939990Z", + "iopub.status.idle": "2023-08-06T17:44:48.895176Z", + "shell.execute_reply": "2023-08-06T17:44:48.894902Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7881,12 +8071,12 @@ } ], "source": [ - "pd.plotting.scatter_matrix(Auto);" + "pd.plotting.scatter_matrix(Auto);\n" ] }, { "cell_type": "markdown", - "id": "48a9a4f5", + "id": "7f671845", "metadata": {}, "source": [ " We can also produce scatterplots\n", @@ -7896,14 +8086,15 @@ { "cell_type": "code", "execution_count": 112, - "id": "6bbeca8b", + "id": "8e117e38", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:20:00.730857Z", - "iopub.status.busy": "2023-07-31T02:20:00.730752Z", - "iopub.status.idle": "2023-07-31T02:20:00.952615Z", - "shell.execute_reply": "2023-07-31T02:20:00.952298Z" - } + "iopub.execute_input": "2023-08-06T17:44:48.896866Z", + "iopub.status.busy": "2023-08-06T17:44:48.896756Z", + "iopub.status.idle": "2023-08-06T17:44:49.119272Z", + "shell.execute_reply": "2023-08-06T17:44:49.118911Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -7920,12 +8111,12 @@ "source": [ "pd.plotting.scatter_matrix(Auto[['mpg',\n", " 'displacement',\n", - " 'weight']]);" + " 'weight']]);\n" ] }, { "cell_type": "markdown", - "id": "d3bb4736", + "id": "97921078", "metadata": {}, "source": [ "The `describe()` method produces a numerical summary of each column in a data frame." @@ -7934,14 +8125,15 @@ { "cell_type": "code", "execution_count": 113, - "id": "1727f604", + "id": "9e0b12f2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:20:00.954233Z", - "iopub.status.busy": "2023-07-31T02:20:00.954113Z", - "iopub.status.idle": "2023-07-31T02:20:00.960067Z", - "shell.execute_reply": "2023-07-31T02:20:00.959797Z" - } + "iopub.execute_input": "2023-08-06T17:44:49.121032Z", + "iopub.status.busy": "2023-08-06T17:44:49.120921Z", + "iopub.status.idle": "2023-08-06T17:44:49.126814Z", + "shell.execute_reply": "2023-08-06T17:44:49.126535Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -8032,12 +8224,12 @@ } ], "source": [ - "Auto[['mpg', 'weight']].describe()" + "Auto[['mpg', 'weight']].describe()\n" ] }, { "cell_type": "markdown", - "id": "1b508635", + "id": "93fc12de", "metadata": {}, "source": [ "We can also produce a summary of just a single column." @@ -8046,14 +8238,15 @@ { "cell_type": "code", "execution_count": 114, - "id": "39bf4091", + "id": "ba4aa0f6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:20:00.961663Z", - "iopub.status.busy": "2023-07-31T02:20:00.961547Z", - "iopub.status.idle": "2023-07-31T02:20:00.965751Z", - "shell.execute_reply": "2023-07-31T02:20:00.965471Z" - } + "iopub.execute_input": "2023-08-06T17:44:49.128408Z", + "iopub.status.busy": "2023-08-06T17:44:49.128319Z", + "iopub.status.idle": "2023-08-06T17:44:49.132582Z", + "shell.execute_reply": "2023-08-06T17:44:49.132299Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -8077,23 +8270,26 @@ ], "source": [ "Auto['cylinders'].describe()\n", - "Auto['mpg'].describe()" + "Auto['mpg'].describe()\n" ] }, { "cell_type": "markdown", - "id": "22ecf5c3", + "id": "c029ae61", "metadata": {}, "source": [ - "To exit `Jupyter`, select `File / Close and Halt`." + "To exit `Jupyter`, select `File / Close and Halt`.\n", + "\n", + " \n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch3-linreg-lab.ipynb b/Ch3-linreg-lab.ipynb index a70b9db..910b824 100644 --- a/Ch3-linreg-lab.ipynb +++ b/Ch3-linreg-lab.ipynb @@ -5,7 +5,9 @@ "id": "82bce88a", "metadata": {}, "source": [ - "# Chapter 3" + "\n", + "# Chapter 3\n", + "\n" ] }, { @@ -26,17 +28,18 @@ "id": "ca5277a6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:37.098059Z", - "iopub.status.busy": "2023-07-31T02:14:37.097629Z", - "iopub.status.idle": "2023-07-31T02:14:37.599285Z", - "shell.execute_reply": "2023-07-31T02:14:37.598959Z" - } + "iopub.execute_input": "2023-08-06T17:34:45.279319Z", + "iopub.status.busy": "2023-08-06T17:34:45.279082Z", + "iopub.status.idle": "2023-08-06T17:34:45.953848Z", + "shell.execute_reply": "2023-08-06T17:34:45.953518Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", - "from matplotlib.pyplot import subplots" + "from matplotlib.pyplot import subplots\n" ] }, { @@ -58,15 +61,16 @@ "id": "675f24e6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:37.601365Z", - "iopub.status.busy": "2023-07-31T02:14:37.601115Z", - "iopub.status.idle": "2023-07-31T02:14:38.189274Z", - "shell.execute_reply": "2023-07-31T02:14:38.188923Z" - } + "iopub.execute_input": "2023-08-06T17:34:45.955884Z", + "iopub.status.busy": "2023-08-06T17:34:45.955666Z", + "iopub.status.idle": "2023-08-06T17:34:46.765820Z", + "shell.execute_reply": "2023-08-06T17:34:46.765525Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "import statsmodels.api as sm" + "import statsmodels.api as sm\n" ] }, { @@ -90,17 +94,17 @@ "id": "a0ee23c2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.191201Z", - "iopub.status.busy": "2023-07-31T02:14:38.191048Z", - "iopub.status.idle": "2023-07-31T02:14:38.194262Z", - "shell.execute_reply": "2023-07-31T02:14:38.194012Z" + "iopub.execute_input": "2023-08-06T17:34:46.767689Z", + "iopub.status.busy": "2023-08-06T17:34:46.767547Z", + "iopub.status.idle": "2023-08-06T17:34:46.770326Z", + "shell.execute_reply": "2023-08-06T17:34:46.770048Z" } }, "outputs": [], "source": [ "from statsmodels.stats.outliers_influence \\\n", " import variance_inflation_factor as VIF\n", - "from statsmodels.stats.anova import anova_lm" + "from statsmodels.stats.anova import anova_lm\n" ] }, { @@ -121,10 +125,10 @@ "id": "b35eb887", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.195737Z", - "iopub.status.busy": "2023-07-31T02:14:38.195636Z", - "iopub.status.idle": "2023-07-31T02:14:38.348861Z", - "shell.execute_reply": "2023-07-31T02:14:38.348443Z" + "iopub.execute_input": "2023-08-06T17:34:46.771834Z", + "iopub.status.busy": "2023-08-06T17:34:46.771733Z", + "iopub.status.idle": "2023-08-06T17:34:46.958904Z", + "shell.execute_reply": "2023-08-06T17:34:46.958467Z" } }, "outputs": [], @@ -132,7 +136,7 @@ "from ISLP import load_data\n", "from ISLP.models import (ModelSpec as MS,\n", " summarize,\n", - " poly)" + " poly)\n" ] }, { @@ -153,11 +157,12 @@ "id": "961908f7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.351011Z", - "iopub.status.busy": "2023-07-31T02:14:38.350696Z", - "iopub.status.idle": "2023-07-31T02:14:38.354455Z", - "shell.execute_reply": "2023-07-31T02:14:38.354198Z" - } + "iopub.execute_input": "2023-08-06T17:34:46.960948Z", + "iopub.status.busy": "2023-08-06T17:34:46.960687Z", + "iopub.status.idle": "2023-08-06T17:34:46.964347Z", + "shell.execute_reply": "2023-08-06T17:34:46.964073Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -208,7 +213,7 @@ } ], "source": [ - "dir()" + "dir()\n" ] }, { @@ -233,11 +238,12 @@ "id": "662caa15", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.355929Z", - "iopub.status.busy": "2023-07-31T02:14:38.355825Z", - "iopub.status.idle": "2023-07-31T02:14:38.358768Z", - "shell.execute_reply": "2023-07-31T02:14:38.358500Z" - } + "iopub.execute_input": "2023-08-06T17:34:46.966063Z", + "iopub.status.busy": "2023-08-06T17:34:46.965960Z", + "iopub.status.idle": "2023-08-06T17:34:46.968939Z", + "shell.execute_reply": "2023-08-06T17:34:46.968662Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -418,7 +424,7 @@ ], "source": [ "A = np.array([3,5,11])\n", - "dir(A)" + "dir(A)\n" ] }, { @@ -436,11 +442,12 @@ "id": "ebb7d126", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.360173Z", - "iopub.status.busy": "2023-07-31T02:14:38.360095Z", - "iopub.status.idle": "2023-07-31T02:14:38.362221Z", - "shell.execute_reply": "2023-07-31T02:14:38.361978Z" - } + "iopub.execute_input": "2023-08-06T17:34:46.970359Z", + "iopub.status.busy": "2023-08-06T17:34:46.970263Z", + "iopub.status.idle": "2023-08-06T17:34:46.972364Z", + "shell.execute_reply": "2023-08-06T17:34:46.972124Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -455,7 +462,15 @@ } ], "source": [ - "A.sum()" + "A.sum()\n" + ] + }, + { + "cell_type": "markdown", + "id": "3b9db985", + "metadata": {}, + "source": [ + " " ] }, { @@ -485,10 +500,10 @@ "id": "1ea46cee", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.363717Z", - "iopub.status.busy": "2023-07-31T02:14:38.363629Z", - "iopub.status.idle": "2023-07-31T02:14:38.368806Z", - "shell.execute_reply": "2023-07-31T02:14:38.368543Z" + "iopub.execute_input": "2023-08-06T17:34:46.973818Z", + "iopub.status.busy": "2023-08-06T17:34:46.973741Z", + "iopub.status.idle": "2023-08-06T17:34:46.982452Z", + "shell.execute_reply": "2023-08-06T17:34:46.982201Z" } }, "outputs": [ @@ -507,7 +522,7 @@ ], "source": [ "Boston = load_data(\"Boston\")\n", - "Boston.columns" + "Boston.columns\n" ] }, { @@ -520,7 +535,7 @@ "We start by using the `sm.OLS()` function to fit a\n", "simple linear regression model. Our response will be\n", " `medv` and `lstat` will be the single predictor.\n", - "For this model, we can create the model matrix by hand." + "For this model, we can create the model matrix by hand.\n" ] }, { @@ -529,10 +544,10 @@ "id": "26c0ba88", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.370249Z", - "iopub.status.busy": "2023-07-31T02:14:38.370153Z", - "iopub.status.idle": "2023-07-31T02:14:38.375404Z", - "shell.execute_reply": "2023-07-31T02:14:38.375134Z" + "iopub.execute_input": "2023-08-06T17:34:46.983850Z", + "iopub.status.busy": "2023-08-06T17:34:46.983745Z", + "iopub.status.idle": "2023-08-06T17:34:46.990247Z", + "shell.execute_reply": "2023-08-06T17:34:46.990002Z" } }, "outputs": [ @@ -602,7 +617,7 @@ "source": [ "X = pd.DataFrame({'intercept': np.ones(Boston.shape[0]),\n", " 'lstat': Boston['lstat']})\n", - "X[:4]" + "X[:4]\n" ] }, { @@ -619,17 +634,18 @@ "id": "d4dd511b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.376828Z", - "iopub.status.busy": "2023-07-31T02:14:38.376741Z", - "iopub.status.idle": "2023-07-31T02:14:38.379010Z", - "shell.execute_reply": "2023-07-31T02:14:38.378764Z" - } + "iopub.execute_input": "2023-08-06T17:34:46.991664Z", + "iopub.status.busy": "2023-08-06T17:34:46.991561Z", + "iopub.status.idle": "2023-08-06T17:34:46.994290Z", + "shell.execute_reply": "2023-08-06T17:34:46.994049Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "y = Boston['medv']\n", "model = sm.OLS(y, X)\n", - "results = model.fit()" + "results = model.fit()\n" ] }, { @@ -653,11 +669,12 @@ "id": "eef9f8e3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.380359Z", - "iopub.status.busy": "2023-07-31T02:14:38.380275Z", - "iopub.status.idle": "2023-07-31T02:14:38.437623Z", - "shell.execute_reply": "2023-07-31T02:14:38.437333Z" - } + "iopub.execute_input": "2023-08-06T17:34:46.995620Z", + "iopub.status.busy": "2023-08-06T17:34:46.995530Z", + "iopub.status.idle": "2023-08-06T17:34:47.057569Z", + "shell.execute_reply": "2023-08-06T17:34:47.057305Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -718,7 +735,7 @@ } ], "source": [ - "summarize(results)" + "summarize(results)\n" ] }, { @@ -754,7 +771,7 @@ "initial computations on it, as specified in the transform object.\n", "For example, it may compute means and standard deviations for centering and scaling.\n", "The `transform()` \n", - "method applies the fitted transformation to the array of data, and produces the model matrix." + "method applies the fitted transformation to the array of data, and produces the model matrix.\n" ] }, { @@ -763,11 +780,12 @@ "id": "557170d4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.439217Z", - "iopub.status.busy": "2023-07-31T02:14:38.439073Z", - "iopub.status.idle": "2023-07-31T02:14:38.443761Z", - "shell.execute_reply": "2023-07-31T02:14:38.443507Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.059196Z", + "iopub.status.busy": "2023-08-06T17:34:47.059050Z", + "iopub.status.idle": "2023-08-06T17:34:47.063793Z", + "shell.execute_reply": "2023-08-06T17:34:47.063548Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -857,11 +875,12 @@ "id": "b83ec097", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.445159Z", - "iopub.status.busy": "2023-07-31T02:14:38.445084Z", - "iopub.status.idle": "2023-07-31T02:14:38.449274Z", - "shell.execute_reply": "2023-07-31T02:14:38.449028Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.065239Z", + "iopub.status.busy": "2023-08-06T17:34:47.065152Z", + "iopub.status.idle": "2023-08-06T17:34:47.069286Z", + "shell.execute_reply": "2023-08-06T17:34:47.068998Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -960,10 +979,10 @@ "id": "d4dce5f6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.450699Z", - "iopub.status.busy": "2023-07-31T02:14:38.450620Z", - "iopub.status.idle": "2023-07-31T02:14:38.459848Z", - "shell.execute_reply": "2023-07-31T02:14:38.459594Z" + "iopub.execute_input": "2023-08-06T17:34:47.070742Z", + "iopub.status.busy": "2023-08-06T17:34:47.070666Z", + "iopub.status.idle": "2023-08-06T17:34:47.079919Z", + "shell.execute_reply": "2023-08-06T17:34:47.079672Z" } }, "outputs": [ @@ -982,10 +1001,10 @@ " Method: Least Squares F-statistic: 601.6\n", "\n", "\n", - " Date: Sun, 30 Jul 2023 Prob (F-statistic): 5.08e-88\n", + " Date: Sun, 06 Aug 2023 Prob (F-statistic): 5.08e-88\n", "\n", "\n", - " Time: 22:14:38 Log-Likelihood: -1641.5\n", + " Time: 10:34:47 Log-Likelihood: -1641.5\n", "\n", "\n", " No. Observations: 506 AIC: 3287.\n", @@ -1033,8 +1052,8 @@ "\\textbf{Dep. Variable:} & medv & \\textbf{ R-squared: } & 0.544 \\\\\n", "\\textbf{Model:} & OLS & \\textbf{ Adj. R-squared: } & 0.543 \\\\\n", "\\textbf{Method:} & Least Squares & \\textbf{ F-statistic: } & 601.6 \\\\\n", - "\\textbf{Date:} & Sun, 30 Jul 2023 & \\textbf{ Prob (F-statistic):} & 5.08e-88 \\\\\n", - "\\textbf{Time:} & 22:14:38 & \\textbf{ Log-Likelihood: } & -1641.5 \\\\\n", + "\\textbf{Date:} & Sun, 06 Aug 2023 & \\textbf{ Prob (F-statistic):} & 5.08e-88 \\\\\n", + "\\textbf{Time:} & 10:34:47 & \\textbf{ Log-Likelihood: } & -1641.5 \\\\\n", "\\textbf{No. Observations:} & 506 & \\textbf{ AIC: } & 3287. \\\\\n", "\\textbf{Df Residuals:} & 504 & \\textbf{ BIC: } & 3295. \\\\\n", "\\textbf{Df Model:} & 1 & \\textbf{ } & \\\\\n", @@ -1069,8 +1088,8 @@ "Dep. Variable: medv R-squared: 0.544\n", "Model: OLS Adj. R-squared: 0.543\n", "Method: Least Squares F-statistic: 601.6\n", - "Date: Sun, 30 Jul 2023 Prob (F-statistic): 5.08e-88\n", - "Time: 22:14:38 Log-Likelihood: -1641.5\n", + "Date: Sun, 06 Aug 2023 Prob (F-statistic): 5.08e-88\n", + "Time: 10:34:47 Log-Likelihood: -1641.5\n", "No. Observations: 506 AIC: 3287.\n", "Df Residuals: 504 BIC: 3295.\n", "Df Model: 1 \n", @@ -1098,7 +1117,7 @@ } ], "source": [ - "results.summary()" + "results.summary()\n" ] }, { @@ -1116,11 +1135,12 @@ "id": "a0edf555", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.461298Z", - "iopub.status.busy": "2023-07-31T02:14:38.461215Z", - "iopub.status.idle": "2023-07-31T02:14:38.463809Z", - "shell.execute_reply": "2023-07-31T02:14:38.463563Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.081336Z", + "iopub.status.busy": "2023-08-06T17:34:47.081257Z", + "iopub.status.idle": "2023-08-06T17:34:47.083680Z", + "shell.execute_reply": "2023-08-06T17:34:47.083425Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1137,7 +1157,7 @@ } ], "source": [ - "results.params" + "results.params\n" ] }, { @@ -1158,10 +1178,10 @@ "id": "fdc5a3f3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.465231Z", - "iopub.status.busy": "2023-07-31T02:14:38.465150Z", - "iopub.status.idle": "2023-07-31T02:14:38.468821Z", - "shell.execute_reply": "2023-07-31T02:14:38.468569Z" + "iopub.execute_input": "2023-08-06T17:34:47.085093Z", + "iopub.status.busy": "2023-08-06T17:34:47.085015Z", + "iopub.status.idle": "2023-08-06T17:34:47.088625Z", + "shell.execute_reply": "2023-08-06T17:34:47.088392Z" } }, "outputs": [ @@ -1225,7 +1245,7 @@ "source": [ "new_df = pd.DataFrame({'lstat':[5, 10, 15]})\n", "newX = design.transform(new_df)\n", - "newX" + "newX\n" ] }, { @@ -1242,11 +1262,12 @@ "id": "2c6acbf0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.470242Z", - "iopub.status.busy": "2023-07-31T02:14:38.470162Z", - "iopub.status.idle": "2023-07-31T02:14:38.472450Z", - "shell.execute_reply": "2023-07-31T02:14:38.472199Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.090091Z", + "iopub.status.busy": "2023-08-06T17:34:47.090008Z", + "iopub.status.idle": "2023-08-06T17:34:47.092428Z", + "shell.execute_reply": "2023-08-06T17:34:47.092183Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1262,7 +1283,7 @@ ], "source": [ "new_predictions = results.get_prediction(newX);\n", - "new_predictions.predicted_mean" + "new_predictions.predicted_mean\n" ] }, { @@ -1279,11 +1300,12 @@ "id": "c472ef33", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.473835Z", - "iopub.status.busy": "2023-07-31T02:14:38.473762Z", - "iopub.status.idle": "2023-07-31T02:14:38.476010Z", - "shell.execute_reply": "2023-07-31T02:14:38.475756Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.093785Z", + "iopub.status.busy": "2023-08-06T17:34:47.093688Z", + "iopub.status.idle": "2023-08-06T17:34:47.096010Z", + "shell.execute_reply": "2023-08-06T17:34:47.095781Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1300,7 +1322,7 @@ } ], "source": [ - "new_predictions.conf_int(alpha=0.05)" + "new_predictions.conf_int(alpha=0.05)\n" ] }, { @@ -1317,11 +1339,12 @@ "id": "3e2ffc7a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.477420Z", - "iopub.status.busy": "2023-07-31T02:14:38.477344Z", - "iopub.status.idle": "2023-07-31T02:14:38.479639Z", - "shell.execute_reply": "2023-07-31T02:14:38.479371Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.097324Z", + "iopub.status.busy": "2023-08-06T17:34:47.097234Z", + "iopub.status.idle": "2023-08-06T17:34:47.099513Z", + "shell.execute_reply": "2023-08-06T17:34:47.099275Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1338,7 +1361,7 @@ } ], "source": [ - "new_predictions.conf_int(obs=True, alpha=0.05)" + "new_predictions.conf_int(obs=True, alpha=0.05)\n" ] }, { @@ -1376,11 +1399,12 @@ "id": "4e56a1d3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.481027Z", - "iopub.status.busy": "2023-07-31T02:14:38.480949Z", - "iopub.status.idle": "2023-07-31T02:14:38.482803Z", - "shell.execute_reply": "2023-07-31T02:14:38.482553Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.100972Z", + "iopub.status.busy": "2023-08-06T17:34:47.100892Z", + "iopub.status.idle": "2023-08-06T17:34:47.102793Z", + "shell.execute_reply": "2023-08-06T17:34:47.102549Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -1388,7 +1412,7 @@ " \"Add a line with slope m and intercept b to ax\"\n", " xlim = ax.get_xlim()\n", " ylim = [m * xlim[0] + b, m * xlim[1] + b]\n", - " ax.plot(xlim, ylim)" + " ax.plot(xlim, ylim)\n" ] }, { @@ -1409,11 +1433,12 @@ "id": "7f43ffe7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.484281Z", - "iopub.status.busy": "2023-07-31T02:14:38.484202Z", - "iopub.status.idle": "2023-07-31T02:14:38.486090Z", - "shell.execute_reply": "2023-07-31T02:14:38.485818Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.104148Z", + "iopub.status.busy": "2023-08-06T17:34:47.104079Z", + "iopub.status.idle": "2023-08-06T17:34:47.106062Z", + "shell.execute_reply": "2023-08-06T17:34:47.105836Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -1421,7 +1446,7 @@ " \"Add a line with slope m and intercept b to ax\"\n", " xlim = ax.get_xlim()\n", " ylim = [m * xlim[0] + b, m * xlim[1] + b]\n", - " ax.plot(xlim, ylim, *args, **kwargs)" + " ax.plot(xlim, ylim, *args, **kwargs)\n" ] }, { @@ -1448,11 +1473,12 @@ "id": "3f7b67c9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.487491Z", - "iopub.status.busy": "2023-07-31T02:14:38.487422Z", - "iopub.status.idle": "2023-07-31T02:14:38.594015Z", - "shell.execute_reply": "2023-07-31T02:14:38.593271Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.107460Z", + "iopub.status.busy": "2023-08-06T17:34:47.107386Z", + "iopub.status.idle": "2023-08-06T17:34:47.254700Z", + "shell.execute_reply": "2023-08-06T17:34:47.253915Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1472,7 +1498,7 @@ " results.params[0],\n", " results.params[1],\n", " 'r--',\n", - " linewidth=3)" + " linewidth=3)\n" ] }, { @@ -1485,7 +1511,8 @@ "an argument to make it of width 3.\n", "There is some evidence for non-linearity in the relationship between `lstat` and `medv`. We will explore this issue later in this lab.\n", "\n", - "As mentioned above, there is an existing function to add a line to a plot --- `ax.axline()` --- but knowing how to write such functions empowers us to create more expressive displays." + "As mentioned above, there is an existing function to add a line to a plot --- `ax.axline()` --- but knowing how to write such functions empowers us to create more expressive displays.\n", + "\n" ] }, { @@ -1510,11 +1537,12 @@ "id": "b35a2fd3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.597846Z", - "iopub.status.busy": "2023-07-31T02:14:38.597587Z", - "iopub.status.idle": "2023-07-31T02:14:38.716373Z", - "shell.execute_reply": "2023-07-31T02:14:38.714325Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.259557Z", + "iopub.status.busy": "2023-08-06T17:34:47.259229Z", + "iopub.status.idle": "2023-08-06T17:34:47.402403Z", + "shell.execute_reply": "2023-08-06T17:34:47.402135Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1533,7 +1561,7 @@ "ax.scatter(results.fittedvalues, results.resid)\n", "ax.set_xlabel('Fitted value')\n", "ax.set_ylabel('Residual')\n", - "ax.axhline(0, c='k', ls='--');" + "ax.axhline(0, c='k', ls='--');\n" ] }, { @@ -1557,11 +1585,12 @@ "id": "82673b80", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.720789Z", - "iopub.status.busy": "2023-07-31T02:14:38.720353Z", - "iopub.status.idle": "2023-07-31T02:14:38.829000Z", - "shell.execute_reply": "2023-07-31T02:14:38.828696Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.404190Z", + "iopub.status.busy": "2023-08-06T17:34:47.404052Z", + "iopub.status.idle": "2023-08-06T17:34:47.494230Z", + "shell.execute_reply": "2023-08-06T17:34:47.493905Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1591,7 +1620,7 @@ "ax.scatter(np.arange(X.shape[0]), infl.hat_matrix_diag)\n", "ax.set_xlabel('Index')\n", "ax.set_ylabel('Leverage')\n", - "np.argmax(infl.hat_matrix_diag)" + "np.argmax(infl.hat_matrix_diag)\n" ] }, { @@ -1624,11 +1653,12 @@ "id": "54596dc4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.830833Z", - "iopub.status.busy": "2023-07-31T02:14:38.830723Z", - "iopub.status.idle": "2023-07-31T02:14:38.841593Z", - "shell.execute_reply": "2023-07-31T02:14:38.841314Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.495999Z", + "iopub.status.busy": "2023-08-06T17:34:47.495872Z", + "iopub.status.idle": "2023-08-06T17:34:47.506251Z", + "shell.execute_reply": "2023-08-06T17:34:47.505979Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1721,10 +1751,10 @@ "id": "75c78238", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.843301Z", - "iopub.status.busy": "2023-07-31T02:14:38.843182Z", - "iopub.status.idle": "2023-07-31T02:14:38.845817Z", - "shell.execute_reply": "2023-07-31T02:14:38.845544Z" + "iopub.execute_input": "2023-08-06T17:34:47.508238Z", + "iopub.status.busy": "2023-08-06T17:34:47.508087Z", + "iopub.status.idle": "2023-08-06T17:34:47.510826Z", + "shell.execute_reply": "2023-08-06T17:34:47.510491Z" } }, "outputs": [ @@ -1743,7 +1773,7 @@ ], "source": [ "terms = Boston.columns.drop('medv')\n", - "terms" + "terms\n" ] }, { @@ -1761,10 +1791,10 @@ "id": "f14b9e1a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.847324Z", - "iopub.status.busy": "2023-07-31T02:14:38.847229Z", - "iopub.status.idle": "2023-07-31T02:14:38.861947Z", - "shell.execute_reply": "2023-07-31T02:14:38.861682Z" + "iopub.execute_input": "2023-08-06T17:34:47.512561Z", + "iopub.status.busy": "2023-08-06T17:34:47.512448Z", + "iopub.status.idle": "2023-08-06T17:34:47.526980Z", + "shell.execute_reply": "2023-08-06T17:34:47.526612Z" } }, "outputs": [ @@ -1917,7 +1947,7 @@ "X = MS(terms).fit_transform(Boston)\n", "model = sm.OLS(y, X)\n", "results = model.fit()\n", - "summarize(results)" + "summarize(results)\n" ] }, { @@ -1937,10 +1967,10 @@ "id": "0a2714b1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.863470Z", - "iopub.status.busy": "2023-07-31T02:14:38.863382Z", - "iopub.status.idle": "2023-07-31T02:14:38.877283Z", - "shell.execute_reply": "2023-07-31T02:14:38.877001Z" + "iopub.execute_input": "2023-08-06T17:34:47.528637Z", + "iopub.status.busy": "2023-08-06T17:34:47.528526Z", + "iopub.status.idle": "2023-08-06T17:34:47.542270Z", + "shell.execute_reply": "2023-08-06T17:34:47.541976Z" } }, "outputs": [ @@ -2085,7 +2115,7 @@ "minus_age = Boston.columns.drop(['medv', 'age']) \n", "Xma = MS(minus_age).fit_transform(Boston)\n", "model1 = sm.OLS(y, Xma)\n", - "summarize(model1.fit())" + "summarize(model1.fit())\n" ] }, { @@ -2116,7 +2146,7 @@ "lists of `Python` objects. The language also supports\n", "dictionary and *generator* comprehension, though these are\n", "beyond our scope here. Let's look at an example. We compute the VIF for each of the variables\n", - "in the model matrix `X`, using the function `variance_inflation_factor()`." + "in the model matrix `X`, using the function `variance_inflation_factor()`.\n" ] }, { @@ -2125,11 +2155,12 @@ "id": "961c9128", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.878849Z", - "iopub.status.busy": "2023-07-31T02:14:38.878736Z", - "iopub.status.idle": "2023-07-31T02:14:38.885983Z", - "shell.execute_reply": "2023-07-31T02:14:38.885709Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.543839Z", + "iopub.status.busy": "2023-08-06T17:34:47.543752Z", + "iopub.status.idle": "2023-08-06T17:34:47.551040Z", + "shell.execute_reply": "2023-08-06T17:34:47.550770Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2235,7 +2266,7 @@ " for i in range(1, X.shape[1])]\n", "vif = pd.DataFrame({'vif':vals},\n", " index=X.columns[1:])\n", - "vif" + "vif\n" ] }, { @@ -2256,17 +2287,18 @@ "id": "4886f9e9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.887620Z", - "iopub.status.busy": "2023-07-31T02:14:38.887509Z", - "iopub.status.idle": "2023-07-31T02:14:38.892708Z", - "shell.execute_reply": "2023-07-31T02:14:38.892460Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.552596Z", + "iopub.status.busy": "2023-08-06T17:34:47.552485Z", + "iopub.status.idle": "2023-08-06T17:34:47.557775Z", + "shell.execute_reply": "2023-08-06T17:34:47.557510Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "vals = []\n", "for i in range(1, X.values.shape[1]):\n", - " vals.append(VIF(X.values, i))" + " vals.append(VIF(X.values, i))\n" ] }, { @@ -2288,11 +2320,12 @@ "id": "b54d2da1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.894293Z", - "iopub.status.busy": "2023-07-31T02:14:38.894204Z", - "iopub.status.idle": "2023-07-31T02:14:38.904859Z", - "shell.execute_reply": "2023-07-31T02:14:38.904591Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.559401Z", + "iopub.status.busy": "2023-08-06T17:34:47.559315Z", + "iopub.status.idle": "2023-08-06T17:34:47.570264Z", + "shell.execute_reply": "2023-08-06T17:34:47.570004Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2373,7 +2406,7 @@ " 'age',\n", " ('lstat', 'age')]).fit_transform(Boston)\n", "model2 = sm.OLS(y, X)\n", - "summarize(model2.fit())" + "summarize(model2.fit())\n" ] }, { @@ -2395,11 +2428,12 @@ "id": "1b71633a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.906973Z", - "iopub.status.busy": "2023-07-31T02:14:38.906845Z", - "iopub.status.idle": "2023-07-31T02:14:38.918896Z", - "shell.execute_reply": "2023-07-31T02:14:38.918604Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.571718Z", + "iopub.status.busy": "2023-08-06T17:34:47.571635Z", + "iopub.status.idle": "2023-08-06T17:34:47.583621Z", + "shell.execute_reply": "2023-08-06T17:34:47.583342Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2479,7 +2513,7 @@ "X = MS([poly('lstat', degree=2), 'age']).fit_transform(Boston)\n", "model3 = sm.OLS(y, X)\n", "results3 = model3.fit()\n", - "summarize(results3)" + "summarize(results3)\n" ] }, { @@ -2512,11 +2546,12 @@ "id": "6d30a306", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.920531Z", - "iopub.status.busy": "2023-07-31T02:14:38.920425Z", - "iopub.status.idle": "2023-07-31T02:14:38.926296Z", - "shell.execute_reply": "2023-07-31T02:14:38.926036Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.585282Z", + "iopub.status.busy": "2023-08-06T17:34:47.585169Z", + "iopub.status.idle": "2023-08-06T17:34:47.591106Z", + "shell.execute_reply": "2023-08-06T17:34:47.590768Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2583,7 +2618,7 @@ } ], "source": [ - "anova_lm(results1, results3)" + "anova_lm(results1, results3)\n" ] }, { @@ -2612,7 +2647,7 @@ "The function `anova_lm()` can take more than two nested models\n", "as input, in which case it compares every successive pair of models.\n", "That also explains why their are `NaN`s in the first row above, since\n", - "there is no previous model with which to compare the first." + "there is no previous model with which to compare the first.\n" ] }, { @@ -2621,17 +2656,18 @@ "id": "9a5ec13f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:38.927819Z", - "iopub.status.busy": "2023-07-31T02:14:38.927721Z", - "iopub.status.idle": "2023-07-31T02:14:39.027635Z", - "shell.execute_reply": "2023-07-31T02:14:39.027301Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.592639Z", + "iopub.status.busy": "2023-08-06T17:34:47.592536Z", + "iopub.status.idle": "2023-08-06T17:34:47.692002Z", + "shell.execute_reply": "2023-08-06T17:34:47.691684Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 34, @@ -2654,7 +2690,7 @@ "ax.scatter(results3.fittedvalues, results3.resid)\n", "ax.set_xlabel('Fitted value')\n", "ax.set_ylabel('Residual')\n", - "ax.axhline(0, c='k', ls='--')" + "ax.axhline(0, c='k', ls='--')\n" ] }, { @@ -2665,7 +2701,7 @@ "We see that when the quadratic term is included in the model,\n", "there is little discernible pattern in the residuals.\n", "In order to create a cubic or higher-degree polynomial fit, we can simply change the degree argument\n", - "to `poly()`." + "to `poly()`.\n" ] }, { @@ -2686,11 +2722,12 @@ "id": "09bbc0c6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:39.029410Z", - "iopub.status.busy": "2023-07-31T02:14:39.029292Z", - "iopub.status.idle": "2023-07-31T02:14:39.034985Z", - "shell.execute_reply": "2023-07-31T02:14:39.034677Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.693776Z", + "iopub.status.busy": "2023-08-06T17:34:47.693649Z", + "iopub.status.idle": "2023-08-06T17:34:47.700319Z", + "shell.execute_reply": "2023-08-06T17:34:47.700055Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2708,7 +2745,7 @@ ], "source": [ "Carseats = load_data('Carseats')\n", - "Carseats.columns" + "Carseats.columns\n" ] }, { @@ -2736,11 +2773,12 @@ "id": "2e1da1fa", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:39.036665Z", - "iopub.status.busy": "2023-07-31T02:14:39.036539Z", - "iopub.status.idle": "2023-07-31T02:14:39.057391Z", - "shell.execute_reply": "2023-07-31T02:14:39.057099Z" - } + "iopub.execute_input": "2023-08-06T17:34:47.701981Z", + "iopub.status.busy": "2023-08-06T17:34:47.701852Z", + "iopub.status.idle": "2023-08-06T17:34:47.722346Z", + "shell.execute_reply": "2023-08-06T17:34:47.722062Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2903,7 +2941,7 @@ " ('Price', 'Age')]\n", "X = MS(final).fit_transform(Carseats)\n", "model = sm.OLS(y, X)\n", - "summarize(model.fit())" + "summarize(model.fit())\n" ] }, { @@ -2922,15 +2960,16 @@ "positive indicates that a good shelving location is associated with high sales (relative to a bad location).\n", "And `ShelveLoc[Medium]` has a smaller positive coefficient,\n", "indicating that a medium shelving location leads to higher sales than a bad\n", - "shelving location, but lower sales than a good shelving location." + "shelving location, but lower sales than a good shelving location.\n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch4-classification-lab.ipynb b/Ch4-classification-lab.ipynb index daa47b2..d9a9c90 100644 --- a/Ch4-classification-lab.ipynb +++ b/Ch4-classification-lab.ipynb @@ -2,23 +2,26 @@ "cells": [ { "cell_type": "markdown", - "id": "e6cc127e", + "id": "cb3c07d1", "metadata": {}, "source": [ - "# Chapter 4" + "\n", + "# Chapter 4\n", + "\n", + "\n" ] }, { "cell_type": "markdown", - "id": "af3093e5", + "id": "daef3e2e", "metadata": {}, "source": [ - "# Lab: Logistic Regression, LDA, QDA, and KNN" + "# Lab: Logistic Regression, LDA, QDA, and KNN\n" ] }, { "cell_type": "markdown", - "id": "a4e58fe1", + "id": "3cb93478", "metadata": {}, "source": [ "## The Stock Market Data\n", @@ -40,13 +43,13 @@ { "cell_type": "code", "execution_count": 1, - "id": "71523a7f", + "id": "7b8d78b9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:40.325132Z", - "iopub.status.busy": "2023-07-31T02:14:40.324680Z", - "iopub.status.idle": "2023-07-31T02:14:41.370472Z", - "shell.execute_reply": "2023-07-31T02:14:41.370081Z" + "iopub.execute_input": "2023-08-06T17:34:48.984438Z", + "iopub.status.busy": "2023-08-06T17:34:48.984147Z", + "iopub.status.idle": "2023-08-06T17:34:50.014450Z", + "shell.execute_reply": "2023-08-06T17:34:50.013816Z" } }, "outputs": [], @@ -62,7 +65,7 @@ }, { "cell_type": "markdown", - "id": "4759a767", + "id": "f420141c", "metadata": {}, "source": [ "We also collect together the new imports needed for this lab." @@ -71,14 +74,15 @@ { "cell_type": "code", "execution_count": 2, - "id": "901ed7c5", + "id": "b5938862", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.372738Z", - "iopub.status.busy": "2023-07-31T02:14:41.372471Z", - "iopub.status.idle": "2023-07-31T02:14:41.389931Z", - "shell.execute_reply": "2023-07-31T02:14:41.389646Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.016761Z", + "iopub.status.busy": "2023-08-06T17:34:50.016466Z", + "iopub.status.idle": "2023-08-06T17:34:50.037738Z", + "shell.execute_reply": "2023-08-06T17:34:50.037473Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ @@ -91,12 +95,12 @@ "from sklearn.neighbors import KNeighborsClassifier\n", "from sklearn.preprocessing import StandardScaler\n", "from sklearn.model_selection import train_test_split\n", - "from sklearn.linear_model import LogisticRegression" + "from sklearn.linear_model import LogisticRegression\n" ] }, { "cell_type": "markdown", - "id": "dd5a4d61", + "id": "34413b1c", "metadata": {}, "source": [ "Now we are ready to load the `Smarket` data." @@ -105,14 +109,15 @@ { "cell_type": "code", "execution_count": 3, - "id": "8b56ee0f", + "id": "e9fdf040", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.391561Z", - "iopub.status.busy": "2023-07-31T02:14:41.391451Z", - "iopub.status.idle": "2023-07-31T02:14:41.402806Z", - "shell.execute_reply": "2023-07-31T02:14:41.402527Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.039423Z", + "iopub.status.busy": "2023-08-06T17:34:50.039307Z", + "iopub.status.idle": "2023-08-06T17:34:50.052006Z", + "shell.execute_reply": "2023-08-06T17:34:50.051756Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -314,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "400eb0f9", + "id": "d3533960", "metadata": {}, "source": [ "This gives a truncated listing of the data.\n", @@ -324,14 +329,15 @@ { "cell_type": "code", "execution_count": 4, - "id": "62d49b47", + "id": "69d5cfae", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.404304Z", - "iopub.status.busy": "2023-07-31T02:14:41.404209Z", - "iopub.status.idle": "2023-07-31T02:14:41.406450Z", - "shell.execute_reply": "2023-07-31T02:14:41.406198Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.053494Z", + "iopub.status.busy": "2023-08-06T17:34:50.053400Z", + "iopub.status.idle": "2023-08-06T17:34:50.055808Z", + "shell.execute_reply": "2023-08-06T17:34:50.055549Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -353,7 +359,7 @@ }, { "cell_type": "markdown", - "id": "82e38285", + "id": "c1e0cc8c", "metadata": {}, "source": [ "We compute the correlation matrix using the `corr()` method\n", @@ -361,20 +367,21 @@ "the pairwise correlations among the variables.\n", " \n", "By instructing `pandas` to use only numeric variables, the `corr()` method does not report a correlation for the `Direction` variable because it is\n", - "qualitative." + " qualitative." ] }, { "cell_type": "code", "execution_count": 5, - "id": "bc34e7b7", + "id": "a4c0648e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.407806Z", - "iopub.status.busy": "2023-07-31T02:14:41.407714Z", - "iopub.status.idle": "2023-07-31T02:14:41.412417Z", - "shell.execute_reply": "2023-07-31T02:14:41.412175Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.057221Z", + "iopub.status.busy": "2023-08-06T17:34:50.057127Z", + "iopub.status.idle": "2023-08-06T17:34:50.061952Z", + "shell.execute_reply": "2023-08-06T17:34:50.061721Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -529,32 +536,33 @@ } ], "source": [ - "Smarket.corr(numeric_only=True)" + "Smarket.corr(numeric_only=True)\n" ] }, { "cell_type": "markdown", - "id": "53a52be5", + "id": "c68bb37a", "metadata": {}, "source": [ "As one would expect, the correlations between the lagged return variables and\n", "today’s return are close to zero. The only substantial correlation is between `Year` and\n", " `Volume`. By plotting the data we see that `Volume`\n", "is increasing over time. In other words, the average number of shares traded\n", - "daily increased from 2001 to 2005." + "daily increased from 2001 to 2005.\n" ] }, { "cell_type": "code", "execution_count": 6, - "id": "9f075144", + "id": "cd40274b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.413837Z", - "iopub.status.busy": "2023-07-31T02:14:41.413752Z", - "iopub.status.idle": "2023-07-31T02:14:41.533365Z", - "shell.execute_reply": "2023-07-31T02:14:41.532005Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.063425Z", + "iopub.status.busy": "2023-08-06T17:34:50.063336Z", + "iopub.status.idle": "2023-08-06T17:34:50.183910Z", + "shell.execute_reply": "2023-08-06T17:34:50.181946Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -569,12 +577,12 @@ } ], "source": [ - "Smarket.plot(y='Volume');" + "Smarket.plot(y='Volume');\n" ] }, { "cell_type": "markdown", - "id": "b8428c9e", + "id": "685b96e8", "metadata": {}, "source": [ "## Logistic Regression\n", @@ -593,14 +601,15 @@ { "cell_type": "code", "execution_count": 7, - "id": "2ab15aa3", + "id": "35b8bffe", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.537766Z", - "iopub.status.busy": "2023-07-31T02:14:41.537504Z", - "iopub.status.idle": "2023-07-31T02:14:41.642638Z", - "shell.execute_reply": "2023-07-31T02:14:41.641325Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.187799Z", + "iopub.status.busy": "2023-08-06T17:34:50.187442Z", + "iopub.status.idle": "2023-08-06T17:34:50.293260Z", + "shell.execute_reply": "2023-08-06T17:34:50.292298Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -709,12 +718,12 @@ " X,\n", " family=sm.families.Binomial())\n", "results = glm.fit()\n", - "summarize(results)" + "summarize(results)\n" ] }, { "cell_type": "markdown", - "id": "ce1f682c", + "id": "68cca865", "metadata": {}, "source": [ "The smallest *p*-value here is associated with `Lag1`. The\n", @@ -732,14 +741,15 @@ { "cell_type": "code", "execution_count": 8, - "id": "0faa6a6c", + "id": "4f9c5324", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.647058Z", - "iopub.status.busy": "2023-07-31T02:14:41.646077Z", - "iopub.status.idle": "2023-07-31T02:14:41.656939Z", - "shell.execute_reply": "2023-07-31T02:14:41.655796Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.297671Z", + "iopub.status.busy": "2023-08-06T17:34:50.297156Z", + "iopub.status.idle": "2023-08-06T17:34:50.305507Z", + "shell.execute_reply": "2023-08-06T17:34:50.303828Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -761,12 +771,12 @@ } ], "source": [ - "results.params" + "results.params\n" ] }, { "cell_type": "markdown", - "id": "b989df1d", + "id": "681ca0cb", "metadata": {}, "source": [ "Likewise we can use the\n", @@ -776,13 +786,13 @@ { "cell_type": "code", "execution_count": 9, - "id": "108aff98", + "id": "75e44d01", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.665137Z", - "iopub.status.busy": "2023-07-31T02:14:41.664124Z", - "iopub.status.idle": "2023-07-31T02:14:41.675522Z", - "shell.execute_reply": "2023-07-31T02:14:41.674386Z" + "iopub.execute_input": "2023-08-06T17:34:50.309998Z", + "iopub.status.busy": "2023-08-06T17:34:50.309526Z", + "iopub.status.idle": "2023-08-06T17:34:50.317199Z", + "shell.execute_reply": "2023-08-06T17:34:50.316460Z" } }, "outputs": [ @@ -805,12 +815,12 @@ } ], "source": [ - "results.pvalues" + "results.pvalues\n" ] }, { "cell_type": "markdown", - "id": "5c5c1f8e", + "id": "d4fd87bf", "metadata": {}, "source": [ "The `predict()` method of `results` can be used to predict the\n", @@ -827,14 +837,15 @@ { "cell_type": "code", "execution_count": 10, - "id": "54b4b96c", + "id": "40164af5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.679830Z", - "iopub.status.busy": "2023-07-31T02:14:41.679368Z", - "iopub.status.idle": "2023-07-31T02:14:41.685281Z", - "shell.execute_reply": "2023-07-31T02:14:41.684603Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.321143Z", + "iopub.status.busy": "2023-08-06T17:34:50.320696Z", + "iopub.status.idle": "2023-08-06T17:34:50.328214Z", + "shell.execute_reply": "2023-08-06T17:34:50.327465Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -851,12 +862,12 @@ ], "source": [ "probs = results.predict()\n", - "probs[:10]" + "probs[:10]\n" ] }, { "cell_type": "markdown", - "id": "3b8f3c42", + "id": "94607ba9", "metadata": {}, "source": [ "In order to make a prediction as to whether the market will go up or\n", @@ -870,24 +881,25 @@ { "cell_type": "code", "execution_count": 11, - "id": "46c2887c", + "id": "daf20de2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.688585Z", - "iopub.status.busy": "2023-07-31T02:14:41.688321Z", - "iopub.status.idle": "2023-07-31T02:14:41.693491Z", - "shell.execute_reply": "2023-07-31T02:14:41.691326Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.332514Z", + "iopub.status.busy": "2023-08-06T17:34:50.332173Z", + "iopub.status.idle": "2023-08-06T17:34:50.337377Z", + "shell.execute_reply": "2023-08-06T17:34:50.336735Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "labels = np.array(['Down']*1250)\n", - "labels[probs>0.5] = \"Up\"" + "labels[probs>0.5] = \"Up\"\n" ] }, { "cell_type": "markdown", - "id": "47ac8c81", + "id": "085aead4", "metadata": {}, "source": [ "The `confusion_table()`\n", @@ -902,13 +914,13 @@ { "cell_type": "code", "execution_count": 12, - "id": "0f816c4d", + "id": "71f4a40c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.699484Z", - "iopub.status.busy": "2023-07-31T02:14:41.698905Z", - "iopub.status.idle": "2023-07-31T02:14:41.706435Z", - "shell.execute_reply": "2023-07-31T02:14:41.706160Z" + "iopub.execute_input": "2023-08-06T17:34:50.342435Z", + "iopub.status.busy": "2023-08-06T17:34:50.342079Z", + "iopub.status.idle": "2023-08-06T17:34:50.354901Z", + "shell.execute_reply": "2023-08-06T17:34:50.354601Z" } }, "outputs": [ @@ -970,12 +982,12 @@ } ], "source": [ - "confusion_table(labels, Smarket.Direction)" + "confusion_table(labels, Smarket.Direction)\n" ] }, { "cell_type": "markdown", - "id": "327a9525", + "id": "3a338f26", "metadata": {}, "source": [ "The diagonal elements of the confusion matrix indicate correct\n", @@ -985,20 +997,21 @@ "total of 507 + 145 = 652 correct predictions. The `np.mean()`\n", "function can be used to compute the fraction of days for which the\n", "prediction was correct. In this case, logistic regression correctly\n", - "predicted the movement of the market 52.2% of the time." + "predicted the movement of the market 52.2% of the time.\n" ] }, { "cell_type": "code", "execution_count": 13, - "id": "23668517", + "id": "78b2946b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.708001Z", - "iopub.status.busy": "2023-07-31T02:14:41.707915Z", - "iopub.status.idle": "2023-07-31T02:14:41.710519Z", - "shell.execute_reply": "2023-07-31T02:14:41.710254Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.356729Z", + "iopub.status.busy": "2023-08-06T17:34:50.356597Z", + "iopub.status.idle": "2023-08-06T17:34:50.359259Z", + "shell.execute_reply": "2023-08-06T17:34:50.359007Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1013,12 +1026,20 @@ } ], "source": [ - "(507+145)/1250, np.mean(labels == Smarket.Direction)" + "(507+145)/1250, np.mean(labels == Smarket.Direction)\n" ] }, { "cell_type": "markdown", - "id": "1143b9c3", + "id": "54962226", + "metadata": {}, + "source": [ + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "aa9be981", "metadata": {}, "source": [ "At first glance, it appears that the logistic regression model is\n", @@ -1045,14 +1066,15 @@ { "cell_type": "code", "execution_count": 14, - "id": "86a02d7c", + "id": "e8a4d12e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.711888Z", - "iopub.status.busy": "2023-07-31T02:14:41.711795Z", - "iopub.status.idle": "2023-07-31T02:14:41.714657Z", - "shell.execute_reply": "2023-07-31T02:14:41.714338Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.360879Z", + "iopub.status.busy": "2023-08-06T17:34:50.360770Z", + "iopub.status.idle": "2023-08-06T17:34:50.363453Z", + "shell.execute_reply": "2023-08-06T17:34:50.363204Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1070,12 +1092,12 @@ "train = (Smarket.Year < 2005)\n", "Smarket_train = Smarket.loc[train]\n", "Smarket_test = Smarket.loc[~train]\n", - "Smarket_test.shape" + "Smarket_test.shape\n" ] }, { "cell_type": "markdown", - "id": "26b3a6d2", + "id": "946fac68", "metadata": {}, "source": [ "The object `train` is a vector of 1,250 elements, corresponding\n", @@ -1110,13 +1132,13 @@ { "cell_type": "code", "execution_count": 15, - "id": "f23b1c7b", + "id": "fd16bc2c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.716084Z", - "iopub.status.busy": "2023-07-31T02:14:41.715984Z", - "iopub.status.idle": "2023-07-31T02:14:41.720637Z", - "shell.execute_reply": "2023-07-31T02:14:41.720390Z" + "iopub.execute_input": "2023-08-06T17:34:50.364912Z", + "iopub.status.busy": "2023-08-06T17:34:50.364808Z", + "iopub.status.idle": "2023-08-06T17:34:50.369741Z", + "shell.execute_reply": "2023-08-06T17:34:50.369422Z" } }, "outputs": [], @@ -1127,12 +1149,12 @@ " X_train,\n", " family=sm.families.Binomial())\n", "results = glm_train.fit()\n", - "probs = results.predict(exog=X_test)" + "probs = results.predict(exog=X_test)\n" ] }, { "cell_type": "markdown", - "id": "6ebe1900", + "id": "12382c18", "metadata": {}, "source": [ "Notice that we have trained and tested our model on two completely\n", @@ -1147,24 +1169,25 @@ { "cell_type": "code", "execution_count": 16, - "id": "82f849b9", + "id": "aaa9d07c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.722093Z", - "iopub.status.busy": "2023-07-31T02:14:41.722017Z", - "iopub.status.idle": "2023-07-31T02:14:41.724072Z", - "shell.execute_reply": "2023-07-31T02:14:41.723827Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.371195Z", + "iopub.status.busy": "2023-08-06T17:34:50.371114Z", + "iopub.status.idle": "2023-08-06T17:34:50.373018Z", + "shell.execute_reply": "2023-08-06T17:34:50.372763Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "D = Smarket.Direction\n", - "L_train, L_test = D.loc[train], D.loc[~train]" + "L_train, L_test = D.loc[train], D.loc[~train]\n" ] }, { "cell_type": "markdown", - "id": "ac89c253", + "id": "cc0d0c3a", "metadata": {}, "source": [ "Now we threshold the\n", @@ -1175,14 +1198,15 @@ { "cell_type": "code", "execution_count": 17, - "id": "e216583a", + "id": "5f0b3282", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.725496Z", - "iopub.status.busy": "2023-07-31T02:14:41.725421Z", - "iopub.status.idle": "2023-07-31T02:14:41.729883Z", - "shell.execute_reply": "2023-07-31T02:14:41.729620Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.374386Z", + "iopub.status.busy": "2023-08-06T17:34:50.374307Z", + "iopub.status.idle": "2023-08-06T17:34:50.378599Z", + "shell.execute_reply": "2023-08-06T17:34:50.378366Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1245,12 +1269,12 @@ "source": [ "labels = np.array(['Down']*252)\n", "labels[probs>0.5] = 'Up'\n", - "confusion_table(labels, L_test)" + "confusion_table(labels, L_test)\n" ] }, { "cell_type": "markdown", - "id": "f43e1451", + "id": "71ca598e", "metadata": {}, "source": [ "The test accuracy is about 48% while the error rate is about 52%" @@ -1259,14 +1283,15 @@ { "cell_type": "code", "execution_count": 18, - "id": "5538dc17", + "id": "7f4e49c0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.731486Z", - "iopub.status.busy": "2023-07-31T02:14:41.731397Z", - "iopub.status.idle": "2023-07-31T02:14:41.733982Z", - "shell.execute_reply": "2023-07-31T02:14:41.733721Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.380021Z", + "iopub.status.busy": "2023-08-06T17:34:50.379944Z", + "iopub.status.idle": "2023-08-06T17:34:50.382451Z", + "shell.execute_reply": "2023-08-06T17:34:50.382198Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1281,12 +1306,12 @@ } ], "source": [ - "np.mean(labels == L_test), np.mean(labels != L_test)" + "np.mean(labels == L_test), np.mean(labels != L_test)\n" ] }, { "cell_type": "markdown", - "id": "3ddf7670", + "id": "96d75735", "metadata": {}, "source": [ "The `!=` notation means *not equal to*, and so the last command\n", @@ -1316,14 +1341,15 @@ { "cell_type": "code", "execution_count": 19, - "id": "016110f9", + "id": "9f94de4b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.735443Z", - "iopub.status.busy": "2023-07-31T02:14:41.735343Z", - "iopub.status.idle": "2023-07-31T02:14:41.743484Z", - "shell.execute_reply": "2023-07-31T02:14:41.743214Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.383801Z", + "iopub.status.busy": "2023-08-06T17:34:50.383724Z", + "iopub.status.idle": "2023-08-06T17:34:50.391808Z", + "shell.execute_reply": "2023-08-06T17:34:50.391549Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1394,12 +1420,12 @@ "probs = results.predict(exog=X_test)\n", "labels = np.array(['Down']*252)\n", "labels[probs>0.5] = 'Up'\n", - "confusion_table(labels, L_test)" + "confusion_table(labels, L_test)\n" ] }, { "cell_type": "markdown", - "id": "a7468a74", + "id": "1dd9ce3d", "metadata": {}, "source": [ "Let’s evaluate the overall accuracy as well as the accuracy within the days when\n", @@ -1409,13 +1435,13 @@ { "cell_type": "code", "execution_count": 20, - "id": "70984cd6", + "id": "69a4dd6b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.744937Z", - "iopub.status.busy": "2023-07-31T02:14:41.744855Z", - "iopub.status.idle": "2023-07-31T02:14:41.747115Z", - "shell.execute_reply": "2023-07-31T02:14:41.746876Z" + "iopub.execute_input": "2023-08-06T17:34:50.393244Z", + "iopub.status.busy": "2023-08-06T17:34:50.393158Z", + "iopub.status.idle": "2023-08-06T17:34:50.395426Z", + "shell.execute_reply": "2023-08-06T17:34:50.395177Z" } }, "outputs": [ @@ -1431,12 +1457,12 @@ } ], "source": [ - "(35+106)/252,106/(106+76)" + "(35+106)/252,106/(106+76)\n" ] }, { "cell_type": "markdown", - "id": "393c0a26", + "id": "14cf6b55", "metadata": {}, "source": [ "Now the results appear to be a little better: 56% of the daily\n", @@ -1463,14 +1489,15 @@ { "cell_type": "code", "execution_count": 21, - "id": "4b745fd8", + "id": "975fa3ca", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.748502Z", - "iopub.status.busy": "2023-07-31T02:14:41.748427Z", - "iopub.status.idle": "2023-07-31T02:14:41.751963Z", - "shell.execute_reply": "2023-07-31T02:14:41.751699Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.396775Z", + "iopub.status.busy": "2023-08-06T17:34:50.396693Z", + "iopub.status.idle": "2023-08-06T17:34:50.400210Z", + "shell.execute_reply": "2023-08-06T17:34:50.399964Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1490,12 +1517,12 @@ "newdata = pd.DataFrame({'Lag1':[1.2, 1.5],\n", " 'Lag2':[1.1, -0.8]});\n", "newX = model.transform(newdata)\n", - "results.predict(newX)" + "results.predict(newX)\n" ] }, { "cell_type": "markdown", - "id": "ae928a3e", + "id": "bdc2c0bb", "metadata": {}, "source": [ "## Linear Discriminant Analysis" @@ -1503,7 +1530,7 @@ }, { "cell_type": "markdown", - "id": "aab265c4", + "id": "41deab79", "metadata": {}, "source": [ "We begin by performing LDA on the `Smarket` data, using the function\n", @@ -1514,23 +1541,23 @@ { "cell_type": "code", "execution_count": 22, - "id": "cd533313", + "id": "7237ffa7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.753386Z", - "iopub.status.busy": "2023-07-31T02:14:41.753314Z", - "iopub.status.idle": "2023-07-31T02:14:41.754789Z", - "shell.execute_reply": "2023-07-31T02:14:41.754554Z" + "iopub.execute_input": "2023-08-06T17:34:50.401581Z", + "iopub.status.busy": "2023-08-06T17:34:50.401504Z", + "iopub.status.idle": "2023-08-06T17:34:50.403256Z", + "shell.execute_reply": "2023-08-06T17:34:50.403010Z" } }, "outputs": [], "source": [ - "lda = LDA(store_covariance=True)" + "lda = LDA(store_covariance=True)\n" ] }, { "cell_type": "markdown", - "id": "c84aa056", + "id": "7289db40", "metadata": {}, "source": [ "Since the `LDA` estimator automatically \n", @@ -1542,14 +1569,15 @@ { "cell_type": "code", "execution_count": 23, - "id": "953dc6ac", + "id": "43a850eb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.756225Z", - "iopub.status.busy": "2023-07-31T02:14:41.756141Z", - "iopub.status.idle": "2023-07-31T02:14:41.762198Z", - "shell.execute_reply": "2023-07-31T02:14:41.761933Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.404657Z", + "iopub.status.busy": "2023-08-06T17:34:50.404587Z", + "iopub.status.idle": "2023-08-06T17:34:50.414595Z", + "shell.execute_reply": "2023-08-06T17:34:50.414353Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1569,12 +1597,12 @@ "source": [ "X_train, X_test = [M.drop(columns=['intercept'])\n", " for M in [X_train, X_test]]\n", - "lda.fit(X_train, L_train)" + "lda.fit(X_train, L_train)\n" ] }, { "cell_type": "markdown", - "id": "0a51b5cd", + "id": "d3e0901f", "metadata": {}, "source": [ "Here we have used the list comprehensions introduced\n", @@ -1597,14 +1625,15 @@ { "cell_type": "code", "execution_count": 24, - "id": "8917085e", + "id": "86b6cece", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.763655Z", - "iopub.status.busy": "2023-07-31T02:14:41.763574Z", - "iopub.status.idle": "2023-07-31T02:14:41.765854Z", - "shell.execute_reply": "2023-07-31T02:14:41.765620Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.416057Z", + "iopub.status.busy": "2023-08-06T17:34:50.415959Z", + "iopub.status.idle": "2023-08-06T17:34:50.418098Z", + "shell.execute_reply": "2023-08-06T17:34:50.417857Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1620,12 +1649,12 @@ } ], "source": [ - "lda.means_" + "lda.means_\n" ] }, { "cell_type": "markdown", - "id": "14bc4692", + "id": "6d75a932", "metadata": {}, "source": [ "The estimated prior probabilities are stored in the `priors_` attribute.\n", @@ -1637,14 +1666,15 @@ { "cell_type": "code", "execution_count": 25, - "id": "efb3e9bd", + "id": "9362c7c6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.767245Z", - "iopub.status.busy": "2023-07-31T02:14:41.767167Z", - "iopub.status.idle": "2023-07-31T02:14:41.769225Z", - "shell.execute_reply": "2023-07-31T02:14:41.768981Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.419417Z", + "iopub.status.busy": "2023-08-06T17:34:50.419327Z", + "iopub.status.idle": "2023-08-06T17:34:50.421334Z", + "shell.execute_reply": "2023-08-06T17:34:50.421085Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1659,29 +1689,30 @@ } ], "source": [ - "lda.classes_" + "lda.classes_\n" ] }, { "cell_type": "markdown", - "id": "50697f11", + "id": "61f77e19", "metadata": {}, "source": [ "The LDA output indicates that $\\hat\\pi_{Down}=0.492$ and\n", - "$\\hat\\pi_{Up}=0.508$." + "$\\hat\\pi_{Up}=0.508$.\n" ] }, { "cell_type": "code", "execution_count": 26, - "id": "efce91fb", + "id": "e59858dc", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.770556Z", - "iopub.status.busy": "2023-07-31T02:14:41.770470Z", - "iopub.status.idle": "2023-07-31T02:14:41.772525Z", - "shell.execute_reply": "2023-07-31T02:14:41.772289Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.422583Z", + "iopub.status.busy": "2023-08-06T17:34:50.422510Z", + "iopub.status.idle": "2023-08-06T17:34:50.424567Z", + "shell.execute_reply": "2023-08-06T17:34:50.424332Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1696,12 +1727,12 @@ } ], "source": [ - "lda.priors_" + "lda.priors_\n" ] }, { "cell_type": "markdown", - "id": "a27bc841", + "id": "43a8fde1", "metadata": {}, "source": [ "The linear discriminant vectors can be found in the `scalings_` attribute:" @@ -1710,13 +1741,13 @@ { "cell_type": "code", "execution_count": 27, - "id": "e33cd6c5", + "id": "9b5f74e8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.773919Z", - "iopub.status.busy": "2023-07-31T02:14:41.773832Z", - "iopub.status.idle": "2023-07-31T02:14:41.775930Z", - "shell.execute_reply": "2023-07-31T02:14:41.775700Z" + "iopub.execute_input": "2023-08-06T17:34:50.425939Z", + "iopub.status.busy": "2023-08-06T17:34:50.425863Z", + "iopub.status.idle": "2023-08-06T17:34:50.427943Z", + "shell.execute_reply": "2023-08-06T17:34:50.427700Z" } }, "outputs": [ @@ -1733,12 +1764,12 @@ } ], "source": [ - "lda.scalings_" + "lda.scalings_\n" ] }, { "cell_type": "markdown", - "id": "b011d741", + "id": "4655809e", "metadata": {}, "source": [ "These values provide the linear combination of `Lag1` and `Lag2` that are used to form the LDA decision rule. In other words, these are the multipliers of the elements of $X=x$ in (4.24).\n", @@ -1748,23 +1779,23 @@ { "cell_type": "code", "execution_count": 28, - "id": "dc8a5178", + "id": "fd8e6794", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.777341Z", - "iopub.status.busy": "2023-07-31T02:14:41.777243Z", - "iopub.status.idle": "2023-07-31T02:14:41.779374Z", - "shell.execute_reply": "2023-07-31T02:14:41.779140Z" + "iopub.execute_input": "2023-08-06T17:34:50.429283Z", + "iopub.status.busy": "2023-08-06T17:34:50.429207Z", + "iopub.status.idle": "2023-08-06T17:34:50.431271Z", + "shell.execute_reply": "2023-08-06T17:34:50.431030Z" } }, "outputs": [], "source": [ - "lda_pred = lda.predict(X_test)" + "lda_pred = lda.predict(X_test)\n" ] }, { "cell_type": "markdown", - "id": "3c8a8a75", + "id": "2d211f0a", "metadata": {}, "source": [ "As we observed in our comparison of classification methods\n", @@ -1775,14 +1806,15 @@ { "cell_type": "code", "execution_count": 29, - "id": "31a6782b", + "id": "3bb63fb1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.780768Z", - "iopub.status.busy": "2023-07-31T02:14:41.780673Z", - "iopub.status.idle": "2023-07-31T02:14:41.784574Z", - "shell.execute_reply": "2023-07-31T02:14:41.784302Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.432644Z", + "iopub.status.busy": "2023-08-06T17:34:50.432568Z", + "iopub.status.idle": "2023-08-06T17:34:50.436354Z", + "shell.execute_reply": "2023-08-06T17:34:50.436113Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1843,32 +1875,33 @@ } ], "source": [ - "confusion_table(lda_pred, L_test)" + "confusion_table(lda_pred, L_test)\n" ] }, { "cell_type": "markdown", - "id": "c3534a8f", + "id": "8e31152b", "metadata": {}, "source": [ "We can also estimate the\n", "probability of each class for\n", "each point in a training set. Applying a 50% threshold to the posterior probabilities of\n", - "being in class 1 allows us to\n", + "being in class one allows us to\n", "recreate the predictions contained in `lda_pred`." ] }, { "cell_type": "code", "execution_count": 30, - "id": "da1bffa3", + "id": "2b91f491", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.785993Z", - "iopub.status.busy": "2023-07-31T02:14:41.785917Z", - "iopub.status.idle": "2023-07-31T02:14:41.788726Z", - "shell.execute_reply": "2023-07-31T02:14:41.788490Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.437709Z", + "iopub.status.busy": "2023-08-06T17:34:50.437628Z", + "iopub.status.idle": "2023-08-06T17:34:50.440441Z", + "shell.execute_reply": "2023-08-06T17:34:50.440196Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1886,12 +1919,12 @@ "lda_prob = lda.predict_proba(X_test)\n", "np.all(\n", " np.where(lda_prob[:,1] >= 0.5, 'Up','Down') == lda_pred\n", - " )" + " )\n" ] }, { "cell_type": "markdown", - "id": "6ab71d7c", + "id": "d3a76822", "metadata": {}, "source": [ "Above, we used the `np.where()` function that\n", @@ -1904,14 +1937,15 @@ { "cell_type": "code", "execution_count": 31, - "id": "3d7eae3c", + "id": "3a085714", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.790079Z", - "iopub.status.busy": "2023-07-31T02:14:41.790009Z", - "iopub.status.idle": "2023-07-31T02:14:41.792346Z", - "shell.execute_reply": "2023-07-31T02:14:41.792106Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.441897Z", + "iopub.status.busy": "2023-08-06T17:34:50.441821Z", + "iopub.status.idle": "2023-08-06T17:34:50.444090Z", + "shell.execute_reply": "2023-08-06T17:34:50.443865Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1928,12 +1962,12 @@ "source": [ "np.all(\n", " [lda.classes_[i] for i in np.argmax(lda_prob, 1)] == lda_pred\n", - " )" + " )\n" ] }, { "cell_type": "markdown", - "id": "6a67baf1", + "id": "0aa9cbb3", "metadata": {}, "source": [ "If we wanted to use a posterior probability threshold other than\n", @@ -1949,13 +1983,13 @@ { "cell_type": "code", "execution_count": 32, - "id": "18fa175c", + "id": "345fb8c6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.793730Z", - "iopub.status.busy": "2023-07-31T02:14:41.793654Z", - "iopub.status.idle": "2023-07-31T02:14:41.795835Z", - "shell.execute_reply": "2023-07-31T02:14:41.795598Z" + "iopub.execute_input": "2023-08-06T17:34:50.445520Z", + "iopub.status.busy": "2023-08-06T17:34:50.445423Z", + "iopub.status.idle": "2023-08-06T17:34:50.447522Z", + "shell.execute_reply": "2023-08-06T17:34:50.447281Z" } }, "outputs": [ @@ -1971,12 +2005,12 @@ } ], "source": [ - "np.sum(lda_prob[:,0] > 0.9)" + "np.sum(lda_prob[:,0] > 0.9)\n" ] }, { "cell_type": "markdown", - "id": "527be6fe", + "id": "6798146c", "metadata": {}, "source": [ "No days in 2005 meet that threshold! In fact, the greatest posterior\n", @@ -1995,12 +2029,12 @@ "then producing predictions is an explicit design choice of `sklearn`. This uniformity\n", "makes it possible to cleanly copy the classifier so that it can be fit\n", "on different data; e.g. different training sets arising in cross-validation.\n", - "This standard pattern also allows for a predictable formation of workflows." + "This standard pattern also allows for a predictable formation of workflows.\n" ] }, { "cell_type": "markdown", - "id": "66ecd10f", + "id": "58f2984f", "metadata": {}, "source": [ "## Quadratic Discriminant Analysis\n", @@ -2014,13 +2048,13 @@ { "cell_type": "code", "execution_count": 33, - "id": "62499aad", + "id": "22c6c2a3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.797259Z", - "iopub.status.busy": "2023-07-31T02:14:41.797186Z", - "iopub.status.idle": "2023-07-31T02:14:41.800789Z", - "shell.execute_reply": "2023-07-31T02:14:41.800548Z" + "iopub.execute_input": "2023-08-06T17:34:50.448942Z", + "iopub.status.busy": "2023-08-06T17:34:50.448849Z", + "iopub.status.idle": "2023-08-06T17:34:50.452411Z", + "shell.execute_reply": "2023-08-06T17:34:50.452173Z" } }, "outputs": [ @@ -2040,12 +2074,12 @@ ], "source": [ "qda = QDA(store_covariance=True)\n", - "qda.fit(X_train, L_train)" + "qda.fit(X_train, L_train)\n" ] }, { "cell_type": "markdown", - "id": "17b38989", + "id": "fba0bb3a", "metadata": {}, "source": [ "The `QDA()` function will again compute `means_` and `priors_`." @@ -2054,13 +2088,13 @@ { "cell_type": "code", "execution_count": 34, - "id": "296fdd89", + "id": "992a790a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.802222Z", - "iopub.status.busy": "2023-07-31T02:14:41.802144Z", - "iopub.status.idle": "2023-07-31T02:14:41.804333Z", - "shell.execute_reply": "2023-07-31T02:14:41.804091Z" + "iopub.execute_input": "2023-08-06T17:34:50.453767Z", + "iopub.status.busy": "2023-08-06T17:34:50.453689Z", + "iopub.status.idle": "2023-08-06T17:34:50.455832Z", + "shell.execute_reply": "2023-08-06T17:34:50.455573Z" } }, "outputs": [ @@ -2078,12 +2112,12 @@ } ], "source": [ - "qda.means_, qda.priors_" + "qda.means_, qda.priors_\n" ] }, { "cell_type": "markdown", - "id": "f439efa9", + "id": "8bc030e2", "metadata": {}, "source": [ "The `QDA()` classifier will estimate one covariance per class. Here is the\n", @@ -2093,14 +2127,15 @@ { "cell_type": "code", "execution_count": 35, - "id": "7fbbefb0", + "id": "074c9d46", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.805729Z", - "iopub.status.busy": "2023-07-31T02:14:41.805659Z", - "iopub.status.idle": "2023-07-31T02:14:41.807775Z", - "shell.execute_reply": "2023-07-31T02:14:41.807542Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.457173Z", + "iopub.status.busy": "2023-08-06T17:34:50.457102Z", + "iopub.status.idle": "2023-08-06T17:34:50.459117Z", + "shell.execute_reply": "2023-08-06T17:34:50.458865Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2116,12 +2151,12 @@ } ], "source": [ - "qda.covariance_[0]" + "qda.covariance_[0]\n" ] }, { "cell_type": "markdown", - "id": "4b33a370", + "id": "fa5963f6", "metadata": {}, "source": [ "The output contains the group means. But it does not contain the\n", @@ -2134,14 +2169,15 @@ { "cell_type": "code", "execution_count": 36, - "id": "03094dcd", + "id": "3c95aae1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.809152Z", - "iopub.status.busy": "2023-07-31T02:14:41.809080Z", - "iopub.status.idle": "2023-07-31T02:14:41.813317Z", - "shell.execute_reply": "2023-07-31T02:14:41.813067Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.460495Z", + "iopub.status.busy": "2023-08-06T17:34:50.460408Z", + "iopub.status.idle": "2023-08-06T17:34:50.464611Z", + "shell.execute_reply": "2023-08-06T17:34:50.464381Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2203,12 +2239,12 @@ ], "source": [ "qda_pred = qda.predict(X_test)\n", - "confusion_table(qda_pred, L_test)" + "confusion_table(qda_pred, L_test)\n" ] }, { "cell_type": "markdown", - "id": "2037df4b", + "id": "0a72c1b8", "metadata": {}, "source": [ "Interestingly, the QDA predictions are accurate almost 60% of the\n", @@ -2218,14 +2254,15 @@ { "cell_type": "code", "execution_count": 37, - "id": "25022d1a", + "id": "935b2079", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.814632Z", - "iopub.status.busy": "2023-07-31T02:14:41.814560Z", - "iopub.status.idle": "2023-07-31T02:14:41.816802Z", - "shell.execute_reply": "2023-07-31T02:14:41.816572Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.466057Z", + "iopub.status.busy": "2023-08-06T17:34:50.465982Z", + "iopub.status.idle": "2023-08-06T17:34:50.468265Z", + "shell.execute_reply": "2023-08-06T17:34:50.468008Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2240,12 +2277,12 @@ } ], "source": [ - "np.mean(qda_pred == L_test)" + "np.mean(qda_pred == L_test)\n" ] }, { "cell_type": "markdown", - "id": "cf85b45e", + "id": "cbf4d7d1", "metadata": {}, "source": [ "This level of accuracy is quite impressive for stock market data, which is\n", @@ -2259,7 +2296,7 @@ }, { "cell_type": "markdown", - "id": "258f98b8", + "id": "b89dfb88", "metadata": {}, "source": [ "## Naive Bayes\n", @@ -2273,14 +2310,15 @@ { "cell_type": "code", "execution_count": 38, - "id": "f73eb202", + "id": "628b0355", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.818249Z", - "iopub.status.busy": "2023-07-31T02:14:41.818174Z", - "iopub.status.idle": "2023-07-31T02:14:41.821763Z", - "shell.execute_reply": "2023-07-31T02:14:41.821514Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.469713Z", + "iopub.status.busy": "2023-08-06T17:34:50.469632Z", + "iopub.status.idle": "2023-08-06T17:34:50.473211Z", + "shell.execute_reply": "2023-08-06T17:34:50.472970Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2299,12 +2337,12 @@ ], "source": [ "NB = GaussianNB()\n", - "NB.fit(X_train, L_train)" + "NB.fit(X_train, L_train)\n" ] }, { "cell_type": "markdown", - "id": "9911dcdc", + "id": "66916c68", "metadata": {}, "source": [ "The classes are stored as `classes_`." @@ -2313,14 +2351,15 @@ { "cell_type": "code", "execution_count": 39, - "id": "8e860cc3", + "id": "8a5fc302", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.823149Z", - "iopub.status.busy": "2023-07-31T02:14:41.823078Z", - "iopub.status.idle": "2023-07-31T02:14:41.825164Z", - "shell.execute_reply": "2023-07-31T02:14:41.824932Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.474613Z", + "iopub.status.busy": "2023-08-06T17:34:50.474532Z", + "iopub.status.idle": "2023-08-06T17:34:50.476603Z", + "shell.execute_reply": "2023-08-06T17:34:50.476363Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2335,12 +2374,12 @@ } ], "source": [ - "NB.classes_" + "NB.classes_\n" ] }, { "cell_type": "markdown", - "id": "8d6b9b33", + "id": "753c7d37", "metadata": {}, "source": [ "The class prior probabilities are stored in the `class_prior_` attribute." @@ -2349,14 +2388,15 @@ { "cell_type": "code", "execution_count": 40, - "id": "c28bf3b5", + "id": "6b1b5cc6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.826634Z", - "iopub.status.busy": "2023-07-31T02:14:41.826530Z", - "iopub.status.idle": "2023-07-31T02:14:41.828758Z", - "shell.execute_reply": "2023-07-31T02:14:41.828517Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.477928Z", + "iopub.status.busy": "2023-08-06T17:34:50.477856Z", + "iopub.status.idle": "2023-08-06T17:34:50.479875Z", + "shell.execute_reply": "2023-08-06T17:34:50.479628Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2371,12 +2411,12 @@ } ], "source": [ - "NB.class_prior_" + "NB.class_prior_\n" ] }, { "cell_type": "markdown", - "id": "fed2c4b4", + "id": "848e5d7c", "metadata": {}, "source": [ "The parameters of the features can be found in the `theta_` and `var_` attributes. The number of rows\n", @@ -2387,13 +2427,13 @@ { "cell_type": "code", "execution_count": 41, - "id": "84a9f086", + "id": "1a4b7cb0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.830123Z", - "iopub.status.busy": "2023-07-31T02:14:41.830032Z", - "iopub.status.idle": "2023-07-31T02:14:41.832018Z", - "shell.execute_reply": "2023-07-31T02:14:41.831763Z" + "iopub.execute_input": "2023-08-06T17:34:50.481268Z", + "iopub.status.busy": "2023-08-06T17:34:50.481197Z", + "iopub.status.idle": "2023-08-06T17:34:50.483169Z", + "shell.execute_reply": "2023-08-06T17:34:50.482928Z" } }, "outputs": [ @@ -2410,12 +2450,12 @@ } ], "source": [ - "NB.theta_" + "NB.theta_\n" ] }, { "cell_type": "markdown", - "id": "66f0a08d", + "id": "60efd24c", "metadata": {}, "source": [ "Its variance is 1.503." @@ -2424,14 +2464,15 @@ { "cell_type": "code", "execution_count": 42, - "id": "885f5165", + "id": "f59d7cb4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.833338Z", - "iopub.status.busy": "2023-07-31T02:14:41.833247Z", - "iopub.status.idle": "2023-07-31T02:14:41.835227Z", - "shell.execute_reply": "2023-07-31T02:14:41.834993Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.484569Z", + "iopub.status.busy": "2023-08-06T17:34:50.484500Z", + "iopub.status.idle": "2023-08-06T17:34:50.486506Z", + "shell.execute_reply": "2023-08-06T17:34:50.486244Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2447,15 +2488,15 @@ } ], "source": [ - "NB.var_" + "NB.var_\n" ] }, { "cell_type": "markdown", - "id": "db0a1ce6", + "id": "4518d5db", "metadata": {}, "source": [ - "How do we know the names of these attributes? We use `NB?` (or \\textR?NB}).\n", + "How do we know the names of these attributes? We use `NB?` (or `?NB`).\n", "\n", "We can easily verify the mean computation:" ] @@ -2463,14 +2504,15 @@ { "cell_type": "code", "execution_count": 43, - "id": "61473094", + "id": "aa50d0b8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.836565Z", - "iopub.status.busy": "2023-07-31T02:14:41.836472Z", - "iopub.status.idle": "2023-07-31T02:14:41.839241Z", - "shell.execute_reply": "2023-07-31T02:14:41.838987Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.487873Z", + "iopub.status.busy": "2023-08-06T17:34:50.487800Z", + "iopub.status.idle": "2023-08-06T17:34:50.490700Z", + "shell.execute_reply": "2023-08-06T17:34:50.490454Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2487,12 +2529,12 @@ } ], "source": [ - "X_train[L_train == 'Down'].mean()" + "X_train[L_train == 'Down'].mean()\n" ] }, { "cell_type": "markdown", - "id": "d4ffc86b", + "id": "3ee8e214", "metadata": {}, "source": [ "Similarly for the variance:" @@ -2501,14 +2543,15 @@ { "cell_type": "code", "execution_count": 44, - "id": "db203a23", + "id": "3a2b0653", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.840635Z", - "iopub.status.busy": "2023-07-31T02:14:41.840547Z", - "iopub.status.idle": "2023-07-31T02:14:41.843269Z", - "shell.execute_reply": "2023-07-31T02:14:41.843049Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.492036Z", + "iopub.status.busy": "2023-08-06T17:34:50.491958Z", + "iopub.status.idle": "2023-08-06T17:34:50.494698Z", + "shell.execute_reply": "2023-08-06T17:34:50.494456Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2525,12 +2568,12 @@ } ], "source": [ - "X_train[L_train == 'Down'].var(ddof=0)" + "X_train[L_train == 'Down'].var(ddof=0)\n" ] }, { "cell_type": "markdown", - "id": "7c9078c1", + "id": "5cb3b59d", "metadata": {}, "source": [ "Since `NB()` is a classifier in the `sklearn` library, making predictions\n", @@ -2540,13 +2583,13 @@ { "cell_type": "code", "execution_count": 45, - "id": "b387227e", + "id": "938f09ea", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.844649Z", - "iopub.status.busy": "2023-07-31T02:14:41.844557Z", - "iopub.status.idle": "2023-07-31T02:14:41.848832Z", - "shell.execute_reply": "2023-07-31T02:14:41.848577Z" + "iopub.execute_input": "2023-08-06T17:34:50.496066Z", + "iopub.status.busy": "2023-08-06T17:34:50.495993Z", + "iopub.status.idle": "2023-08-06T17:34:50.500129Z", + "shell.execute_reply": "2023-08-06T17:34:50.499891Z" } }, "outputs": [ @@ -2609,12 +2652,12 @@ ], "source": [ "nb_labels = NB.predict(X_test)\n", - "confusion_table(nb_labels, L_test)" + "confusion_table(nb_labels, L_test)\n" ] }, { "cell_type": "markdown", - "id": "ab979471", + "id": "a0ce38d6", "metadata": {}, "source": [ "Naive Bayes performs well on these data, with accurate predictions over 59% of the time. This is slightly worse than QDA, but much better than LDA.\n", @@ -2625,14 +2668,15 @@ { "cell_type": "code", "execution_count": 46, - "id": "f14ebe61", + "id": "42f0e4a2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.850206Z", - "iopub.status.busy": "2023-07-31T02:14:41.850128Z", - "iopub.status.idle": "2023-07-31T02:14:41.852871Z", - "shell.execute_reply": "2023-07-31T02:14:41.852624Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.501537Z", + "iopub.status.busy": "2023-08-06T17:34:50.501460Z", + "iopub.status.idle": "2023-08-06T17:34:50.505359Z", + "shell.execute_reply": "2023-08-06T17:34:50.505091Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2651,12 +2695,12 @@ } ], "source": [ - "NB.predict_proba(X_test)[:5]" + "NB.predict_proba(X_test)[:5]\n" ] }, { "cell_type": "markdown", - "id": "f14c520d", + "id": "ede194da", "metadata": {}, "source": [ "## K-Nearest Neighbors\n", @@ -2674,13 +2718,13 @@ { "cell_type": "code", "execution_count": 47, - "id": "41a12f4a", + "id": "8b833ee4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.854241Z", - "iopub.status.busy": "2023-07-31T02:14:41.854168Z", - "iopub.status.idle": "2023-07-31T02:14:41.863633Z", - "shell.execute_reply": "2023-07-31T02:14:41.863384Z" + "iopub.execute_input": "2023-08-06T17:34:50.506696Z", + "iopub.status.busy": "2023-08-06T17:34:50.506614Z", + "iopub.status.idle": "2023-08-06T17:34:50.517822Z", + "shell.execute_reply": "2023-08-06T17:34:50.517573Z" } }, "outputs": [ @@ -2746,12 +2790,12 @@ "X_train, X_test = [np.asarray(X) for X in [X_train, X_test]]\n", "knn1.fit(X_train, L_train)\n", "knn1_pred = knn1.predict(X_test)\n", - "confusion_table(knn1_pred, L_test)" + "confusion_table(knn1_pred, L_test)\n" ] }, { "cell_type": "markdown", - "id": "22ee6dff", + "id": "5fb57a8d", "metadata": {}, "source": [ "The results using $K=1$ are not very good, since only $50%$ of the\n", @@ -2762,13 +2806,13 @@ { "cell_type": "code", "execution_count": 48, - "id": "1dd2f3e4", + "id": "45410b7f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.865116Z", - "iopub.status.busy": "2023-07-31T02:14:41.865042Z", - "iopub.status.idle": "2023-07-31T02:14:41.867424Z", - "shell.execute_reply": "2023-07-31T02:14:41.867177Z" + "iopub.execute_input": "2023-08-06T17:34:50.519187Z", + "iopub.status.busy": "2023-08-06T17:34:50.519097Z", + "iopub.status.idle": "2023-08-06T17:34:50.521354Z", + "shell.execute_reply": "2023-08-06T17:34:50.521132Z" } }, "outputs": [ @@ -2784,29 +2828,30 @@ } ], "source": [ - "(83+43)/252, np.mean(knn1_pred == L_test)" + "(83+43)/252, np.mean(knn1_pred == L_test)\n" ] }, { "cell_type": "markdown", - "id": "cda2465d", + "id": "500e00a1", "metadata": {}, "source": [ - "Below, we repeat the\n", - "analysis using $K=3$." + "We repeat the\n", + "analysis below using $K=3$." ] }, { "cell_type": "code", "execution_count": 49, - "id": "8ec72efc", + "id": "ae6e0156", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.868773Z", - "iopub.status.busy": "2023-07-31T02:14:41.868701Z", - "iopub.status.idle": "2023-07-31T02:14:41.876424Z", - "shell.execute_reply": "2023-07-31T02:14:41.876191Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.522772Z", + "iopub.status.busy": "2023-08-06T17:34:50.522694Z", + "iopub.status.idle": "2023-08-06T17:34:50.530247Z", + "shell.execute_reply": "2023-08-06T17:34:50.530016Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2828,7 +2873,7 @@ }, { "cell_type": "markdown", - "id": "ff4533bd", + "id": "11a369af", "metadata": {}, "source": [ "The results have improved slightly. But increasing *K* further\n", @@ -2839,7 +2884,7 @@ }, { "cell_type": "markdown", - "id": "5810022d", + "id": "ab3b1e64", "metadata": {}, "source": [ "KNN does not perform well on the `Smarket` data, but it often does provide impressive results. As an example we will apply the KNN approach to the `Caravan` data set, which is part of the `ISLP` library. This data set includes 85\n", @@ -2853,14 +2898,15 @@ { "cell_type": "code", "execution_count": 50, - "id": "98fef4ed", + "id": "9338564d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.878113Z", - "iopub.status.busy": "2023-07-31T02:14:41.878035Z", - "iopub.status.idle": "2023-07-31T02:14:41.897194Z", - "shell.execute_reply": "2023-07-31T02:14:41.896915Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.531745Z", + "iopub.status.busy": "2023-08-06T17:34:50.531662Z", + "iopub.status.idle": "2023-08-06T17:34:50.550259Z", + "shell.execute_reply": "2023-08-06T17:34:50.549964Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2879,12 +2925,12 @@ "source": [ "Caravan = load_data('Caravan')\n", "Purchase = Caravan.Purchase\n", - "Purchase.value_counts()" + "Purchase.value_counts()\n" ] }, { "cell_type": "markdown", - "id": "4fc1a1df", + "id": "ba5e14a9", "metadata": {}, "source": [ "The method `value_counts()` takes a `pd.Series` or `pd.DataFrame` and returns\n", @@ -2896,14 +2942,15 @@ { "cell_type": "code", "execution_count": 51, - "id": "1af72c0b", + "id": "a94f2ea7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.898649Z", - "iopub.status.busy": "2023-07-31T02:14:41.898566Z", - "iopub.status.idle": "2023-07-31T02:14:41.900656Z", - "shell.execute_reply": "2023-07-31T02:14:41.900416Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.551792Z", + "iopub.status.busy": "2023-08-06T17:34:50.551695Z", + "iopub.status.idle": "2023-08-06T17:34:50.553719Z", + "shell.execute_reply": "2023-08-06T17:34:50.553499Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2918,12 +2965,12 @@ } ], "source": [ - "348 / 5822" + "348 / 5822\n" ] }, { "cell_type": "markdown", - "id": "78c25fda", + "id": "a753d948", "metadata": {}, "source": [ "Our features will include all columns except `Purchase`." @@ -2932,23 +2979,23 @@ { "cell_type": "code", "execution_count": 52, - "id": "9ea841e4", + "id": "6b6438b0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.902065Z", - "iopub.status.busy": "2023-07-31T02:14:41.901988Z", - "iopub.status.idle": "2023-07-31T02:14:41.904327Z", - "shell.execute_reply": "2023-07-31T02:14:41.904080Z" + "iopub.execute_input": "2023-08-06T17:34:50.555038Z", + "iopub.status.busy": "2023-08-06T17:34:50.554947Z", + "iopub.status.idle": "2023-08-06T17:34:50.557311Z", + "shell.execute_reply": "2023-08-06T17:34:50.557082Z" } }, "outputs": [], "source": [ - "feature_df = Caravan.drop(columns=['Purchase'])" + "feature_df = Caravan.drop(columns=['Purchase'])\n" ] }, { "cell_type": "markdown", - "id": "55efb306", + "id": "52a62ab9", "metadata": {}, "source": [ "Because the KNN classifier predicts the class of a given test\n", @@ -2981,25 +3028,26 @@ { "cell_type": "code", "execution_count": 53, - "id": "6e26b14f", + "id": "158bfb3f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.905739Z", - "iopub.status.busy": "2023-07-31T02:14:41.905634Z", - "iopub.status.idle": "2023-07-31T02:14:41.907473Z", - "shell.execute_reply": "2023-07-31T02:14:41.907212Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.558624Z", + "iopub.status.busy": "2023-08-06T17:34:50.558538Z", + "iopub.status.idle": "2023-08-06T17:34:50.560136Z", + "shell.execute_reply": "2023-08-06T17:34:50.559910Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "scaler = StandardScaler(with_mean=True,\n", " with_std=True,\n", - " copy=True)" + " copy=True)\n" ] }, { "cell_type": "markdown", - "id": "0c0d1faf", + "id": "45baf26c", "metadata": {}, "source": [ "The argument `with_mean` indicates whether or not\n", @@ -3019,24 +3067,25 @@ { "cell_type": "code", "execution_count": 54, - "id": "bd178f38", + "id": "d11b04c4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.908837Z", - "iopub.status.busy": "2023-07-31T02:14:41.908766Z", - "iopub.status.idle": "2023-07-31T02:14:41.914689Z", - "shell.execute_reply": "2023-07-31T02:14:41.914421Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.561466Z", + "iopub.status.busy": "2023-08-06T17:34:50.561387Z", + "iopub.status.idle": "2023-08-06T17:34:50.567529Z", + "shell.execute_reply": "2023-08-06T17:34:50.567268Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "scaler.fit(feature_df)\n", - "X_std = scaler.transform(feature_df)" + "X_std = scaler.transform(feature_df)\n" ] }, { "cell_type": "markdown", - "id": "30bfaa05", + "id": "f388fe5b", "metadata": {}, "source": [ "Now every column of `feature_std` below has a standard deviation of\n", @@ -3046,13 +3095,13 @@ { "cell_type": "code", "execution_count": 55, - "id": "18929b37", + "id": "f0c65b34", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.916221Z", - "iopub.status.busy": "2023-07-31T02:14:41.916142Z", - "iopub.status.idle": "2023-07-31T02:14:41.921286Z", - "shell.execute_reply": "2023-07-31T02:14:41.921033Z" + "iopub.execute_input": "2023-08-06T17:34:50.569138Z", + "iopub.status.busy": "2023-08-06T17:34:50.569036Z", + "iopub.status.idle": "2023-08-06T17:34:50.577122Z", + "shell.execute_reply": "2023-08-06T17:34:50.576863Z" } }, "outputs": [ @@ -3082,15 +3131,15 @@ "feature_std = pd.DataFrame(\n", " X_std,\n", " columns=feature_df.columns);\n", - "feature_std.std()" + "feature_std.std()\n" ] }, { "cell_type": "markdown", - "id": "4f536808", + "id": "9668a83b", "metadata": {}, "source": [ - "Notice that the standard deviations are not quite $1$ here; this is again due to some procedures using the $1/n$ convention for variances (in this case `scaler()`), while others use $1/(n-1)$ (the `std()` method). See the footnote on page 198.\n", + "Notice that the standard deviations are not quite $1$ here; this is again due to some procedures using the $1/n$ convention for variances (in this case `scaler()`), while others use $1/(n-1)$ (the `std()` method). See the footnote on page 103.\n", "In this case it does not matter, as long as the variables are all on the same scale.\n", "\n", "Using the function `train_test_split()` we now split the observations into a test set,\n", @@ -3102,14 +3151,15 @@ { "cell_type": "code", "execution_count": 56, - "id": "9d439d0b", + "id": "3861cc4f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.922729Z", - "iopub.status.busy": "2023-07-31T02:14:41.922648Z", - "iopub.status.idle": "2023-07-31T02:14:41.925647Z", - "shell.execute_reply": "2023-07-31T02:14:41.925388Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.578604Z", + "iopub.status.busy": "2023-08-06T17:34:50.578502Z", + "iopub.status.idle": "2023-08-06T17:34:50.582699Z", + "shell.execute_reply": "2023-08-06T17:34:50.582426Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -3119,16 +3169,16 @@ " y_test) = train_test_split(np.asarray(feature_std),\n", " Purchase,\n", " test_size=1000,\n", - " random_state=0)" + " random_state=0)\n" ] }, { "cell_type": "markdown", - "id": "87fcf773", + "id": "3cd24d0a", "metadata": {}, "source": [ - "`?train_test_split` reveals that the non-keyword arguments can be `lists`, `arrays`, `pandas dataframes` etc that all have the same length (`shape[0]`) and hence are *indexable*. In this case they are the dataframe `feature_std` and the response variable `Purchase`. We have converted `feature_std` to an `ndarray`\n", - "so that `X_train` and `X_test` are `ndarray`.\n", + "`?train_test_split` reveals that the non-keyword arguments can be `lists`, `arrays`, `pandas dataframes` etc that all have the same length (`shape[0]`) and hence are *indexable*. In this case they are the dataframe `feature_std` and the response variable `Purchase`.\n", + " {Note that we have converted `feature_std` to an `ndarray` to address a bug in `sklearn`.}\n", "We fit a KNN model on the training data using $K=1$,\n", "and evaluate its performance on the test data." ] @@ -3136,14 +3186,15 @@ { "cell_type": "code", "execution_count": 57, - "id": "9b8c0171", + "id": "1b9d7b32", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:41.927120Z", - "iopub.status.busy": "2023-07-31T02:14:41.927042Z", - "iopub.status.idle": "2023-07-31T02:14:42.245324Z", - "shell.execute_reply": "2023-07-31T02:14:42.244929Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.584364Z", + "iopub.status.busy": "2023-08-06T17:34:50.584256Z", + "iopub.status.idle": "2023-08-06T17:34:50.908198Z", + "shell.execute_reply": "2023-08-06T17:34:50.907710Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -3160,12 +3211,12 @@ "source": [ "knn1 = KNeighborsClassifier(n_neighbors=1)\n", "knn1_pred = knn1.fit(X_train, y_train).predict(X_test)\n", - "np.mean(y_test != knn1_pred), np.mean(y_test != \"No\")" + "np.mean(y_test != knn1_pred), np.mean(y_test != \"No\")\n" ] }, { "cell_type": "markdown", - "id": "3aa030b6", + "id": "0464c302", "metadata": {}, "source": [ "The KNN error rate on the 1,000 test observations is about $11%$.\n", @@ -3188,13 +3239,13 @@ { "cell_type": "code", "execution_count": 58, - "id": "f31b6e26", + "id": "d683b2f9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.247712Z", - "iopub.status.busy": "2023-07-31T02:14:42.247583Z", - "iopub.status.idle": "2023-07-31T02:14:42.253630Z", - "shell.execute_reply": "2023-07-31T02:14:42.253319Z" + "iopub.execute_input": "2023-08-06T17:34:50.910374Z", + "iopub.status.busy": "2023-08-06T17:34:50.910235Z", + "iopub.status.idle": "2023-08-06T17:34:50.916751Z", + "shell.execute_reply": "2023-08-06T17:34:50.916357Z" } }, "outputs": [ @@ -3256,12 +3307,12 @@ } ], "source": [ - "confusion_table(knn1_pred, y_test)" + "confusion_table(knn1_pred, y_test)\n" ] }, { "cell_type": "markdown", - "id": "de5fb529", + "id": "19ed36b1", "metadata": {}, "source": [ "It turns out that KNN with $K=1$ does far better than random guessing\n", @@ -3273,14 +3324,15 @@ { "cell_type": "code", "execution_count": 59, - "id": "4a8c37aa", + "id": "3498856a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.255392Z", - "iopub.status.busy": "2023-07-31T02:14:42.255280Z", - "iopub.status.idle": "2023-07-31T02:14:42.257446Z", - "shell.execute_reply": "2023-07-31T02:14:42.257109Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.918891Z", + "iopub.status.busy": "2023-08-06T17:34:50.918771Z", + "iopub.status.idle": "2023-08-06T17:34:50.921176Z", + "shell.execute_reply": "2023-08-06T17:34:50.920892Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -3300,7 +3352,7 @@ }, { "cell_type": "markdown", - "id": "a898b7d0", + "id": "3ec215b9", "metadata": {}, "source": [ "### Tuning Parameters\n", @@ -3316,14 +3368,15 @@ { "cell_type": "code", "execution_count": 60, - "id": "153662f8", + "id": "9ed36c50", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.259217Z", - "iopub.status.busy": "2023-07-31T02:14:42.259122Z", - "iopub.status.idle": "2023-07-31T02:14:42.328441Z", - "shell.execute_reply": "2023-07-31T02:14:42.328089Z" - } + "iopub.execute_input": "2023-08-06T17:34:50.923079Z", + "iopub.status.busy": "2023-08-06T17:34:50.922965Z", + "iopub.status.idle": "2023-08-06T17:34:50.996569Z", + "shell.execute_reply": "2023-08-06T17:34:50.996126Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3351,12 +3404,12 @@ " K,\n", " pred,\n", " did_rent,\n", - " did_rent / pred))" + " did_rent / pred))\n" ] }, { "cell_type": "markdown", - "id": "39ba18b3", + "id": "0718d8f0", "metadata": {}, "source": [ "We see some variability --- the numbers for `K=4` are very different from the rest.\n", @@ -3382,13 +3435,13 @@ { "cell_type": "code", "execution_count": 61, - "id": "55b99a3f", + "id": "8605a327", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.330417Z", - "iopub.status.busy": "2023-07-31T02:14:42.330299Z", - "iopub.status.idle": "2023-07-31T02:14:42.957528Z", - "shell.execute_reply": "2023-07-31T02:14:42.956809Z" + "iopub.execute_input": "2023-08-06T17:34:50.998620Z", + "iopub.status.busy": "2023-08-06T17:34:50.998492Z", + "iopub.status.idle": "2023-08-06T17:34:51.629504Z", + "shell.execute_reply": "2023-08-06T17:34:51.628869Z" } }, "outputs": [ @@ -3454,12 +3507,12 @@ "logit.fit(X_train, y_train)\n", "logit_pred = logit.predict_proba(X_test)\n", "logit_labels = np.where(logit_pred[:,1] > .5, 'Yes', 'No')\n", - "confusion_table(logit_labels, y_test)" + "confusion_table(logit_labels, y_test)\n" ] }, { "cell_type": "markdown", - "id": "4e0ebc83", + "id": "daf1655f", "metadata": {}, "source": [ "We used the argument `solver='liblinear'` above to\n", @@ -3468,8 +3521,8 @@ "\n", "If we use $0.5$ as the predicted probability cut-off for the\n", "classifier, then we have a problem: only two of the test observations\n", - "are predicted to purchase insurance. However, we are not required to\n", - "use a cut-off of $0.5$. If we instead predict a purchase any time the\n", + "are predicted to purchase insurance. However, we are not required to use a\n", + "cut-off of $0.5$. If we instead predict a purchase any time the\n", "predicted probability of purchase exceeds $0.25$, we get much better\n", "results: we predict that 29 people will purchase insurance, and we are\n", "correct for about 31% of these people. This is almost five times\n", @@ -3479,13 +3532,13 @@ { "cell_type": "code", "execution_count": 62, - "id": "0c2ea9f5", + "id": "e686f675", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.961684Z", - "iopub.status.busy": "2023-07-31T02:14:42.961435Z", - "iopub.status.idle": "2023-07-31T02:14:42.975639Z", - "shell.execute_reply": "2023-07-31T02:14:42.973951Z" + "iopub.execute_input": "2023-08-06T17:34:51.634589Z", + "iopub.status.busy": "2023-08-06T17:34:51.634253Z", + "iopub.status.idle": "2023-08-06T17:34:51.649626Z", + "shell.execute_reply": "2023-08-06T17:34:51.648919Z" } }, "outputs": [ @@ -3554,14 +3607,15 @@ { "cell_type": "code", "execution_count": 63, - "id": "3a6bf0a4", + "id": "d92cfcd4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.982471Z", - "iopub.status.busy": "2023-07-31T02:14:42.982210Z", - "iopub.status.idle": "2023-07-31T02:14:42.988215Z", - "shell.execute_reply": "2023-07-31T02:14:42.987527Z" - } + "iopub.execute_input": "2023-08-06T17:34:51.653353Z", + "iopub.status.busy": "2023-08-06T17:34:51.653069Z", + "iopub.status.idle": "2023-08-06T17:34:51.659794Z", + "shell.execute_reply": "2023-08-06T17:34:51.658989Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3576,12 +3630,12 @@ } ], "source": [ - "9/(20+9)" + "9/(20+9)\n" ] }, { "cell_type": "markdown", - "id": "4d04bbc7", + "id": "8a0c1140", "metadata": {}, "source": [ "## Linear and Poisson Regression on the Bikeshare Data\n", @@ -3593,23 +3647,24 @@ { "cell_type": "code", "execution_count": 64, - "id": "769300df", + "id": "6f93060c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:42.992570Z", - "iopub.status.busy": "2023-07-31T02:14:42.992186Z", - "iopub.status.idle": "2023-07-31T02:14:43.006512Z", - "shell.execute_reply": "2023-07-31T02:14:43.005812Z" - } + "iopub.execute_input": "2023-08-06T17:34:51.664042Z", + "iopub.status.busy": "2023-08-06T17:34:51.663443Z", + "iopub.status.idle": "2023-08-06T17:34:51.685390Z", + "shell.execute_reply": "2023-08-06T17:34:51.684689Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "Bike = load_data('Bikeshare')" + "Bike = load_data('Bikeshare')\n" ] }, { "cell_type": "markdown", - "id": "8cc82fa9", + "id": "af82d61e", "metadata": {}, "source": [ "Let's have a peek at the dimensions and names of the variables in this dataframe." @@ -3618,13 +3673,13 @@ { "cell_type": "code", "execution_count": 65, - "id": "02b351f5", + "id": "725ce173", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.010755Z", - "iopub.status.busy": "2023-07-31T02:14:43.010421Z", - "iopub.status.idle": "2023-07-31T02:14:43.017317Z", - "shell.execute_reply": "2023-07-31T02:14:43.016675Z" + "iopub.execute_input": "2023-08-06T17:34:51.689828Z", + "iopub.status.busy": "2023-08-06T17:34:51.689209Z", + "iopub.status.idle": "2023-08-06T17:34:51.696435Z", + "shell.execute_reply": "2023-08-06T17:34:51.695780Z" } }, "outputs": [ @@ -3644,12 +3699,12 @@ } ], "source": [ - "Bike.shape, Bike.columns" + "Bike.shape, Bike.columns\n" ] }, { "cell_type": "markdown", - "id": "7784e3a1", + "id": "9b133dc3", "metadata": {}, "source": [ "### Linear Regression\n", @@ -3660,13 +3715,13 @@ { "cell_type": "code", "execution_count": 66, - "id": "926c908d", + "id": "ee3e5e3b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.021588Z", - "iopub.status.busy": "2023-07-31T02:14:43.021262Z", - "iopub.status.idle": "2023-07-31T02:14:43.106392Z", - "shell.execute_reply": "2023-07-31T02:14:43.105190Z" + "iopub.execute_input": "2023-08-06T17:34:51.700999Z", + "iopub.status.busy": "2023-08-06T17:34:51.700652Z", + "iopub.status.idle": "2023-08-06T17:34:51.771460Z", + "shell.execute_reply": "2023-08-06T17:34:51.770793Z" } }, "outputs": [ @@ -4039,12 +4094,12 @@ " 'weathersit']).fit_transform(Bike)\n", "Y = Bike['bikers']\n", "M_lm = sm.OLS(Y, X).fit()\n", - "summarize(M_lm)" + "summarize(M_lm)\n" ] }, { "cell_type": "markdown", - "id": "b29a0708", + "id": "36f3063f", "metadata": {}, "source": [ "There are 24 levels in `hr` and 40 rows in all.\n", @@ -4064,24 +4119,25 @@ { "cell_type": "code", "execution_count": 67, - "id": "064b24d1", + "id": "d6a047f5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.110343Z", - "iopub.status.busy": "2023-07-31T02:14:43.109711Z", - "iopub.status.idle": "2023-07-31T02:14:43.117475Z", - "shell.execute_reply": "2023-07-31T02:14:43.113978Z" - } + "iopub.execute_input": "2023-08-06T17:34:51.777342Z", + "iopub.status.busy": "2023-08-06T17:34:51.777095Z", + "iopub.status.idle": "2023-08-06T17:34:51.781327Z", + "shell.execute_reply": "2023-08-06T17:34:51.780152Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "hr_encode = contrast('hr', 'sum')\n", - "mnth_encode = contrast('mnth', 'sum')" + "mnth_encode = contrast('mnth', 'sum')\n" ] }, { "cell_type": "markdown", - "id": "fba11e8e", + "id": "6ed435ca", "metadata": {}, "source": [ "Refitting again:" @@ -4090,13 +4146,13 @@ { "cell_type": "code", "execution_count": 68, - "id": "27c1aa54", + "id": "d7f6edaf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.121462Z", - "iopub.status.busy": "2023-07-31T02:14:43.121162Z", - "iopub.status.idle": "2023-07-31T02:14:43.188156Z", - "shell.execute_reply": "2023-07-31T02:14:43.187391Z" + "iopub.execute_input": "2023-08-06T17:34:51.785799Z", + "iopub.status.busy": "2023-08-06T17:34:51.785477Z", + "iopub.status.idle": "2023-08-06T17:34:51.868170Z", + "shell.execute_reply": "2023-08-06T17:34:51.867180Z" } }, "outputs": [ @@ -4474,7 +4530,7 @@ }, { "cell_type": "markdown", - "id": "d057b162", + "id": "edea9530", "metadata": {}, "source": [ "What is the difference between the two codings? In `M2_lm`, a\n", @@ -4500,13 +4556,13 @@ { "cell_type": "code", "execution_count": 69, - "id": "dd0114c8", + "id": "412ce964", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.197210Z", - "iopub.status.busy": "2023-07-31T02:14:43.191504Z", - "iopub.status.idle": "2023-07-31T02:14:43.205987Z", - "shell.execute_reply": "2023-07-31T02:14:43.203561Z" + "iopub.execute_input": "2023-08-06T17:34:51.872605Z", + "iopub.status.busy": "2023-08-06T17:34:51.872217Z", + "iopub.status.idle": "2023-08-06T17:34:51.880273Z", + "shell.execute_reply": "2023-08-06T17:34:51.879520Z" } }, "outputs": [ @@ -4522,12 +4578,12 @@ } ], "source": [ - "np.sum((M_lm.fittedvalues - M2_lm.fittedvalues)**2)" + "np.sum((M_lm.fittedvalues - M2_lm.fittedvalues)**2)\n" ] }, { "cell_type": "markdown", - "id": "bcb6ae87", + "id": "69539d1c", "metadata": {}, "source": [ "The sum of squared differences is zero. We can also see this using the\n", @@ -4537,14 +4593,15 @@ { "cell_type": "code", "execution_count": 70, - "id": "292585a1", + "id": "5afd0d5d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.210658Z", - "iopub.status.busy": "2023-07-31T02:14:43.210136Z", - "iopub.status.idle": "2023-07-31T02:14:43.216572Z", - "shell.execute_reply": "2023-07-31T02:14:43.216006Z" - } + "iopub.execute_input": "2023-08-06T17:34:51.885577Z", + "iopub.status.busy": "2023-08-06T17:34:51.885206Z", + "iopub.status.idle": "2023-08-06T17:34:51.893099Z", + "shell.execute_reply": "2023-08-06T17:34:51.892367Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -4559,12 +4616,12 @@ } ], "source": [ - "np.allclose(M_lm.fittedvalues, M2_lm.fittedvalues)" + "np.allclose(M_lm.fittedvalues, M2_lm.fittedvalues)\n" ] }, { "cell_type": "markdown", - "id": "5bffbdd1", + "id": "fdc83f2e", "metadata": {}, "source": [ "To reproduce the left-hand side of Figure 4.13\n", @@ -4579,14 +4636,15 @@ { "cell_type": "code", "execution_count": 71, - "id": "e05e0575", + "id": "4629f2c9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.221686Z", - "iopub.status.busy": "2023-07-31T02:14:43.219575Z", - "iopub.status.idle": "2023-07-31T02:14:43.228105Z", - "shell.execute_reply": "2023-07-31T02:14:43.227361Z" - } + "iopub.execute_input": "2023-08-06T17:34:51.896788Z", + "iopub.status.busy": "2023-08-06T17:34:51.896443Z", + "iopub.status.idle": "2023-08-06T17:34:51.903051Z", + "shell.execute_reply": "2023-08-06T17:34:51.902328Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -4613,12 +4671,12 @@ ], "source": [ "coef_month = S2[S2.index.str.contains('mnth')]['coef']\n", - "coef_month" + "coef_month\n" ] }, { "cell_type": "markdown", - "id": "d542caac", + "id": "6fdd5f23", "metadata": {}, "source": [ "Next, we append `Dec` as the negative of the sum of all other months." @@ -4627,14 +4685,15 @@ { "cell_type": "code", "execution_count": 72, - "id": "9f04a25e", + "id": "b3e55833", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.231864Z", - "iopub.status.busy": "2023-07-31T02:14:43.231239Z", - "iopub.status.idle": "2023-07-31T02:14:43.240501Z", - "shell.execute_reply": "2023-07-31T02:14:43.239364Z" - } + "iopub.execute_input": "2023-08-06T17:34:51.906797Z", + "iopub.status.busy": "2023-08-06T17:34:51.906546Z", + "iopub.status.idle": "2023-08-06T17:34:51.914013Z", + "shell.execute_reply": "2023-08-06T17:34:51.913335Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -4668,12 +4727,12 @@ " index=['mnth[Dec]'\n", " ])\n", " ])\n", - "coef_month" + "coef_month\n" ] }, { "cell_type": "markdown", - "id": "6e3ef375", + "id": "4d1f1d30", "metadata": {}, "source": [ "Finally, to make the plot neater, we’ll just use the first letter of each month, which is the $6$th entry of each of\n", @@ -4683,13 +4742,13 @@ { "cell_type": "code", "execution_count": 73, - "id": "20c7c054", + "id": "cdbebc03", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.243792Z", - "iopub.status.busy": "2023-07-31T02:14:43.243520Z", - "iopub.status.idle": "2023-07-31T02:14:43.367727Z", - "shell.execute_reply": "2023-07-31T02:14:43.366856Z" + "iopub.execute_input": "2023-08-06T17:34:51.917669Z", + "iopub.status.busy": "2023-08-06T17:34:51.917450Z", + "iopub.status.idle": "2023-08-06T17:34:52.060250Z", + "shell.execute_reply": "2023-08-06T17:34:52.059542Z" } }, "outputs": [ @@ -4711,12 +4770,12 @@ "ax_month.set_xticks(x_month)\n", "ax_month.set_xticklabels([l[5] for l in coef_month.index], fontsize=20)\n", "ax_month.set_xlabel('Month', fontsize=20)\n", - "ax_month.set_ylabel('Coefficient', fontsize=20);" + "ax_month.set_ylabel('Coefficient', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "6032f6a9", + "id": "6f845be8", "metadata": {}, "source": [ "Reproducing the right-hand plot in Figure 4.13 follows a similar process." @@ -4725,13 +4784,13 @@ { "cell_type": "code", "execution_count": 74, - "id": "3f83f4bf", + "id": "170fd6fd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.372852Z", - "iopub.status.busy": "2023-07-31T02:14:43.372564Z", - "iopub.status.idle": "2023-07-31T02:14:43.379643Z", - "shell.execute_reply": "2023-07-31T02:14:43.378490Z" + "iopub.execute_input": "2023-08-06T17:34:52.064472Z", + "iopub.status.busy": "2023-08-06T17:34:52.064205Z", + "iopub.status.idle": "2023-08-06T17:34:52.071346Z", + "shell.execute_reply": "2023-08-06T17:34:52.070685Z" } }, "outputs": [], @@ -4740,12 +4799,12 @@ "coef_hr = coef_hr.reindex(['hr[{0}]'.format(h) for h in range(23)])\n", "coef_hr = pd.concat([coef_hr,\n", " pd.Series([-coef_hr.sum()], index=['hr[23]'])\n", - " ])" + " ])\n" ] }, { "cell_type": "markdown", - "id": "58200be9", + "id": "100190e3", "metadata": {}, "source": [ "We now make the hour plot." @@ -4754,13 +4813,13 @@ { "cell_type": "code", "execution_count": 75, - "id": "86e9a741", + "id": "1e09e126", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.384029Z", - "iopub.status.busy": "2023-07-31T02:14:43.383803Z", - "iopub.status.idle": "2023-07-31T02:14:43.523993Z", - "shell.execute_reply": "2023-07-31T02:14:43.523687Z" + "iopub.execute_input": "2023-08-06T17:34:52.075772Z", + "iopub.status.busy": "2023-08-06T17:34:52.075406Z", + "iopub.status.idle": "2023-08-06T17:34:52.204803Z", + "shell.execute_reply": "2023-08-06T17:34:52.204415Z" } }, "outputs": [ @@ -4782,12 +4841,12 @@ "ax_hr.set_xticks(x_hr[::2])\n", "ax_hr.set_xticklabels(range(24)[::2], fontsize=20)\n", "ax_hr.set_xlabel('Hour', fontsize=20)\n", - "ax_hr.set_ylabel('Coefficient', fontsize=20);" + "ax_hr.set_ylabel('Coefficient', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "5db06a3e", + "id": "bf730e5d", "metadata": {}, "source": [ "### Poisson Regression\n", @@ -4800,23 +4859,23 @@ { "cell_type": "code", "execution_count": 76, - "id": "a9448278", + "id": "a6667dcf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.525638Z", - "iopub.status.busy": "2023-07-31T02:14:43.525522Z", - "iopub.status.idle": "2023-07-31T02:14:43.607623Z", - "shell.execute_reply": "2023-07-31T02:14:43.606685Z" + "iopub.execute_input": "2023-08-06T17:34:52.206616Z", + "iopub.status.busy": "2023-08-06T17:34:52.206494Z", + "iopub.status.idle": "2023-08-06T17:34:52.270836Z", + "shell.execute_reply": "2023-08-06T17:34:52.270019Z" } }, "outputs": [], "source": [ - "M_pois = sm.GLM(Y, X2, family=sm.families.Poisson()).fit()" + "M_pois = sm.GLM(Y, X2, family=sm.families.Poisson()).fit()\n" ] }, { "cell_type": "markdown", - "id": "e7b3bc38", + "id": "8309c1fc", "metadata": {}, "source": [ "We can plot the coefficients associated with `mnth` and `hr`, in order to reproduce Figure 4.15. We first complete these coefficients as before." @@ -4825,14 +4884,15 @@ { "cell_type": "code", "execution_count": 77, - "id": "ec8505be", + "id": "c20de5d8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.611740Z", - "iopub.status.busy": "2023-07-31T02:14:43.611416Z", - "iopub.status.idle": "2023-07-31T02:14:43.632412Z", - "shell.execute_reply": "2023-07-31T02:14:43.631755Z" - } + "iopub.execute_input": "2023-08-06T17:34:52.275471Z", + "iopub.status.busy": "2023-08-06T17:34:52.275064Z", + "iopub.status.idle": "2023-08-06T17:34:52.302707Z", + "shell.execute_reply": "2023-08-06T17:34:52.302018Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -4849,7 +4909,7 @@ }, { "cell_type": "markdown", - "id": "f6fb37ef", + "id": "41e58943", "metadata": {}, "source": [ "The plotting is as before." @@ -4858,21 +4918,22 @@ { "cell_type": "code", "execution_count": 78, - "id": "0b8a5edf", + "id": "4a1a8488", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.636286Z", - "iopub.status.busy": "2023-07-31T02:14:43.635967Z", - "iopub.status.idle": "2023-07-31T02:14:43.889991Z", - "shell.execute_reply": "2023-07-31T02:14:43.889682Z" - } + "iopub.execute_input": "2023-08-06T17:34:52.306937Z", + "iopub.status.busy": "2023-08-06T17:34:52.306687Z", + "iopub.status.idle": "2023-08-06T17:34:52.568583Z", + "shell.execute_reply": "2023-08-06T17:34:52.568258Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/var/folders/16/8y65_zv174qgdp4ktlmpv12h0000gq/T/ipykernel_87709/3779510511.py:8: UserWarning: FixedFormatter should only be used together with FixedLocator\n", + "/var/folders/16/8y65_zv174qgdp4ktlmpv12h0000gq/T/ipykernel_84993/3779905754.py:8: UserWarning: FixedFormatter should only be used together with FixedLocator\n", " ax_hr.set_xticklabels(range(24)[::2], fontsize=20)\n" ] }, @@ -4897,12 +4958,12 @@ "ax_hr.plot(x_hr, coef_hr, marker='o', ms=10)\n", "ax_hr.set_xticklabels(range(24)[::2], fontsize=20)\n", "ax_hr.set_xlabel('Hour', fontsize=20)\n", - "ax_hr.set_ylabel('Coefficient', fontsize=20);" + "ax_hr.set_ylabel('Coefficient', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "3c256bf2", + "id": "5e74d13e", "metadata": {}, "source": [ "We compare the fitted values of the two models.\n", @@ -4914,13 +4975,13 @@ { "cell_type": "code", "execution_count": 79, - "id": "d487c7ed", + "id": "a3158334", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:43.891538Z", - "iopub.status.busy": "2023-07-31T02:14:43.891447Z", - "iopub.status.idle": "2023-07-31T02:14:44.000225Z", - "shell.execute_reply": "2023-07-31T02:14:43.999853Z" + "iopub.execute_input": "2023-08-06T17:34:52.570243Z", + "iopub.status.busy": "2023-08-06T17:34:52.570130Z", + "iopub.status.idle": "2023-08-06T17:34:52.678176Z", + "shell.execute_reply": "2023-08-06T17:34:52.677845Z" } }, "outputs": [ @@ -4943,12 +5004,12 @@ "ax.set_xlabel('Linear Regression Fit', fontsize=20)\n", "ax.set_ylabel('Poisson Regression Fit', fontsize=20)\n", "ax.axline([0,0], c='black', linewidth=3,\n", - " linestyle='--', slope=1);" + " linestyle='--', slope=1);\n" ] }, { "cell_type": "markdown", - "id": "17ccc1bf", + "id": "2b03ac4f", "metadata": {}, "source": [ "The predictions from the Poisson regression model are correlated with\n", @@ -4962,15 +5023,16 @@ "with `family=sm.families.Binomial()` to perform logistic regression. Other\n", "choices for the `family` argument can be used to fit other types\n", "of GLMs. For instance, `family=sm.families.Gamma()` fits a Gamma regression\n", - "model." + "model.\n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "kernelspec": { "display_name": "Python3 (islp_freeze_311)", diff --git a/Ch5-resample-lab.ipynb b/Ch5-resample-lab.ipynb index 04938f0..950726d 100644 --- a/Ch5-resample-lab.ipynb +++ b/Ch5-resample-lab.ipynb @@ -5,7 +5,9 @@ "id": "3a3f2f85", "metadata": {}, "source": [ - "# Chapter 5" + "\n", + "# Chapter 5\n", + "\n" ] }, { @@ -27,11 +29,12 @@ "id": "60fad148", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:45.345335Z", - "iopub.status.busy": "2023-07-31T02:14:45.345019Z", - "iopub.status.idle": "2023-07-31T02:14:46.175442Z", - "shell.execute_reply": "2023-07-31T02:14:46.174945Z" - } + "iopub.execute_input": "2023-08-06T17:34:54.032413Z", + "iopub.status.busy": "2023-08-06T17:34:54.032111Z", + "iopub.status.idle": "2023-08-06T17:34:54.873921Z", + "shell.execute_reply": "2023-08-06T17:34:54.873325Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ @@ -41,7 +44,7 @@ "from ISLP.models import (ModelSpec as MS,\n", " summarize,\n", " poly)\n", - "from sklearn.model_selection import train_test_split" + "from sklearn.model_selection import train_test_split\n" ] }, { @@ -58,11 +61,12 @@ "id": "2478aeb4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.177622Z", - "iopub.status.busy": "2023-07-31T02:14:46.177374Z", - "iopub.status.idle": "2023-07-31T02:14:46.179577Z", - "shell.execute_reply": "2023-07-31T02:14:46.179312Z" - } + "iopub.execute_input": "2023-08-06T17:34:54.876060Z", + "iopub.status.busy": "2023-08-06T17:34:54.875842Z", + "iopub.status.idle": "2023-08-06T17:34:54.878002Z", + "shell.execute_reply": "2023-08-06T17:34:54.877731Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ @@ -72,7 +76,7 @@ " KFold,\n", " ShuffleSplit)\n", "from sklearn.base import clone\n", - "from ISLP.models import sklearn_sm" + "from ISLP.models import sklearn_sm\n" ] }, { @@ -92,7 +96,7 @@ "when performing operations like this that contain an\n", "element of randomness, so that the results obtained can be reproduced\n", "precisely at a later time. We set the random seed of the splitter\n", - "with the argument `random_state=0`." + "with the argument `random_state=0`. " ] }, { @@ -101,10 +105,10 @@ "id": "99c95faf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.181100Z", - "iopub.status.busy": "2023-07-31T02:14:46.180998Z", - "iopub.status.idle": "2023-07-31T02:14:46.187844Z", - "shell.execute_reply": "2023-07-31T02:14:46.187574Z" + "iopub.execute_input": "2023-08-06T17:34:54.879485Z", + "iopub.status.busy": "2023-08-06T17:34:54.879378Z", + "iopub.status.idle": "2023-08-06T17:34:54.886401Z", + "shell.execute_reply": "2023-08-06T17:34:54.886117Z" } }, "outputs": [], @@ -112,7 +116,7 @@ "Auto = load_data('Auto')\n", "Auto_train, Auto_valid = train_test_split(Auto,\n", " test_size=196,\n", - " random_state=0)" + " random_state=0)\n" ] }, { @@ -129,10 +133,10 @@ "id": "41b0717d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.189426Z", - "iopub.status.busy": "2023-07-31T02:14:46.189344Z", - "iopub.status.idle": "2023-07-31T02:14:46.193204Z", - "shell.execute_reply": "2023-07-31T02:14:46.192935Z" + "iopub.execute_input": "2023-08-06T17:34:54.887942Z", + "iopub.status.busy": "2023-08-06T17:34:54.887854Z", + "iopub.status.idle": "2023-08-06T17:34:54.891560Z", + "shell.execute_reply": "2023-08-06T17:34:54.891297Z" } }, "outputs": [], @@ -141,7 +145,7 @@ "X_train = hp_mm.fit_transform(Auto_train)\n", "y_train = Auto_train['mpg']\n", "model = sm.OLS(y_train, X_train)\n", - "results = model.fit()" + "results = model.fit()\n" ] }, { @@ -159,10 +163,10 @@ "id": "d7ea3c0d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.194683Z", - "iopub.status.busy": "2023-07-31T02:14:46.194591Z", - "iopub.status.idle": "2023-07-31T02:14:46.198962Z", - "shell.execute_reply": "2023-07-31T02:14:46.198705Z" + "iopub.execute_input": "2023-08-06T17:34:54.893051Z", + "iopub.status.busy": "2023-08-06T17:34:54.892965Z", + "iopub.status.idle": "2023-08-06T17:34:54.897036Z", + "shell.execute_reply": "2023-08-06T17:34:54.896785Z" } }, "outputs": [ @@ -181,7 +185,7 @@ "X_valid = hp_mm.transform(Auto_valid)\n", "y_valid = Auto_valid['mpg']\n", "valid_pred = results.predict(X_valid)\n", - "np.mean((y_valid - valid_pred)**2)" + "np.mean((y_valid - valid_pred)**2)\n" ] }, { @@ -203,10 +207,10 @@ "id": "a02a2d05", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.200468Z", - "iopub.status.busy": "2023-07-31T02:14:46.200388Z", - "iopub.status.idle": "2023-07-31T02:14:46.202553Z", - "shell.execute_reply": "2023-07-31T02:14:46.202309Z" + "iopub.execute_input": "2023-08-06T17:34:54.898500Z", + "iopub.status.busy": "2023-08-06T17:34:54.898412Z", + "iopub.status.idle": "2023-08-06T17:34:54.900767Z", + "shell.execute_reply": "2023-08-06T17:34:54.900515Z" } }, "outputs": [], @@ -226,7 +230,7 @@ " results = sm.OLS(y_train, X_train).fit()\n", " test_pred = results.predict(X_test)\n", "\n", - " return np.mean((y_test - test_pred)**2)" + " return np.mean((y_test - test_pred)**2)\n" ] }, { @@ -246,10 +250,10 @@ "id": "51d93dea", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.203992Z", - "iopub.status.busy": "2023-07-31T02:14:46.203891Z", - "iopub.status.idle": "2023-07-31T02:14:46.213999Z", - "shell.execute_reply": "2023-07-31T02:14:46.213730Z" + "iopub.execute_input": "2023-08-06T17:34:54.902229Z", + "iopub.status.busy": "2023-08-06T17:34:54.902150Z", + "iopub.status.idle": "2023-08-06T17:34:54.912255Z", + "shell.execute_reply": "2023-08-06T17:34:54.912027Z" } }, "outputs": [ @@ -271,7 +275,7 @@ " 'mpg',\n", " Auto_train,\n", " Auto_valid)\n", - "MSE" + "MSE\n" ] }, { @@ -290,10 +294,10 @@ "id": "83432f06", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.215488Z", - "iopub.status.busy": "2023-07-31T02:14:46.215401Z", - "iopub.status.idle": "2023-07-31T02:14:46.225856Z", - "shell.execute_reply": "2023-07-31T02:14:46.225598Z" + "iopub.execute_input": "2023-08-06T17:34:54.913788Z", + "iopub.status.busy": "2023-08-06T17:34:54.913696Z", + "iopub.status.idle": "2023-08-06T17:34:54.924230Z", + "shell.execute_reply": "2023-08-06T17:34:54.923983Z" } }, "outputs": [ @@ -373,11 +377,12 @@ "id": "bcfc433f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.227362Z", - "iopub.status.busy": "2023-07-31T02:14:46.227281Z", - "iopub.status.idle": "2023-07-31T02:14:46.785216Z", - "shell.execute_reply": "2023-07-31T02:14:46.784936Z" - } + "iopub.execute_input": "2023-08-06T17:34:54.925794Z", + "iopub.status.busy": "2023-08-06T17:34:54.925711Z", + "iopub.status.idle": "2023-08-06T17:34:55.485718Z", + "shell.execute_reply": "2023-08-06T17:34:55.485445Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -400,7 +405,7 @@ " Y,\n", " cv=Auto.shape[0])\n", "cv_err = np.mean(cv_results['test_score'])\n", - "cv_err" + "cv_err\n" ] }, { @@ -440,11 +445,12 @@ "id": "f951ffc8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:46.786874Z", - "iopub.status.busy": "2023-07-31T02:14:46.786773Z", - "iopub.status.idle": "2023-07-31T02:14:47.387263Z", - "shell.execute_reply": "2023-07-31T02:14:47.386958Z" - } + "iopub.execute_input": "2023-08-06T17:34:55.487370Z", + "iopub.status.busy": "2023-08-06T17:34:55.487270Z", + "iopub.status.idle": "2023-08-06T17:34:56.086269Z", + "shell.execute_reply": "2023-08-06T17:34:56.085986Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -469,7 +475,7 @@ " Y,\n", " cv=Auto.shape[0])\n", " cv_error[i] = np.mean(M_CV['test_score'])\n", - "cv_error" + "cv_error\n" ] }, { @@ -487,7 +493,7 @@ "It has two arrays as\n", "arguments, and then forms a larger\n", "array where the operation is applied to each pair of elements of the\n", - "two arrays." + "two arrays. " ] }, { @@ -496,10 +502,10 @@ "id": "e3610b5a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.388905Z", - "iopub.status.busy": "2023-07-31T02:14:47.388796Z", - "iopub.status.idle": "2023-07-31T02:14:47.391290Z", - "shell.execute_reply": "2023-07-31T02:14:47.391034Z" + "iopub.execute_input": "2023-08-06T17:34:56.087846Z", + "iopub.status.busy": "2023-08-06T17:34:56.087739Z", + "iopub.status.idle": "2023-08-06T17:34:56.090120Z", + "shell.execute_reply": "2023-08-06T17:34:56.089850Z" } }, "outputs": [ @@ -519,7 +525,7 @@ "source": [ "A = np.array([3, 5, 9])\n", "B = np.array([2, 4])\n", - "np.add.outer(A, B)" + "np.add.outer(A, B)\n" ] }, { @@ -538,11 +544,12 @@ "id": "1627460d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.392816Z", - "iopub.status.busy": "2023-07-31T02:14:47.392715Z", - "iopub.status.idle": "2023-07-31T02:14:47.414278Z", - "shell.execute_reply": "2023-07-31T02:14:47.414015Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.091649Z", + "iopub.status.busy": "2023-08-06T17:34:56.091540Z", + "iopub.status.idle": "2023-08-06T17:34:56.113415Z", + "shell.execute_reply": "2023-08-06T17:34:56.113164Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -568,7 +575,7 @@ " Y,\n", " cv=cv)\n", " cv_error[i] = np.mean(M_CV['test_score'])\n", - "cv_error" + "cv_error\n" ] }, { @@ -602,11 +609,12 @@ "id": "8a636468", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.415780Z", - "iopub.status.busy": "2023-07-31T02:14:47.415699Z", - "iopub.status.idle": "2023-07-31T02:14:47.421148Z", - "shell.execute_reply": "2023-07-31T02:14:47.420911Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.114990Z", + "iopub.status.busy": "2023-08-06T17:34:56.114909Z", + "iopub.status.idle": "2023-08-06T17:34:56.120375Z", + "shell.execute_reply": "2023-08-06T17:34:56.120121Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -628,7 +636,7 @@ " Auto.drop(['mpg'], axis=1),\n", " Auto['mpg'],\n", " cv=validation);\n", - "results['test_score']" + "results['test_score']\n" ] }, { @@ -645,10 +653,10 @@ "id": "746aeccd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.422643Z", - "iopub.status.busy": "2023-07-31T02:14:47.422562Z", - "iopub.status.idle": "2023-07-31T02:14:47.442227Z", - "shell.execute_reply": "2023-07-31T02:14:47.441935Z" + "iopub.execute_input": "2023-08-06T17:34:56.121875Z", + "iopub.status.busy": "2023-08-06T17:34:56.121788Z", + "iopub.status.idle": "2023-08-06T17:34:56.141044Z", + "shell.execute_reply": "2023-08-06T17:34:56.140787Z" } }, "outputs": [ @@ -671,7 +679,7 @@ " Auto.drop(['mpg'], axis=1),\n", " Auto['mpg'],\n", " cv=validation)\n", - "results['test_score'].mean(), results['test_score'].std()" + "results['test_score'].mean(), results['test_score'].std()\n" ] }, { @@ -719,11 +727,12 @@ "id": "daa53d0c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.443783Z", - "iopub.status.busy": "2023-07-31T02:14:47.443671Z", - "iopub.status.idle": "2023-07-31T02:14:47.447006Z", - "shell.execute_reply": "2023-07-31T02:14:47.446693Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.142563Z", + "iopub.status.busy": "2023-08-06T17:34:56.142482Z", + "iopub.status.idle": "2023-08-06T17:34:56.146459Z", + "shell.execute_reply": "2023-08-06T17:34:56.146215Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -731,7 +740,7 @@ "def alpha_func(D, idx):\n", " cov_ = np.cov(D[['X','Y']].loc[idx], rowvar=False)\n", " return ((cov_[1,1] - cov_[0,1]) /\n", - " (cov_[0,0]+cov_[1,1]-2*cov_[0,1]))" + " (cov_[0,0]+cov_[1,1]-2*cov_[0,1]))\n" ] }, { @@ -752,10 +761,10 @@ "id": "578c9564", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.448908Z", - "iopub.status.busy": "2023-07-31T02:14:47.448792Z", - "iopub.status.idle": "2023-07-31T02:14:47.451963Z", - "shell.execute_reply": "2023-07-31T02:14:47.451646Z" + "iopub.execute_input": "2023-08-06T17:34:56.147902Z", + "iopub.status.busy": "2023-08-06T17:34:56.147820Z", + "iopub.status.idle": "2023-08-06T17:34:56.150542Z", + "shell.execute_reply": "2023-08-06T17:34:56.150288Z" } }, "outputs": [ @@ -791,11 +800,12 @@ "id": "5754d6d5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.453581Z", - "iopub.status.busy": "2023-07-31T02:14:47.453484Z", - "iopub.status.idle": "2023-07-31T02:14:47.457771Z", - "shell.execute_reply": "2023-07-31T02:14:47.457529Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.151951Z", + "iopub.status.busy": "2023-08-06T17:34:56.151874Z", + "iopub.status.idle": "2023-08-06T17:34:56.155780Z", + "shell.execute_reply": "2023-08-06T17:34:56.155537Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -833,11 +843,12 @@ "id": "8320a49c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.459153Z", - "iopub.status.busy": "2023-07-31T02:14:47.459066Z", - "iopub.status.idle": "2023-07-31T02:14:47.461370Z", - "shell.execute_reply": "2023-07-31T02:14:47.461113Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.157150Z", + "iopub.status.busy": "2023-08-06T17:34:56.157060Z", + "iopub.status.idle": "2023-08-06T17:34:56.159342Z", + "shell.execute_reply": "2023-08-06T17:34:56.159133Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -868,7 +879,7 @@ "unimportant and simply makes sure the loop is executed `B` times.\n", "\n", "Let’s use our function to evaluate the accuracy of our\n", - "estimate of $\\alpha$ using $B=1{,}000$ bootstrap replications." + "estimate of $\\alpha$ using $B=1{,}000$ bootstrap replications. " ] }, { @@ -877,10 +888,10 @@ "id": "e656aa1f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.462792Z", - "iopub.status.busy": "2023-07-31T02:14:47.462698Z", - "iopub.status.idle": "2023-07-31T02:14:47.745378Z", - "shell.execute_reply": "2023-07-31T02:14:47.745111Z" + "iopub.execute_input": "2023-08-06T17:34:56.160707Z", + "iopub.status.busy": "2023-08-06T17:34:56.160617Z", + "iopub.status.idle": "2023-08-06T17:34:56.455515Z", + "shell.execute_reply": "2023-08-06T17:34:56.455259Z" } }, "outputs": [ @@ -900,7 +911,7 @@ " Portfolio,\n", " B=1000,\n", " seed=0)\n", - "alpha_SE" + "alpha_SE\n" ] }, { @@ -943,11 +954,12 @@ "id": "c5d14195", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.746827Z", - "iopub.status.busy": "2023-07-31T02:14:47.746750Z", - "iopub.status.idle": "2023-07-31T02:14:47.748785Z", - "shell.execute_reply": "2023-07-31T02:14:47.748522Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.457024Z", + "iopub.status.busy": "2023-08-06T17:34:56.456940Z", + "iopub.status.idle": "2023-08-06T17:34:56.459011Z", + "shell.execute_reply": "2023-08-06T17:34:56.458766Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -977,15 +989,16 @@ "id": "7e0523f0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.750186Z", - "iopub.status.busy": "2023-07-31T02:14:47.750111Z", - "iopub.status.idle": "2023-07-31T02:14:47.751794Z", - "shell.execute_reply": "2023-07-31T02:14:47.751573Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.460430Z", + "iopub.status.busy": "2023-08-06T17:34:56.460350Z", + "iopub.status.idle": "2023-08-06T17:34:56.462034Z", + "shell.execute_reply": "2023-08-06T17:34:56.461808Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "hp_func = partial(boot_OLS, MS(['horsepower']), 'mpg')" + "hp_func = partial(boot_OLS, MS(['horsepower']), 'mpg')\n" ] }, { @@ -1009,11 +1022,12 @@ "id": "32836e93", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.753215Z", - "iopub.status.busy": "2023-07-31T02:14:47.753126Z", - "iopub.status.idle": "2023-07-31T02:14:47.768431Z", - "shell.execute_reply": "2023-07-31T02:14:47.768162Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.463386Z", + "iopub.status.busy": "2023-08-06T17:34:56.463311Z", + "iopub.status.idle": "2023-08-06T17:34:56.477900Z", + "shell.execute_reply": "2023-08-06T17:34:56.477641Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1041,7 +1055,7 @@ "np.array([hp_func(Auto,\n", " rng.choice(392,\n", " 392,\n", - " replace=True)) for _ in range(10)])" + " replace=True)) for _ in range(10)])\n" ] }, { @@ -1059,11 +1073,12 @@ "id": "14ce3afa", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:47.769912Z", - "iopub.status.busy": "2023-07-31T02:14:47.769830Z", - "iopub.status.idle": "2023-07-31T02:14:48.926601Z", - "shell.execute_reply": "2023-07-31T02:14:48.926292Z" - } + "iopub.execute_input": "2023-08-06T17:34:56.479382Z", + "iopub.status.busy": "2023-08-06T17:34:56.479299Z", + "iopub.status.idle": "2023-08-06T17:34:57.627980Z", + "shell.execute_reply": "2023-08-06T17:34:57.627706Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1084,7 +1099,7 @@ " Auto,\n", " B=1000,\n", " seed=10)\n", - "hp_se" + "hp_se\n" ] }, { @@ -1108,11 +1123,12 @@ "id": "6b1213ac", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:48.928216Z", - "iopub.status.busy": "2023-07-31T02:14:48.928105Z", - "iopub.status.idle": "2023-07-31T02:14:48.985288Z", - "shell.execute_reply": "2023-07-31T02:14:48.985012Z" - } + "iopub.execute_input": "2023-08-06T17:34:57.629628Z", + "iopub.status.busy": "2023-08-06T17:34:57.629520Z", + "iopub.status.idle": "2023-08-06T17:34:57.687018Z", + "shell.execute_reply": "2023-08-06T17:34:57.686748Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1131,7 +1147,7 @@ "source": [ "hp_model.fit(Auto, Auto['mpg'])\n", "model_se = summarize(hp_model.results_)['std err']\n", - "model_se" + "model_se\n" ] }, { @@ -1179,10 +1195,10 @@ "id": "af99b778", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:48.986895Z", - "iopub.status.busy": "2023-07-31T02:14:48.986777Z", - "iopub.status.idle": "2023-07-31T02:14:50.767999Z", - "shell.execute_reply": "2023-07-31T02:14:50.767687Z" + "iopub.execute_input": "2023-08-06T17:34:57.688662Z", + "iopub.status.busy": "2023-08-06T17:34:57.688521Z", + "iopub.status.idle": "2023-08-06T17:34:59.481117Z", + "shell.execute_reply": "2023-08-06T17:34:59.480813Z" } }, "outputs": [ @@ -1205,7 +1221,7 @@ "quad_func = partial(boot_OLS,\n", " quad_model,\n", " 'mpg')\n", - "boot_SE(quad_func, Auto, B=1000)" + "boot_SE(quad_func, Auto, B=1000)\n" ] }, { @@ -1222,11 +1238,12 @@ "id": "0206281e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:50.769670Z", - "iopub.status.busy": "2023-07-31T02:14:50.769556Z", - "iopub.status.idle": "2023-07-31T02:14:50.778195Z", - "shell.execute_reply": "2023-07-31T02:14:50.777948Z" - } + "iopub.execute_input": "2023-08-06T17:34:59.482760Z", + "iopub.status.busy": "2023-08-06T17:34:59.482640Z", + "iopub.status.idle": "2023-08-06T17:34:59.491295Z", + "shell.execute_reply": "2023-08-06T17:34:59.491041Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1246,15 +1263,24 @@ "source": [ "M = sm.OLS(Auto['mpg'],\n", " quad_model.fit_transform(Auto))\n", - "summarize(M.fit())['std err']" + "summarize(M.fit())['std err']\n" + ] + }, + { + "cell_type": "markdown", + "id": "0c11a71f", + "metadata": {}, + "source": [ + "\n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch6-varselect-lab.ipynb b/Ch6-varselect-lab.ipynb index 9b0292d..9850367 100644 --- a/Ch6-varselect-lab.ipynb +++ b/Ch6-varselect-lab.ipynb @@ -2,33 +2,34 @@ "cells": [ { "cell_type": "markdown", - "id": "1e9ee9d8", + "id": "73428d07", "metadata": {}, "source": [ + "\n", "# Chapter 6" ] }, { "cell_type": "markdown", - "id": "98c1f26d", + "id": "3479aab9", "metadata": {}, "source": [ "# Lab: Linear Models and Regularization Methods\n", "In this lab we implement many of the techniques discussed in this chapter.\n", "We import some of our libraries at this top\n", - "level." + "level. " ] }, { "cell_type": "code", "execution_count": 1, - "id": "564883b2", + "id": "a121caba", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:51.941671Z", - "iopub.status.busy": "2023-07-31T02:14:51.941379Z", - "iopub.status.idle": "2023-07-31T02:14:52.976659Z", - "shell.execute_reply": "2023-07-31T02:14:52.976043Z" + "iopub.execute_input": "2023-08-06T17:35:00.786819Z", + "iopub.status.busy": "2023-08-06T17:35:00.786401Z", + "iopub.status.idle": "2023-08-06T17:35:01.840861Z", + "shell.execute_reply": "2023-08-06T17:35:01.840276Z" } }, "outputs": [], @@ -42,12 +43,12 @@ "from sklearn.preprocessing import StandardScaler\n", "from ISLP import load_data\n", "from ISLP.models import ModelSpec as MS\n", - "from functools import partial" + "from functools import partial\n" ] }, { "cell_type": "markdown", - "id": "0594e13e", + "id": "b846a10e", "metadata": {}, "source": [ "We again collect the new imports\n", @@ -57,14 +58,15 @@ { "cell_type": "code", "execution_count": 2, - "id": "9aa8d3ee", + "id": "91b5adfb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:52.978919Z", - "iopub.status.busy": "2023-07-31T02:14:52.978625Z", - "iopub.status.idle": "2023-07-31T02:14:54.800247Z", - "shell.execute_reply": "2023-07-31T02:14:54.799907Z" - } + "iopub.execute_input": "2023-08-06T17:35:01.843052Z", + "iopub.status.busy": "2023-08-06T17:35:01.842795Z", + "iopub.status.idle": "2023-08-06T17:35:03.677217Z", + "shell.execute_reply": "2023-08-06T17:35:03.676896Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -88,12 +90,12 @@ " sklearn_selected,\n", " sklearn_selection_path)\n", "!pip install l0bnb\n", - "from l0bnb import fit_path" + "from l0bnb import fit_path\n" ] }, { "cell_type": "markdown", - "id": "06a58c0b", + "id": "d363de72", "metadata": {}, "source": [ "We have installed the package `l0bnb` on the fly. Note the escaped `!pip install` --- this is run as a separate system command. \n", @@ -120,13 +122,13 @@ { "cell_type": "code", "execution_count": 3, - "id": "05371e33", + "id": "01b6e940", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.802107Z", - "iopub.status.busy": "2023-07-31T02:14:54.801990Z", - "iopub.status.idle": "2023-07-31T02:14:54.809259Z", - "shell.execute_reply": "2023-07-31T02:14:54.809012Z" + "iopub.execute_input": "2023-08-06T17:35:03.679036Z", + "iopub.status.busy": "2023-08-06T17:35:03.678916Z", + "iopub.status.idle": "2023-08-06T17:35:03.686163Z", + "shell.execute_reply": "2023-08-06T17:35:03.685904Z" } }, "outputs": [ @@ -143,12 +145,12 @@ ], "source": [ "Hitters = load_data('Hitters')\n", - "np.isnan(Hitters['Salary']).sum()" + "np.isnan(Hitters['Salary']).sum()\n" ] }, { "cell_type": "markdown", - "id": "8071b084", + "id": "409d79c0", "metadata": {}, "source": [ " We see that `Salary` is missing for 59 players. The\n", @@ -159,14 +161,15 @@ { "cell_type": "code", "execution_count": 4, - "id": "aa5bc5b8", + "id": "3472ea4b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.810704Z", - "iopub.status.busy": "2023-07-31T02:14:54.810602Z", - "iopub.status.idle": "2023-07-31T02:14:54.813996Z", - "shell.execute_reply": "2023-07-31T02:14:54.813735Z" - } + "iopub.execute_input": "2023-08-06T17:35:03.687686Z", + "iopub.status.busy": "2023-08-06T17:35:03.687591Z", + "iopub.status.idle": "2023-08-06T17:35:03.691017Z", + "shell.execute_reply": "2023-08-06T17:35:03.690736Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -182,12 +185,12 @@ ], "source": [ "Hitters = Hitters.dropna();\n", - "Hitters.shape" + "Hitters.shape\n" ] }, { "cell_type": "markdown", - "id": "d5017407", + "id": "b3a1b082", "metadata": {}, "source": [ "We first choose the best model using forward selection based on $C_p$ (6.2). This score\n", @@ -199,14 +202,15 @@ { "cell_type": "code", "execution_count": 5, - "id": "10494837", + "id": "4090cab5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.815512Z", - "iopub.status.busy": "2023-07-31T02:14:54.815419Z", - "iopub.status.idle": "2023-07-31T02:14:54.817462Z", - "shell.execute_reply": "2023-07-31T02:14:54.817200Z" - } + "iopub.execute_input": "2023-08-06T17:35:03.692519Z", + "iopub.status.busy": "2023-08-06T17:35:03.692417Z", + "iopub.status.idle": "2023-08-06T17:35:03.694378Z", + "shell.execute_reply": "2023-08-06T17:35:03.694116Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -215,12 +219,12 @@ " n, p = X.shape\n", " Yhat = estimator.predict(X)\n", " RSS = np.sum((Y - Yhat)**2)\n", - " return -(RSS + 2 * p * sigma2) / n " + " return -(RSS + 2 * p * sigma2) / n \n" ] }, { "cell_type": "markdown", - "id": "126e9322", + "id": "c37b9aed", "metadata": {}, "source": [ "We need to estimate the residual variance $\\sigma^2$, which is the first argument in our scoring function above.\n", @@ -230,13 +234,13 @@ { "cell_type": "code", "execution_count": 6, - "id": "b8173cef", + "id": "2b85c1d6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.818903Z", - "iopub.status.busy": "2023-07-31T02:14:54.818801Z", - "iopub.status.idle": "2023-07-31T02:14:54.831727Z", - "shell.execute_reply": "2023-07-31T02:14:54.831458Z" + "iopub.execute_input": "2023-08-06T17:35:03.695743Z", + "iopub.status.busy": "2023-08-06T17:35:03.695653Z", + "iopub.status.idle": "2023-08-06T17:35:03.708301Z", + "shell.execute_reply": "2023-08-06T17:35:03.708031Z" } }, "outputs": [], @@ -244,12 +248,12 @@ "design = MS(Hitters.columns.drop('Salary')).fit(Hitters)\n", "Y = np.array(Hitters['Salary'])\n", "X = design.transform(Hitters)\n", - "sigma2 = OLS(Y,X).fit().scale" + "sigma2 = OLS(Y,X).fit().scale\n" ] }, { "cell_type": "markdown", - "id": "f873c04f", + "id": "e8b97efd", "metadata": {}, "source": [ "The function `sklearn_selected()` expects a scorer with just three arguments --- the last three in the definition of `nCp()` above. We use the function `partial()` first seen in Section 5.3.3 to freeze the first argument with our estimate of $\\sigma^2$." @@ -258,31 +262,32 @@ { "cell_type": "code", "execution_count": 7, - "id": "0cc8d7bd", + "id": "7c6f93c0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.833260Z", - "iopub.status.busy": "2023-07-31T02:14:54.833174Z", - "iopub.status.idle": "2023-07-31T02:14:54.835084Z", - "shell.execute_reply": "2023-07-31T02:14:54.834749Z" - } + "iopub.execute_input": "2023-08-06T17:35:03.709763Z", + "iopub.status.busy": "2023-08-06T17:35:03.709684Z", + "iopub.status.idle": "2023-08-06T17:35:03.711458Z", + "shell.execute_reply": "2023-08-06T17:35:03.711205Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ - "neg_Cp = partial(nCp, sigma2)" + "neg_Cp = partial(nCp, sigma2)\n" ] }, { "cell_type": "markdown", - "id": "3ff5a859", + "id": "392e5247", "metadata": {}, "source": [ - "We can now use `neg_Cp()` as a scorer for model selection." + "We can now use `neg_Cp()` as a scorer for model selection.\n" ] }, { "cell_type": "markdown", - "id": "2b30b7bd", + "id": "47461c19", "metadata": {}, "source": [ "Along with a score we need to specify the search strategy. This is done through the object\n", @@ -295,25 +300,25 @@ { "cell_type": "code", "execution_count": 8, - "id": "440b4c50", + "id": "4b0d8d44", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.836548Z", - "iopub.status.busy": "2023-07-31T02:14:54.836467Z", - "iopub.status.idle": "2023-07-31T02:14:54.838223Z", - "shell.execute_reply": "2023-07-31T02:14:54.837976Z" + "iopub.execute_input": "2023-08-06T17:35:03.712955Z", + "iopub.status.busy": "2023-08-06T17:35:03.712871Z", + "iopub.status.idle": "2023-08-06T17:35:03.714691Z", + "shell.execute_reply": "2023-08-06T17:35:03.714446Z" } }, "outputs": [], "source": [ "strategy = Stepwise.first_peak(design,\n", " direction='forward',\n", - " max_terms=len(design.terms))" + " max_terms=len(design.terms))\n" ] }, { "cell_type": "markdown", - "id": "77079484", + "id": "0f8a2102", "metadata": {}, "source": [ "We now fit a linear regression model with `Salary` as outcome using forward\n", @@ -326,13 +331,13 @@ { "cell_type": "code", "execution_count": 9, - "id": "b33a8617", + "id": "6d3c1d1f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:54.839611Z", - "iopub.status.busy": "2023-07-31T02:14:54.839537Z", - "iopub.status.idle": "2023-07-31T02:14:55.493223Z", - "shell.execute_reply": "2023-07-31T02:14:55.492936Z" + "iopub.execute_input": "2023-08-06T17:35:03.716059Z", + "iopub.status.busy": "2023-08-06T17:35:03.715979Z", + "iopub.status.idle": "2023-08-06T17:35:04.363068Z", + "shell.execute_reply": "2023-08-06T17:35:04.362795Z" } }, "outputs": [ @@ -369,12 +374,12 @@ "hitters_MSE = sklearn_selected(OLS,\n", " strategy)\n", "hitters_MSE.fit(Hitters, Y)\n", - "hitters_MSE.selected_state_" + "hitters_MSE.selected_state_\n" ] }, { "cell_type": "markdown", - "id": "233e45a1", + "id": "cf1ad8eb", "metadata": {}, "source": [ "Using `neg_Cp` results in a smaller model, as expected, with just 10 variables selected." @@ -383,13 +388,13 @@ { "cell_type": "code", "execution_count": 10, - "id": "e7f554cf", + "id": "5644971d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:55.494899Z", - "iopub.status.busy": "2023-07-31T02:14:55.494782Z", - "iopub.status.idle": "2023-07-31T02:14:55.903007Z", - "shell.execute_reply": "2023-07-31T02:14:55.902723Z" + "iopub.execute_input": "2023-08-06T17:35:04.364696Z", + "iopub.status.busy": "2023-08-06T17:35:04.364585Z", + "iopub.status.idle": "2023-08-06T17:35:04.769869Z", + "shell.execute_reply": "2023-08-06T17:35:04.769597Z" } }, "outputs": [ @@ -418,12 +423,12 @@ " strategy,\n", " scoring=neg_Cp)\n", "hitters_Cp.fit(Hitters, Y)\n", - "hitters_Cp.selected_state_" + "hitters_Cp.selected_state_\n" ] }, { "cell_type": "markdown", - "id": "75e8008b", + "id": "1db8634e", "metadata": {}, "source": [ "### Choosing Among Models Using the Validation Set Approach and Cross-Validation\n", @@ -438,7 +443,7 @@ }, { "cell_type": "markdown", - "id": "fc753395", + "id": "08bdcec5", "metadata": {}, "source": [ "Here we define a strategy that fits the full forward selection path.\n", @@ -449,13 +454,13 @@ { "cell_type": "code", "execution_count": 11, - "id": "fb7091b8", + "id": "23f47f58", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:55.904614Z", - "iopub.status.busy": "2023-07-31T02:14:55.904500Z", - "iopub.status.idle": "2023-07-31T02:14:55.906419Z", - "shell.execute_reply": "2023-07-31T02:14:55.906168Z" + "iopub.execute_input": "2023-08-06T17:35:04.771518Z", + "iopub.status.busy": "2023-08-06T17:35:04.771411Z", + "iopub.status.idle": "2023-08-06T17:35:04.773352Z", + "shell.execute_reply": "2023-08-06T17:35:04.773084Z" } }, "outputs": [], @@ -463,12 +468,12 @@ "strategy = Stepwise.fixed_steps(design,\n", " len(design.terms),\n", " direction='forward')\n", - "full_path = sklearn_selection_path(OLS, strategy)" + "full_path = sklearn_selection_path(OLS, strategy)\n" ] }, { "cell_type": "markdown", - "id": "7f5f599f", + "id": "63e94493", "metadata": {}, "source": [ "We now fit the full forward-selection path on the `Hitters` data and compute the fitted values." @@ -477,14 +482,15 @@ { "cell_type": "code", "execution_count": 12, - "id": "56adc728", + "id": "e8e0a90d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:55.908048Z", - "iopub.status.busy": "2023-07-31T02:14:55.907949Z", - "iopub.status.idle": "2023-07-31T02:14:56.300215Z", - "shell.execute_reply": "2023-07-31T02:14:56.299939Z" - } + "iopub.execute_input": "2023-08-06T17:35:04.774784Z", + "iopub.status.busy": "2023-08-06T17:35:04.774690Z", + "iopub.status.idle": "2023-08-06T17:35:05.168838Z", + "shell.execute_reply": "2023-08-06T17:35:05.168549Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -501,12 +507,12 @@ "source": [ "full_path.fit(Hitters, Y)\n", "Yhat_in = full_path.predict(Hitters)\n", - "Yhat_in.shape" + "Yhat_in.shape\n" ] }, { "cell_type": "markdown", - "id": "0b771d23", + "id": "36008ae0", "metadata": {}, "source": [ "This gives us an array of fitted values --- 20 steps in all, including the fitted mean for the null model --- which we can use to evaluate\n", @@ -521,14 +527,15 @@ { "cell_type": "code", "execution_count": 13, - "id": "387267d9", + "id": "4e44d7ad", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:56.301852Z", - "iopub.status.busy": "2023-07-31T02:14:56.301734Z", - "iopub.status.idle": "2023-07-31T02:14:56.487394Z", - "shell.execute_reply": "2023-07-31T02:14:56.486667Z" - } + "iopub.execute_input": "2023-08-06T17:35:05.170387Z", + "iopub.status.busy": "2023-08-06T17:35:05.170300Z", + "iopub.status.idle": "2023-08-06T17:35:05.352387Z", + "shell.execute_reply": "2023-08-06T17:35:05.350850Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -556,12 +563,12 @@ " fontsize=20)\n", "ax.set_xticks(np.arange(n_steps)[::2])\n", "ax.legend()\n", - "ax.set_ylim([50000,250000]);" + "ax.set_ylim([50000,250000]);\n" ] }, { "cell_type": "markdown", - "id": "fc09acdc", + "id": "f0113aa5", "metadata": {}, "source": [ "Notice the expression `None` in `Y[:,None]` above.\n", @@ -571,7 +578,7 @@ }, { "cell_type": "markdown", - "id": "2a1511cd", + "id": "e3daf6ac", "metadata": {}, "source": [ "We are now ready to use cross-validation to estimate test error along\n", @@ -589,14 +596,15 @@ { "cell_type": "code", "execution_count": 14, - "id": "0047ba88", + "id": "c8b63bdf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:56.491760Z", - "iopub.status.busy": "2023-07-31T02:14:56.491487Z", - "iopub.status.idle": "2023-07-31T02:14:58.464393Z", - "shell.execute_reply": "2023-07-31T02:14:58.464098Z" - } + "iopub.execute_input": "2023-08-06T17:35:05.356634Z", + "iopub.status.busy": "2023-08-06T17:35:05.356263Z", + "iopub.status.idle": "2023-08-06T17:35:07.379649Z", + "shell.execute_reply": "2023-08-06T17:35:07.379349Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -619,14 +627,15 @@ " Hitters,\n", " Y,\n", " cv=kfold)\n", - "Yhat_cv.shape" + "Yhat_cv.shape\n" ] }, { "cell_type": "markdown", - "id": "c6df5d31", + "id": "734ebc1a", "metadata": {}, "source": [ + "`skm.cross_val_predict()`\n", "The prediction matrix `Yhat_cv` is the same shape as `Yhat_in`; the difference is that the predictions in each row, corresponding to a particular sample index, were made from models fit on a training fold that did not include that row.\n", "\n", "At each model along the path, we compute the MSE in each of the cross-validation folds.\n", @@ -641,13 +650,13 @@ { "cell_type": "code", "execution_count": 15, - "id": "27b0eb63", + "id": "c2a5b743", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:58.466035Z", - "iopub.status.busy": "2023-07-31T02:14:58.465931Z", - "iopub.status.idle": "2023-07-31T02:14:58.469179Z", - "shell.execute_reply": "2023-07-31T02:14:58.468827Z" + "iopub.execute_input": "2023-08-06T17:35:07.381451Z", + "iopub.status.busy": "2023-08-06T17:35:07.381333Z", + "iopub.status.idle": "2023-08-06T17:35:07.384547Z", + "shell.execute_reply": "2023-08-06T17:35:07.384245Z" } }, "outputs": [ @@ -668,28 +677,28 @@ " errors = (Yhat_cv[test_idx] - Y[test_idx,None])**2\n", " cv_mse.append(errors.mean(0)) # column means\n", "cv_mse = np.array(cv_mse).T\n", - "cv_mse.shape" + "cv_mse.shape\n" ] }, { "cell_type": "markdown", - "id": "223556f8", + "id": "eeace224", "metadata": {}, "source": [ "We now add the cross-validation error estimates to our MSE plot.\n", - "We include the mean error across the five folds, and the estimate of the standard error of the mean." + "We include the mean error across the five folds, and the estimate of the standard error of the mean. " ] }, { "cell_type": "code", "execution_count": 16, - "id": "a45fe587", + "id": "678b6284", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:58.470717Z", - "iopub.status.busy": "2023-07-31T02:14:58.470635Z", - "iopub.status.idle": "2023-07-31T02:14:58.557218Z", - "shell.execute_reply": "2023-07-31T02:14:58.556947Z" + "iopub.execute_input": "2023-08-06T17:35:07.385961Z", + "iopub.status.busy": "2023-08-06T17:35:07.385880Z", + "iopub.status.idle": "2023-08-06T17:35:07.473192Z", + "shell.execute_reply": "2023-08-06T17:35:07.472899Z" } }, "outputs": [ @@ -713,30 +722,31 @@ " c='r') # color red\n", "ax.set_ylim([50000,250000])\n", "ax.legend()\n", - "mse_fig" + "mse_fig\n" ] }, { "cell_type": "markdown", - "id": "fb4fa850", + "id": "5e27d9a1", "metadata": {}, "source": [ "To repeat the above using the validation set approach, we simply change our\n", "`cv` argument to a validation set: one random split of the data into a test and training. We choose a test size\n", - "of 20%, similar to the size of each test set in 5-fold cross-validation." + "of 20%, similar to the size of each test set in 5-fold cross-validation.`skm.ShuffleSplit()`" ] }, { "cell_type": "code", "execution_count": 17, - "id": "c71c2079", + "id": "f55f5449", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:58.558792Z", - "iopub.status.busy": "2023-07-31T02:14:58.558689Z", - "iopub.status.idle": "2023-07-31T02:14:58.952107Z", - "shell.execute_reply": "2023-07-31T02:14:58.951723Z" - } + "iopub.execute_input": "2023-08-06T17:35:07.474839Z", + "iopub.status.busy": "2023-08-06T17:35:07.474729Z", + "iopub.status.idle": "2023-08-06T17:35:07.866358Z", + "shell.execute_reply": "2023-08-06T17:35:07.866074Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -748,12 +758,12 @@ " Y[train_idx])\n", " Yhat_val = full_path.predict(Hitters.iloc[test_idx])\n", " errors = (Yhat_val - Y[test_idx,None])**2\n", - " validation_mse = errors.mean(0)" + " validation_mse = errors.mean(0)\n" ] }, { "cell_type": "markdown", - "id": "d34bb7ab", + "id": "b778cde1", "metadata": {}, "source": [ " As for the in-sample MSE case, the validation set approach does not provide standard errors." @@ -762,14 +772,15 @@ { "cell_type": "code", "execution_count": 18, - "id": "2ff34edf", + "id": "791c91cf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:58.953820Z", - "iopub.status.busy": "2023-07-31T02:14:58.953737Z", - "iopub.status.idle": "2023-07-31T02:14:59.043030Z", - "shell.execute_reply": "2023-07-31T02:14:59.042743Z" - } + "iopub.execute_input": "2023-08-06T17:35:07.868260Z", + "iopub.status.busy": "2023-08-06T17:35:07.868151Z", + "iopub.status.idle": "2023-08-06T17:35:07.959616Z", + "shell.execute_reply": "2023-08-06T17:35:07.959298Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -792,12 +803,12 @@ "ax.set_xticks(np.arange(n_steps)[::2])\n", "ax.set_ylim([50000,250000])\n", "ax.legend()\n", - "mse_fig" + "mse_fig\n" ] }, { "cell_type": "markdown", - "id": "e5517334", + "id": "13144579", "metadata": {}, "source": [ "### Best Subset Selection\n", @@ -808,31 +819,32 @@ "best subset selection.\n", "Instead of constraining the subset to be a given size,\n", "this package produces a path of solutions using the subset size as a\n", - "penalty rather than a constraint. Although the distinction is subtle, the difference comes when we cross-validate." + "penalty rather than a constraint. Although the distinction is subtle, the difference comes when we cross-validate. \n" ] }, { "cell_type": "code", "execution_count": 19, - "id": "845f3fa0", + "id": "2c796192", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:59.044595Z", - "iopub.status.busy": "2023-07-31T02:14:59.044486Z", - "iopub.status.idle": "2023-07-31T02:14:59.055901Z", - "shell.execute_reply": "2023-07-31T02:14:59.055632Z" - } + "iopub.execute_input": "2023-08-06T17:35:07.961298Z", + "iopub.status.busy": "2023-08-06T17:35:07.961209Z", + "iopub.status.idle": "2023-08-06T17:35:07.972689Z", + "shell.execute_reply": "2023-08-06T17:35:07.972416Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "D = design.fit_transform(Hitters)\n", "D = D.drop('intercept', axis=1)\n", - "X = np.asarray(D)" + "X = np.asarray(D)\n" ] }, { "cell_type": "markdown", - "id": "4c0d0e19", + "id": "95a3f639", "metadata": {}, "source": [ "Here we excluded the first column corresponding to the intercept, as\n", @@ -842,13 +854,13 @@ { "cell_type": "code", "execution_count": 20, - "id": "e9f943e7", + "id": "abb9e7ac", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:14:59.057369Z", - "iopub.status.busy": "2023-07-31T02:14:59.057289Z", - "iopub.status.idle": "2023-07-31T02:15:01.228717Z", - "shell.execute_reply": "2023-07-31T02:15:01.228431Z" + "iopub.execute_input": "2023-08-06T17:35:07.974253Z", + "iopub.status.busy": "2023-08-06T17:35:07.974167Z", + "iopub.status.idle": "2023-08-06T17:35:10.125189Z", + "shell.execute_reply": "2023-08-06T17:35:10.124893Z" } }, "outputs": [ @@ -883,12 +895,12 @@ "source": [ "path = fit_path(X, \n", " Y,\n", - " max_nonzeros=X.shape[1])" + " max_nonzeros=X.shape[1])\n" ] }, { "cell_type": "markdown", - "id": "67ef90b5", + "id": "6c577e2a", "metadata": {}, "source": [ "The function `fit_path()` returns a list whose values include the fitted coefficients as `B`, an intercept as `B0`, as well as a few other attributes related to the particular path algorithm used. Such details are beyond the scope of this book." @@ -897,14 +909,15 @@ { "cell_type": "code", "execution_count": 21, - "id": "657ac171", + "id": "70f1c6c2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.230368Z", - "iopub.status.busy": "2023-07-31T02:15:01.230274Z", - "iopub.status.idle": "2023-07-31T02:15:01.232838Z", - "shell.execute_reply": "2023-07-31T02:15:01.232586Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.126871Z", + "iopub.status.busy": "2023-08-06T17:35:10.126769Z", + "iopub.status.idle": "2023-08-06T17:35:10.129192Z", + "shell.execute_reply": "2023-08-06T17:35:10.128949Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -926,12 +939,12 @@ } ], "source": [ - "path[3]" + "path[3]\n" ] }, { "cell_type": "markdown", - "id": "2c9e040a", + "id": "1882702b", "metadata": {}, "source": [ "In the example above, we see that at the fourth step in the path, we have two nonzero coefficients in `'B'`, corresponding to the value $0.114$ for the penalty parameter `lambda_0`.\n", @@ -961,14 +974,15 @@ { "cell_type": "code", "execution_count": 22, - "id": "e576ad54", + "id": "9f1fc533", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.234342Z", - "iopub.status.busy": "2023-07-31T02:15:01.234246Z", - "iopub.status.idle": "2023-07-31T02:15:01.302141Z", - "shell.execute_reply": "2023-07-31T02:15:01.301874Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.130683Z", + "iopub.status.busy": "2023-08-06T17:35:10.130585Z", + "iopub.status.idle": "2023-08-06T17:35:10.201951Z", + "shell.execute_reply": "2023-08-06T17:35:10.201689Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1397,12 +1411,12 @@ " Y,\n", " l1_ratio=0.,\n", " alphas=lambdas)[1]\n", - "soln_array.shape" + "soln_array.shape\n" ] }, { "cell_type": "markdown", - "id": "5ba706cd", + "id": "cefe307b", "metadata": {}, "source": [ "Here we extract the array of coefficients corresponding to the solutions along the regularization path.\n", @@ -1427,13 +1441,13 @@ { "cell_type": "code", "execution_count": 23, - "id": "3ef15192", + "id": "642287d1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.303943Z", - "iopub.status.busy": "2023-07-31T02:15:01.303842Z", - "iopub.status.idle": "2023-07-31T02:15:01.313074Z", - "shell.execute_reply": "2023-07-31T02:15:01.312802Z" + "iopub.execute_input": "2023-08-06T17:35:10.203715Z", + "iopub.status.busy": "2023-08-06T17:35:10.203613Z", + "iopub.status.idle": "2023-08-06T17:35:10.214312Z", + "shell.execute_reply": "2023-08-06T17:35:10.214061Z" } }, "outputs": [ @@ -1833,12 +1847,12 @@ " columns=D.columns,\n", " index=-np.log(lambdas))\n", "soln_path.index.name = 'negative log(lambda)'\n", - "soln_path" + "soln_path\n" ] }, { "cell_type": "markdown", - "id": "f73f5191", + "id": "8e2a5cd7", "metadata": {}, "source": [ "We plot the paths to get a sense of how the coefficients vary with $\\lambda$.\n", @@ -1849,14 +1863,15 @@ { "cell_type": "code", "execution_count": 24, - "id": "40b67c85", + "id": "734c1a05", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.314467Z", - "iopub.status.busy": "2023-07-31T02:15:01.314375Z", - "iopub.status.idle": "2023-07-31T02:15:01.569812Z", - "shell.execute_reply": "2023-07-31T02:15:01.569478Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.215773Z", + "iopub.status.busy": "2023-08-06T17:35:10.215682Z", + "iopub.status.idle": "2023-08-06T17:35:10.473871Z", + "shell.execute_reply": "2023-08-06T17:35:10.473500Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1875,12 +1890,12 @@ "soln_path.plot(ax=ax, legend=False)\n", "ax.set_xlabel('$-\\log(\\lambda)$', fontsize=20)\n", "ax.set_ylabel('Standardized coefficients', fontsize=20)\n", - "ax.legend(loc='upper left');" + "ax.legend(loc='upper left');\n" ] }, { "cell_type": "markdown", - "id": "84e52006", + "id": "75cfe676", "metadata": {}, "source": [ "(We have used `latex` formatting in the horizontal label, in order to format the Greek $\\lambda$ appropriately.) \n", @@ -1893,13 +1908,13 @@ { "cell_type": "code", "execution_count": 25, - "id": "d14bd86c", + "id": "5a55b76b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.571580Z", - "iopub.status.busy": "2023-07-31T02:15:01.571459Z", - "iopub.status.idle": "2023-07-31T02:15:01.576721Z", - "shell.execute_reply": "2023-07-31T02:15:01.576433Z" + "iopub.execute_input": "2023-08-06T17:35:10.475713Z", + "iopub.status.busy": "2023-08-06T17:35:10.475586Z", + "iopub.status.idle": "2023-08-06T17:35:10.479270Z", + "shell.execute_reply": "2023-08-06T17:35:10.479006Z" } }, "outputs": [ @@ -1936,12 +1951,12 @@ ], "source": [ "beta_hat = soln_path.loc[soln_path.index[39]]\n", - "lambdas[39], beta_hat" + "lambdas[39], beta_hat\n" ] }, { "cell_type": "markdown", - "id": "98ba8e99", + "id": "a8f4071c", "metadata": {}, "source": [ "Let’s compute the $\\ell_2$ norm of the standardized coefficients." @@ -1950,13 +1965,13 @@ { "cell_type": "code", "execution_count": 26, - "id": "759e215a", + "id": "cdbee899", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.578217Z", - "iopub.status.busy": "2023-07-31T02:15:01.578101Z", - "iopub.status.idle": "2023-07-31T02:15:01.580441Z", - "shell.execute_reply": "2023-07-31T02:15:01.580160Z" + "iopub.execute_input": "2023-08-06T17:35:10.480798Z", + "iopub.status.busy": "2023-08-06T17:35:10.480689Z", + "iopub.status.idle": "2023-08-06T17:35:10.483091Z", + "shell.execute_reply": "2023-08-06T17:35:10.482738Z" } }, "outputs": [ @@ -1972,12 +1987,12 @@ } ], "source": [ - "np.linalg.norm(beta_hat)" + "np.linalg.norm(beta_hat)\n" ] }, { "cell_type": "markdown", - "id": "ce79e7cb", + "id": "2511270d", "metadata": {}, "source": [ "In contrast, here is the $\\ell_2$ norm when $\\lambda$ is 2.44e-01.\n", @@ -1988,14 +2003,15 @@ { "cell_type": "code", "execution_count": 27, - "id": "b58d5ccb", + "id": "23fe1cb5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.581984Z", - "iopub.status.busy": "2023-07-31T02:15:01.581885Z", - "iopub.status.idle": "2023-07-31T02:15:01.584293Z", - "shell.execute_reply": "2023-07-31T02:15:01.584014Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.484686Z", + "iopub.status.busy": "2023-08-06T17:35:10.484597Z", + "iopub.status.idle": "2023-08-06T17:35:10.487152Z", + "shell.execute_reply": "2023-08-06T17:35:10.486881Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2011,12 +2027,12 @@ ], "source": [ "beta_hat = soln_path.loc[soln_path.index[59]]\n", - "lambdas[59], np.linalg.norm(beta_hat)" + "lambdas[59], np.linalg.norm(beta_hat)\n" ] }, { "cell_type": "markdown", - "id": "cc9a1f70", + "id": "c610fcf7", "metadata": {}, "source": [ "Above we normalized `X` upfront, and fit the ridge model using `Xs`.\n", @@ -2028,13 +2044,13 @@ { "cell_type": "code", "execution_count": 28, - "id": "74b5cae2", + "id": "fa46c4d0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.585818Z", - "iopub.status.busy": "2023-07-31T02:15:01.585716Z", - "iopub.status.idle": "2023-07-31T02:15:01.598062Z", - "shell.execute_reply": "2023-07-31T02:15:01.597752Z" + "iopub.execute_input": "2023-08-06T17:35:10.488575Z", + "iopub.status.busy": "2023-08-06T17:35:10.488492Z", + "iopub.status.idle": "2023-08-06T17:35:10.500853Z", + "shell.execute_reply": "2023-08-06T17:35:10.500570Z" } }, "outputs": [ @@ -2067,12 +2083,12 @@ "ridge = skl.ElasticNet(alpha=lambdas[59], l1_ratio=0)\n", "scaler = StandardScaler(with_mean=True, with_std=True)\n", "pipe = Pipeline(steps=[('scaler', scaler), ('ridge', ridge)])\n", - "pipe.fit(X, Y)" + "pipe.fit(X, Y)\n" ] }, { "cell_type": "markdown", - "id": "7a69991b", + "id": "a5607efa", "metadata": {}, "source": [ "We show that it gives the same $\\ell_2$ norm as in our previous fit on the standardized data." @@ -2081,14 +2097,15 @@ { "cell_type": "code", "execution_count": 29, - "id": "a89989c3", + "id": "8e775d4c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.599593Z", - "iopub.status.busy": "2023-07-31T02:15:01.599513Z", - "iopub.status.idle": "2023-07-31T02:15:01.601548Z", - "shell.execute_reply": "2023-07-31T02:15:01.601293Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.502445Z", + "iopub.status.busy": "2023-08-06T17:35:10.502342Z", + "iopub.status.idle": "2023-08-06T17:35:10.504676Z", + "shell.execute_reply": "2023-08-06T17:35:10.504390Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2103,12 +2120,12 @@ } ], "source": [ - "np.linalg.norm(ridge.coef_)" + "np.linalg.norm(ridge.coef_)\n" ] }, { "cell_type": "markdown", - "id": "c86254e4", + "id": "06771f4e", "metadata": {}, "source": [ " Notice that the operation `pipe.fit(X, Y)` above has changed the `ridge` object, and in particular has added attributes such as `coef_` that were not there before. \n", @@ -2127,13 +2144,13 @@ { "cell_type": "code", "execution_count": 30, - "id": "3eb41945", + "id": "531f7c0e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.603062Z", - "iopub.status.busy": "2023-07-31T02:15:01.602986Z", - "iopub.status.idle": "2023-07-31T02:15:01.610209Z", - "shell.execute_reply": "2023-07-31T02:15:01.609888Z" + "iopub.execute_input": "2023-08-06T17:35:10.506171Z", + "iopub.status.busy": "2023-08-06T17:35:10.506087Z", + "iopub.status.idle": "2023-08-06T17:35:10.513511Z", + "shell.execute_reply": "2023-08-06T17:35:10.513210Z" } }, "outputs": [ @@ -2166,12 +2183,12 @@ " Y,\n", " scoring='neg_mean_squared_error',\n", " cv=validation)\n", - "-results['test_score']" + "-results['test_score']\n" ] }, { "cell_type": "markdown", - "id": "660f7c63", + "id": "951f3189", "metadata": {}, "source": [ "The test MSE is 1.342e+05. Note\n", @@ -2185,14 +2202,15 @@ { "cell_type": "code", "execution_count": 31, - "id": "635bc363", + "id": "9d6abcd6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.611782Z", - "iopub.status.busy": "2023-07-31T02:15:01.611662Z", - "iopub.status.idle": "2023-07-31T02:15:01.619073Z", - "shell.execute_reply": "2023-07-31T02:15:01.618775Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.515133Z", + "iopub.status.busy": "2023-08-06T17:35:10.515021Z", + "iopub.status.idle": "2023-08-06T17:35:10.522324Z", + "shell.execute_reply": "2023-08-06T17:35:10.522079Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2221,12 +2239,12 @@ " Y,\n", " scoring='neg_mean_squared_error',\n", " cv=validation)\n", - "-results['test_score']" + "-results['test_score']\n" ] }, { "cell_type": "markdown", - "id": "c14ad9a1", + "id": "60702c2d", "metadata": {}, "source": [ "Obviously choosing $\\lambda=0.01$ is arbitrary, so we will use cross-validation or the validation-set\n", @@ -2241,13 +2259,13 @@ { "cell_type": "code", "execution_count": 32, - "id": "e117267f", + "id": "4009c7c9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:01.620657Z", - "iopub.status.busy": "2023-07-31T02:15:01.620538Z", - "iopub.status.idle": "2023-07-31T02:15:02.079833Z", - "shell.execute_reply": "2023-07-31T02:15:02.079544Z" + "iopub.execute_input": "2023-08-06T17:35:10.523797Z", + "iopub.status.busy": "2023-08-06T17:35:10.523701Z", + "iopub.status.idle": "2023-08-06T17:35:10.984369Z", + "shell.execute_reply": "2023-08-06T17:35:10.984118Z" } }, "outputs": [ @@ -2484,12 +2502,12 @@ " scoring='neg_mean_squared_error')\n", "grid.fit(X, Y)\n", "grid.best_params_['ridge__alpha']\n", - "grid.best_estimator_" + "grid.best_estimator_\n" ] }, { "cell_type": "markdown", - "id": "bc09d074", + "id": "8e22f625", "metadata": {}, "source": [ "Alternatively, we can use 5-fold cross-validation." @@ -2498,14 +2516,15 @@ { "cell_type": "code", "execution_count": 33, - "id": "0037e9e4", + "id": "1fd51cd6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:02.081467Z", - "iopub.status.busy": "2023-07-31T02:15:02.081358Z", - "iopub.status.idle": "2023-07-31T02:15:05.191496Z", - "shell.execute_reply": "2023-07-31T02:15:05.191210Z" - } + "iopub.execute_input": "2023-08-06T17:35:10.985928Z", + "iopub.status.busy": "2023-08-06T17:35:10.985818Z", + "iopub.status.idle": "2023-08-06T17:35:14.088216Z", + "shell.execute_reply": "2023-08-06T17:35:14.087921Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3540,12 +3559,12 @@ " scoring='neg_mean_squared_error')\n", "grid.fit(X, Y)\n", "grid.best_params_['ridge__alpha']\n", - "grid.best_estimator_" + "grid.best_estimator_\n" ] }, { "cell_type": "markdown", - "id": "9690407d", + "id": "245526c5", "metadata": {}, "source": [ "Recall we set up the `kfold` object for 5-fold cross-validation on page 296. We now plot the cross-validated MSE as a function of $-\\log(\\lambda)$, which has shrinkage decreasing from left\n", @@ -3555,13 +3574,13 @@ { "cell_type": "code", "execution_count": 34, - "id": "71f0f5c5", + "id": "1679fd6a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:05.193084Z", - "iopub.status.busy": "2023-07-31T02:15:05.192970Z", - "iopub.status.idle": "2023-07-31T02:15:05.291368Z", - "shell.execute_reply": "2023-07-31T02:15:05.291066Z" + "iopub.execute_input": "2023-08-06T17:35:14.089895Z", + "iopub.status.busy": "2023-08-06T17:35:14.089782Z", + "iopub.status.idle": "2023-08-06T17:35:14.187870Z", + "shell.execute_reply": "2023-08-06T17:35:14.187444Z" } }, "outputs": [ @@ -3583,12 +3602,12 @@ " yerr=grid.cv_results_['std_test_score'] / np.sqrt(K))\n", "ax.set_ylim([50000,250000])\n", "ax.set_xlabel('$-\\log(\\lambda)$', fontsize=20)\n", - "ax.set_ylabel('Cross-validated MSE', fontsize=20);" + "ax.set_ylabel('Cross-validated MSE', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "11087e26", + "id": "36cc5ca2", "metadata": {}, "source": [ "One can cross-validate different metrics to choose a parameter. The default\n", @@ -3599,13 +3618,13 @@ { "cell_type": "code", "execution_count": 35, - "id": "fb265379", + "id": "f59557ed", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:05.293023Z", - "iopub.status.busy": "2023-07-31T02:15:05.292897Z", - "iopub.status.idle": "2023-07-31T02:15:08.398570Z", - "shell.execute_reply": "2023-07-31T02:15:08.398296Z" + "iopub.execute_input": "2023-08-06T17:35:14.189531Z", + "iopub.status.busy": "2023-08-06T17:35:14.189417Z", + "iopub.status.idle": "2023-08-06T17:35:17.306928Z", + "shell.execute_reply": "2023-08-06T17:35:17.306627Z" } }, "outputs": [ @@ -4675,12 +4694,12 @@ "grid_r2 = skm.GridSearchCV(pipe, \n", " param_grid,\n", " cv=kfold)\n", - "grid_r2.fit(X, Y)" + "grid_r2.fit(X, Y)\n" ] }, { "cell_type": "markdown", - "id": "9881fe49", + "id": "5ac19760", "metadata": {}, "source": [ "Finally, let’s plot the results for cross-validated $R^2$." @@ -4689,14 +4708,15 @@ { "cell_type": "code", "execution_count": 36, - "id": "79616f48", + "id": "12d94ae6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.400177Z", - "iopub.status.busy": "2023-07-31T02:15:08.400068Z", - "iopub.status.idle": "2023-07-31T02:15:08.495262Z", - "shell.execute_reply": "2023-07-31T02:15:08.494931Z" - } + "iopub.execute_input": "2023-08-06T17:35:17.308495Z", + "iopub.status.busy": "2023-08-06T17:35:17.308379Z", + "iopub.status.idle": "2023-08-06T17:35:17.402970Z", + "shell.execute_reply": "2023-08-06T17:35:17.402653Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -4716,12 +4736,12 @@ " grid_r2.cv_results_['mean_test_score'],\n", " yerr=grid_r2.cv_results_['std_test_score'] / np.sqrt(K))\n", "ax.set_xlabel('$-\\log(\\lambda)$', fontsize=20)\n", - "ax.set_ylabel('Cross-validated $R^2$', fontsize=20);" + "ax.set_ylabel('Cross-validated $R^2$', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "5e700bf5", + "id": "f9eda9aa", "metadata": {}, "source": [ "### Fast Cross-Validation for Solution Paths\n", @@ -4737,13 +4757,13 @@ { "cell_type": "code", "execution_count": 37, - "id": "11e55883", + "id": "b1fd1281", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.496994Z", - "iopub.status.busy": "2023-07-31T02:15:08.496872Z", - "iopub.status.idle": "2023-07-31T02:15:08.840479Z", - "shell.execute_reply": "2023-07-31T02:15:08.840173Z" + "iopub.execute_input": "2023-08-06T17:35:17.404648Z", + "iopub.status.busy": "2023-08-06T17:35:17.404531Z", + "iopub.status.idle": "2023-08-06T17:35:17.759816Z", + "shell.execute_reply": "2023-08-06T17:35:17.759499Z" } }, "outputs": [ @@ -6825,12 +6845,12 @@ " cv=kfold)\n", "pipeCV = Pipeline(steps=[('scaler', scaler),\n", " ('ridge', ridgeCV)])\n", - "pipeCV.fit(X, Y)" + "pipeCV.fit(X, Y)\n" ] }, { "cell_type": "markdown", - "id": "75eb9d33", + "id": "da8395bb", "metadata": {}, "source": [ "Let’s produce a plot again of the cross-validation error to see that\n", @@ -6840,13 +6860,13 @@ { "cell_type": "code", "execution_count": 38, - "id": "d107f961", + "id": "5cf09512", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.842157Z", - "iopub.status.busy": "2023-07-31T02:15:08.842034Z", - "iopub.status.idle": "2023-07-31T02:15:08.943297Z", - "shell.execute_reply": "2023-07-31T02:15:08.943005Z" + "iopub.execute_input": "2023-08-06T17:35:17.761454Z", + "iopub.status.busy": "2023-08-06T17:35:17.761346Z", + "iopub.status.idle": "2023-08-06T17:35:17.865044Z", + "shell.execute_reply": "2023-08-06T17:35:17.864747Z" } }, "outputs": [ @@ -6870,12 +6890,12 @@ "ax.axvline(-np.log(tuned_ridge.alpha_), c='k', ls='--')\n", "ax.set_ylim([50000,250000])\n", "ax.set_xlabel('$-\\log(\\lambda)$', fontsize=20)\n", - "ax.set_ylabel('Cross-validated MSE', fontsize=20);" + "ax.set_ylabel('Cross-validated MSE', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "23a89187", + "id": "6f5eb495", "metadata": {}, "source": [ "We see that the value of $\\lambda$ that results in the\n", @@ -6887,13 +6907,13 @@ { "cell_type": "code", "execution_count": 39, - "id": "21d65d1f", + "id": "a8d6770f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.945015Z", - "iopub.status.busy": "2023-07-31T02:15:08.944889Z", - "iopub.status.idle": "2023-07-31T02:15:08.947334Z", - "shell.execute_reply": "2023-07-31T02:15:08.947057Z" + "iopub.execute_input": "2023-08-06T17:35:17.866746Z", + "iopub.status.busy": "2023-08-06T17:35:17.866628Z", + "iopub.status.idle": "2023-08-06T17:35:17.869096Z", + "shell.execute_reply": "2023-08-06T17:35:17.868823Z" } }, "outputs": [ @@ -6909,12 +6929,12 @@ } ], "source": [ - "np.min(tuned_ridge.mse_path_.mean(1))" + "np.min(tuned_ridge.mse_path_.mean(1))\n" ] }, { "cell_type": "markdown", - "id": "e8bb2108", + "id": "4da37400", "metadata": {}, "source": [ "This represents a further improvement over the test MSE that we got\n", @@ -6926,14 +6946,15 @@ { "cell_type": "code", "execution_count": 40, - "id": "11373de9", + "id": "852b1e39", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.948924Z", - "iopub.status.busy": "2023-07-31T02:15:08.948820Z", - "iopub.status.idle": "2023-07-31T02:15:08.951102Z", - "shell.execute_reply": "2023-07-31T02:15:08.950833Z" - } + "iopub.execute_input": "2023-08-06T17:35:17.870890Z", + "iopub.status.busy": "2023-08-06T17:35:17.870776Z", + "iopub.status.idle": "2023-08-06T17:35:17.873149Z", + "shell.execute_reply": "2023-08-06T17:35:17.872893Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -6952,12 +6973,12 @@ } ], "source": [ - "tuned_ridge.coef_" + "tuned_ridge.coef_\n" ] }, { "cell_type": "markdown", - "id": "8e7ab31e", + "id": "93ea5623", "metadata": {}, "source": [ "As expected, none of the coefficients are zero—ridge regression does\n", @@ -6966,7 +6987,7 @@ }, { "cell_type": "markdown", - "id": "6e2cb7c4", + "id": "3e01383a", "metadata": {}, "source": [ "### Evaluating Test Error of Cross-Validated Ridge\n", @@ -6990,13 +7011,13 @@ { "cell_type": "code", "execution_count": 41, - "id": "72181964", + "id": "81f6259f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.952771Z", - "iopub.status.busy": "2023-07-31T02:15:08.952657Z", - "iopub.status.idle": "2023-07-31T02:15:08.954928Z", - "shell.execute_reply": "2023-07-31T02:15:08.954666Z" + "iopub.execute_input": "2023-08-06T17:35:17.874806Z", + "iopub.status.busy": "2023-08-06T17:35:17.874678Z", + "iopub.status.idle": "2023-08-06T17:35:17.876932Z", + "shell.execute_reply": "2023-08-06T17:35:17.876690Z" } }, "outputs": [], @@ -7011,20 +7032,21 @@ " l1_ratio=0,\n", " cv=inner_cv)\n", "pipeCV = Pipeline(steps=[('scaler', scaler),\n", - " ('ridge', ridgeCV)]);" + " ('ridge', ridgeCV)]);\n" ] }, { "cell_type": "code", "execution_count": 42, - "id": "4c3054b5", + "id": "e44495e5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:08.956479Z", - "iopub.status.busy": "2023-07-31T02:15:08.956377Z", - "iopub.status.idle": "2023-07-31T02:15:09.272036Z", - "shell.execute_reply": "2023-07-31T02:15:09.271767Z" - } + "iopub.execute_input": "2023-08-06T17:35:17.878420Z", + "iopub.status.busy": "2023-08-06T17:35:17.878316Z", + "iopub.status.idle": "2023-08-06T17:35:18.202556Z", + "shell.execute_reply": "2023-08-06T17:35:18.202283Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -9052,12 +9074,20 @@ " Y,\n", " cv=outer_valid,\n", " scoring='neg_mean_squared_error')\n", - "-results['test_score']" + "-results['test_score']\n" ] }, { "cell_type": "markdown", - "id": "f2f899f2", + "id": "9fed598e", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "9ecaca1a", "metadata": {}, "source": [ "### The Lasso\n", @@ -9074,14 +9104,15 @@ { "cell_type": "code", "execution_count": 43, - "id": "72bb0c1d", + "id": "aae18029", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.274161Z", - "iopub.status.busy": "2023-07-31T02:15:09.274043Z", - "iopub.status.idle": "2023-07-31T02:15:09.329832Z", - "shell.execute_reply": "2023-07-31T02:15:09.329579Z" - } + "iopub.execute_input": "2023-08-06T17:35:18.204830Z", + "iopub.status.busy": "2023-08-06T17:35:18.204720Z", + "iopub.status.idle": "2023-08-06T17:35:18.262253Z", + "shell.execute_reply": "2023-08-06T17:35:18.261987Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -9103,20 +9134,21 @@ " ('lasso', lassoCV)])\n", "pipeCV.fit(X, Y)\n", "tuned_lasso = pipeCV.named_steps['lasso']\n", - "tuned_lasso.alpha_" + "tuned_lasso.alpha_\n" ] }, { "cell_type": "code", "execution_count": 44, - "id": "69adc7ac", + "id": "b6d9dd06", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.331247Z", - "iopub.status.busy": "2023-07-31T02:15:09.331165Z", - "iopub.status.idle": "2023-07-31T02:15:09.341815Z", - "shell.execute_reply": "2023-07-31T02:15:09.341560Z" - } + "iopub.execute_input": "2023-08-06T17:35:18.263674Z", + "iopub.status.busy": "2023-08-06T17:35:18.263592Z", + "iopub.status.idle": "2023-08-06T17:35:18.274556Z", + "shell.execute_reply": "2023-08-06T17:35:18.274311Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -9126,12 +9158,12 @@ " n_alphas=100)[:2]\n", "soln_path = pd.DataFrame(soln_array.T,\n", " columns=D.columns,\n", - " index=-np.log(lambdas))" + " index=-np.log(lambdas))\n" ] }, { "cell_type": "markdown", - "id": "cc6d84d3", + "id": "52817006", "metadata": {}, "source": [ "We can see from the coefficient plot of the standardized coefficients that depending on the choice of\n", @@ -9142,14 +9174,15 @@ { "cell_type": "code", "execution_count": 45, - "id": "2aa75789", + "id": "6e5f9a74", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.343254Z", - "iopub.status.busy": "2023-07-31T02:15:09.343175Z", - "iopub.status.idle": "2023-07-31T02:15:09.510403Z", - "shell.execute_reply": "2023-07-31T02:15:09.510040Z" - } + "iopub.execute_input": "2023-08-06T17:35:18.276056Z", + "iopub.status.busy": "2023-08-06T17:35:18.275973Z", + "iopub.status.idle": "2023-08-06T17:35:18.444193Z", + "shell.execute_reply": "2023-08-06T17:35:18.443901Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -9168,12 +9201,12 @@ "soln_path.plot(ax=ax, legend=False)\n", "ax.legend(loc='upper left')\n", "ax.set_xlabel('$-\\log(\\lambda)$', fontsize=20)\n", - "ax.set_ylabel('Standardized coefficiients', fontsize=20);" + "ax.set_ylabel('Standardized coefficiients', fontsize=20);\n" ] }, { "cell_type": "markdown", - "id": "87d43d52", + "id": "2e1e6626", "metadata": {}, "source": [ "The smallest cross-validated error is lower than the test set MSE of the null model\n", @@ -9184,13 +9217,13 @@ { "cell_type": "code", "execution_count": 46, - "id": "e38c9bed", + "id": "9b57296a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.512076Z", - "iopub.status.busy": "2023-07-31T02:15:09.511953Z", - "iopub.status.idle": "2023-07-31T02:15:09.514391Z", - "shell.execute_reply": "2023-07-31T02:15:09.514111Z" + "iopub.execute_input": "2023-08-06T17:35:18.445914Z", + "iopub.status.busy": "2023-08-06T17:35:18.445792Z", + "iopub.status.idle": "2023-08-06T17:35:18.448316Z", + "shell.execute_reply": "2023-08-06T17:35:18.448072Z" } }, "outputs": [ @@ -9206,27 +9239,27 @@ } ], "source": [ - "np.min(tuned_lasso.mse_path_.mean(1))" + "np.min(tuned_lasso.mse_path_.mean(1))\n" ] }, { "cell_type": "markdown", - "id": "d091d74c", + "id": "5f35282c", "metadata": {}, "source": [ - "Let’s again produce a plot of the cross-validation error." + "Let’s again produce a plot of the cross-validation error.\n" ] }, { "cell_type": "code", "execution_count": 47, - "id": "53c42724", + "id": "b1b1a84a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.515991Z", - "iopub.status.busy": "2023-07-31T02:15:09.515876Z", - "iopub.status.idle": "2023-07-31T02:15:09.620734Z", - "shell.execute_reply": "2023-07-31T02:15:09.620427Z" + "iopub.execute_input": "2023-08-06T17:35:18.449905Z", + "iopub.status.busy": "2023-08-06T17:35:18.449752Z", + "iopub.status.idle": "2023-08-06T17:35:18.555457Z", + "shell.execute_reply": "2023-08-06T17:35:18.555156Z" } }, "outputs": [ @@ -9254,7 +9287,7 @@ }, { "cell_type": "markdown", - "id": "fad5c750", + "id": "7250e5c0", "metadata": {}, "source": [ "However, the lasso has a substantial advantage over ridge regression\n", @@ -9267,13 +9300,13 @@ { "cell_type": "code", "execution_count": 48, - "id": "5f4942ba", + "id": "44246aee", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.622460Z", - "iopub.status.busy": "2023-07-31T02:15:09.622343Z", - "iopub.status.idle": "2023-07-31T02:15:09.624897Z", - "shell.execute_reply": "2023-07-31T02:15:09.624611Z" + "iopub.execute_input": "2023-08-06T17:35:18.557237Z", + "iopub.status.busy": "2023-08-06T17:35:18.557121Z", + "iopub.status.idle": "2023-08-06T17:35:18.559615Z", + "shell.execute_reply": "2023-08-06T17:35:18.559331Z" } }, "outputs": [ @@ -9293,12 +9326,12 @@ } ], "source": [ - "tuned_lasso.coef_" + "tuned_lasso.coef_\n" ] }, { "cell_type": "markdown", - "id": "af600bbc", + "id": "bc08d038", "metadata": {}, "source": [ "As in ridge regression, we could evaluate the test error\n", @@ -9310,7 +9343,7 @@ }, { "cell_type": "markdown", - "id": "8d9aeb7b", + "id": "a55364da", "metadata": {}, "source": [ "## PCR and PLS Regression\n", @@ -9320,7 +9353,7 @@ }, { "cell_type": "markdown", - "id": "1ef4790c", + "id": "2806f021", "metadata": {}, "source": [ "Principal components regression (PCR) can be performed using\n", @@ -9337,13 +9370,13 @@ { "cell_type": "code", "execution_count": 49, - "id": "72a876bb", + "id": "33a88f6a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.626555Z", - "iopub.status.busy": "2023-07-31T02:15:09.626439Z", - "iopub.status.idle": "2023-07-31T02:15:09.631082Z", - "shell.execute_reply": "2023-07-31T02:15:09.630769Z" + "iopub.execute_input": "2023-08-06T17:35:18.561277Z", + "iopub.status.busy": "2023-08-06T17:35:18.561175Z", + "iopub.status.idle": "2023-08-06T17:35:18.565614Z", + "shell.execute_reply": "2023-08-06T17:35:18.565342Z" } }, "outputs": [ @@ -9364,12 +9397,12 @@ "pipe = Pipeline([('pca', pca),\n", " ('linreg', linreg)])\n", "pipe.fit(X, Y)\n", - "pipe.named_steps['linreg'].coef_" + "pipe.named_steps['linreg'].coef_\n" ] }, { "cell_type": "markdown", - "id": "77d5a225", + "id": "4f94c0cc", "metadata": {}, "source": [ "When performing PCA, the results vary depending\n", @@ -9381,13 +9414,13 @@ { "cell_type": "code", "execution_count": 50, - "id": "e0e821c6", + "id": "86fa37a7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.632552Z", - "iopub.status.busy": "2023-07-31T02:15:09.632453Z", - "iopub.status.idle": "2023-07-31T02:15:09.636255Z", - "shell.execute_reply": "2023-07-31T02:15:09.636009Z" + "iopub.execute_input": "2023-08-06T17:35:18.567133Z", + "iopub.status.busy": "2023-08-06T17:35:18.567034Z", + "iopub.status.idle": "2023-08-06T17:35:18.570714Z", + "shell.execute_reply": "2023-08-06T17:35:18.570443Z" } }, "outputs": [ @@ -9407,12 +9440,12 @@ " ('pca', pca),\n", " ('linreg', linreg)])\n", "pipe.fit(X, Y)\n", - "pipe.named_steps['linreg'].coef_" + "pipe.named_steps['linreg'].coef_\n" ] }, { "cell_type": "markdown", - "id": "0c5ebec9", + "id": "05e0acfe", "metadata": {}, "source": [ "We can of course use CV to choose the number of components, by\n", @@ -9424,13 +9457,13 @@ { "cell_type": "code", "execution_count": 51, - "id": "1ac6886c", + "id": "1e84065b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.637683Z", - "iopub.status.busy": "2023-07-31T02:15:09.637599Z", - "iopub.status.idle": "2023-07-31T02:15:09.756903Z", - "shell.execute_reply": "2023-07-31T02:15:09.756621Z" + "iopub.execute_input": "2023-08-06T17:35:18.572236Z", + "iopub.status.busy": "2023-08-06T17:35:18.572149Z", + "iopub.status.idle": "2023-08-06T17:35:18.692323Z", + "shell.execute_reply": "2023-08-06T17:35:18.692024Z" } }, "outputs": [ @@ -9470,12 +9503,12 @@ " param_grid,\n", " cv=kfold,\n", " scoring='neg_mean_squared_error')\n", - "grid.fit(X, Y)" + "grid.fit(X, Y)\n" ] }, { "cell_type": "markdown", - "id": "dc21d28d", + "id": "965677ed", "metadata": {}, "source": [ "Let’s plot the results as we have for other methods." @@ -9484,13 +9517,13 @@ { "cell_type": "code", "execution_count": 52, - "id": "5e0c5a96", + "id": "ff432faf", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.758614Z", - "iopub.status.busy": "2023-07-31T02:15:09.758500Z", - "iopub.status.idle": "2023-07-31T02:15:09.854740Z", - "shell.execute_reply": "2023-07-31T02:15:09.854449Z" + "iopub.execute_input": "2023-08-06T17:35:18.693955Z", + "iopub.status.busy": "2023-08-06T17:35:18.693854Z", + "iopub.status.idle": "2023-08-06T17:35:18.790857Z", + "shell.execute_reply": "2023-08-06T17:35:18.790544Z" } }, "outputs": [ @@ -9514,12 +9547,12 @@ "ax.set_ylabel('Cross-validated MSE', fontsize=20)\n", "ax.set_xlabel('# principal components', fontsize=20)\n", "ax.set_xticks(n_comp[::2])\n", - "ax.set_ylim([50000,250000]);" + "ax.set_ylim([50000,250000]);\n" ] }, { "cell_type": "markdown", - "id": "0c0aadc3", + "id": "8d3ca451", "metadata": {}, "source": [ "We see that the smallest cross-validation error occurs when\n", @@ -9539,14 +9572,15 @@ { "cell_type": "code", "execution_count": 53, - "id": "9df0fb7f", + "id": "57d21a61", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.856396Z", - "iopub.status.busy": "2023-07-31T02:15:09.856286Z", - "iopub.status.idle": "2023-07-31T02:15:09.862198Z", - "shell.execute_reply": "2023-07-31T02:15:09.861920Z" - } + "iopub.execute_input": "2023-08-06T17:35:18.792385Z", + "iopub.status.busy": "2023-08-06T17:35:18.792283Z", + "iopub.status.idle": "2023-08-06T17:35:18.797861Z", + "shell.execute_reply": "2023-08-06T17:35:18.797615Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -9567,12 +9601,12 @@ " Y,\n", " cv=kfold,\n", " scoring='neg_mean_squared_error')\n", - "-cv_null['test_score'].mean()" + "-cv_null['test_score'].mean()\n" ] }, { "cell_type": "markdown", - "id": "89f0e0bb", + "id": "333d11bd", "metadata": {}, "source": [ "The `explained_variance_ratio_`\n", @@ -9584,13 +9618,13 @@ { "cell_type": "code", "execution_count": 54, - "id": "458c21a4", + "id": "8d170a51", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.863785Z", - "iopub.status.busy": "2023-07-31T02:15:09.863668Z", - "iopub.status.idle": "2023-07-31T02:15:09.866170Z", - "shell.execute_reply": "2023-07-31T02:15:09.865877Z" + "iopub.execute_input": "2023-08-06T17:35:18.799375Z", + "iopub.status.busy": "2023-08-06T17:35:18.799269Z", + "iopub.status.idle": "2023-08-06T17:35:18.801474Z", + "shell.execute_reply": "2023-08-06T17:35:18.801155Z" } }, "outputs": [ @@ -9606,12 +9640,12 @@ } ], "source": [ - "pipe.named_steps['pca'].explained_variance_ratio_" + "pipe.named_steps['pca'].explained_variance_ratio_\n" ] }, { "cell_type": "markdown", - "id": "bdd994d2", + "id": "e0413213", "metadata": {}, "source": [ "Briefly, we can think of\n", @@ -9619,29 +9653,33 @@ "that is captured using $M$ principal components. For example, setting\n", "$M=1$ only captures 38.31% of the variance, while $M=2$ captures an additional 21.84%, for a total of 60.15% of the variance.\n", "By $M=6$ it increases to\n", - "88.63%. Beyond this the increments continue to diminish, until we use all $M=p=19$ components, which captures all 100% of the variance." + "88.63%. Beyond this the increments continue to diminish, until we use all $M=p=19$ components, which captures all 100% of the variance.\n", + "\n", + " " ] }, { "cell_type": "markdown", - "id": "af5147dc", + "id": "e04f26d1", "metadata": {}, "source": [ "### Partial Least Squares\n", "Partial least squares (PLS) is implemented in the\n", - "`PLSRegression()` function." + "`PLSRegression()` function.\n", + "\n", + " " ] }, { "cell_type": "code", "execution_count": 55, - "id": "f49d464e", + "id": "9d35e0d6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.867758Z", - "iopub.status.busy": "2023-07-31T02:15:09.867639Z", - "iopub.status.idle": "2023-07-31T02:15:09.871140Z", - "shell.execute_reply": "2023-07-31T02:15:09.870852Z" + "iopub.execute_input": "2023-08-06T17:35:18.802981Z", + "iopub.status.busy": "2023-08-06T17:35:18.802864Z", + "iopub.status.idle": "2023-08-06T17:35:18.806324Z", + "shell.execute_reply": "2023-08-06T17:35:18.806053Z" } }, "outputs": [ @@ -9662,12 +9700,12 @@ "source": [ "pls = PLSRegression(n_components=2, \n", " scale=True)\n", - "pls.fit(X, Y)" + "pls.fit(X, Y)\n" ] }, { "cell_type": "markdown", - "id": "7a07b988", + "id": "5945c8cf", "metadata": {}, "source": [ "As was the case in PCR, we will want to\n", @@ -9677,13 +9715,13 @@ { "cell_type": "code", "execution_count": 56, - "id": "8e118b5b", + "id": "35867372", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.872678Z", - "iopub.status.busy": "2023-07-31T02:15:09.872592Z", - "iopub.status.idle": "2023-07-31T02:15:09.978064Z", - "shell.execute_reply": "2023-07-31T02:15:09.977780Z" + "iopub.execute_input": "2023-08-06T17:35:18.807917Z", + "iopub.status.busy": "2023-08-06T17:35:18.807830Z", + "iopub.status.idle": "2023-08-06T17:35:18.913647Z", + "shell.execute_reply": "2023-08-06T17:35:18.913377Z" } }, "outputs": [ @@ -9716,12 +9754,12 @@ " param_grid,\n", " cv=kfold,\n", " scoring='neg_mean_squared_error')\n", - "grid.fit(X, Y)" + "grid.fit(X, Y)\n" ] }, { "cell_type": "markdown", - "id": "99dec910", + "id": "a0d1ecb6", "metadata": {}, "source": [ "As for our other methods, we plot the MSE." @@ -9730,13 +9768,13 @@ { "cell_type": "code", "execution_count": 57, - "id": "0f98407c", + "id": "6712c8b3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:09.980000Z", - "iopub.status.busy": "2023-07-31T02:15:09.979873Z", - "iopub.status.idle": "2023-07-31T02:15:10.077523Z", - "shell.execute_reply": "2023-07-31T02:15:10.077240Z" + "iopub.execute_input": "2023-08-06T17:35:18.915382Z", + "iopub.status.busy": "2023-08-06T17:35:18.915270Z", + "iopub.status.idle": "2023-08-06T17:35:19.012142Z", + "shell.execute_reply": "2023-08-06T17:35:19.011857Z" } }, "outputs": [ @@ -9760,24 +9798,25 @@ "ax.set_ylabel('Cross-validated MSE', fontsize=20)\n", "ax.set_xlabel('# principal components', fontsize=20)\n", "ax.set_xticks(n_comp[::2])\n", - "ax.set_ylim([50000,250000]);" + "ax.set_ylim([50000,250000]);\n" ] }, { "cell_type": "markdown", - "id": "59ef9b7f", + "id": "8fc7d826", "metadata": {}, "source": [ "CV error is minimized at 12,\n", - "though there is little noticable difference between this point and a much lower number like 2 or 3 components." + "though there is little noticable difference between this point and a much lower number like 2 or 3 components.\n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch7-nonlin-lab.ipynb b/Ch7-nonlin-lab.ipynb index a8764ab..bba8744 100644 --- a/Ch7-nonlin-lab.ipynb +++ b/Ch7-nonlin-lab.ipynb @@ -5,6 +5,7 @@ "id": "8d006b12", "metadata": {}, "source": [ + "\n", "# Chapter 7\n", "\n", "# Lab: Non-Linear Modeling\n", @@ -20,10 +21,10 @@ "id": "77af2dc4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:11.685667Z", - "iopub.status.busy": "2023-07-31T02:15:11.685420Z", - "iopub.status.idle": "2023-07-31T02:15:12.757566Z", - "shell.execute_reply": "2023-07-31T02:15:12.757160Z" + "iopub.execute_input": "2023-08-06T17:35:20.335450Z", + "iopub.status.busy": "2023-08-06T17:35:20.335193Z", + "iopub.status.idle": "2023-08-06T17:35:21.360168Z", + "shell.execute_reply": "2023-08-06T17:35:21.359570Z" } }, "outputs": [], @@ -54,10 +55,10 @@ "id": "b57d1d51", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:12.759746Z", - "iopub.status.busy": "2023-07-31T02:15:12.759462Z", - "iopub.status.idle": "2023-07-31T02:15:12.776000Z", - "shell.execute_reply": "2023-07-31T02:15:12.775719Z" + "iopub.execute_input": "2023-08-06T17:35:21.362340Z", + "iopub.status.busy": "2023-08-06T17:35:21.362076Z", + "iopub.status.idle": "2023-08-06T17:35:21.377981Z", + "shell.execute_reply": "2023-08-06T17:35:21.377704Z" } }, "outputs": [], @@ -74,7 +75,7 @@ "from ISLP.pygam import (approx_lam,\n", " degrees_of_freedom,\n", " plot as plot_gam,\n", - " anova as anova_gam)" + " anova as anova_gam)\n" ] }, { @@ -93,17 +94,17 @@ "id": "65f0e562", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:12.777609Z", - "iopub.status.busy": "2023-07-31T02:15:12.777504Z", - "iopub.status.idle": "2023-07-31T02:15:12.785974Z", - "shell.execute_reply": "2023-07-31T02:15:12.785723Z" + "iopub.execute_input": "2023-08-06T17:35:21.379577Z", + "iopub.status.busy": "2023-08-06T17:35:21.379467Z", + "iopub.status.idle": "2023-08-06T17:35:21.388428Z", + "shell.execute_reply": "2023-08-06T17:35:21.388153Z" } }, "outputs": [], "source": [ "Wage = load_data('Wage')\n", "y = Wage['wage']\n", - "age = Wage['age']" + "age = Wage['age']\n" ] }, { @@ -123,11 +124,12 @@ "id": "a391fae6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:12.787544Z", - "iopub.status.busy": "2023-07-31T02:15:12.787443Z", - "iopub.status.idle": "2023-07-31T02:15:12.860682Z", - "shell.execute_reply": "2023-07-31T02:15:12.859957Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.390038Z", + "iopub.status.busy": "2023-08-06T17:35:21.389943Z", + "iopub.status.idle": "2023-08-06T17:35:21.463801Z", + "shell.execute_reply": "2023-08-06T17:35:21.463112Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -214,7 +216,7 @@ "source": [ "poly_age = MS([poly('age', degree=4)]).fit(Wage)\n", "M = sm.OLS(y, poly_age.transform(Wage)).fit()\n", - "summarize(M)" + "summarize(M)\n" ] }, { @@ -236,7 +238,10 @@ "`Wage`. This recomputes and stores as attributes any parameters needed by `Poly()`\n", "on the training data, and these will be used on all subsequent\n", "evaluations of the `transform()` method. For example, it is used\n", - "on the second line, as well as in the plotting function developed below." + "on the second line, as well as in the plotting function developed below.\n", + "\n", + "\n", + " \n" ] }, { @@ -254,10 +259,10 @@ "id": "d672f40e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:12.865379Z", - "iopub.status.busy": "2023-07-31T02:15:12.865014Z", - "iopub.status.idle": "2023-07-31T02:15:12.871120Z", - "shell.execute_reply": "2023-07-31T02:15:12.870397Z" + "iopub.execute_input": "2023-08-06T17:35:21.469029Z", + "iopub.status.busy": "2023-08-06T17:35:21.468417Z", + "iopub.status.idle": "2023-08-06T17:35:21.474585Z", + "shell.execute_reply": "2023-08-06T17:35:21.473921Z" } }, "outputs": [], @@ -265,7 +270,7 @@ "age_grid = np.linspace(age.min(),\n", " age.max(),\n", " 100)\n", - "age_df = pd.DataFrame({'age': age_grid})" + "age_df = pd.DataFrame({'age': age_grid})\n" ] }, { @@ -280,7 +285,7 @@ "transform), as well as a grid of `age` values. The function\n", "produces a fitted curve as well as 95% confidence bands. By using\n", "an argument for `basis` we can produce and plot the results with several different\n", - "transforms, such as the splines we will see shortly." + "transforms, such as the splines we will see shortly. " ] }, { @@ -289,11 +294,12 @@ "id": "56174265", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:12.876622Z", - "iopub.status.busy": "2023-07-31T02:15:12.876187Z", - "iopub.status.idle": "2023-07-31T02:15:12.902509Z", - "shell.execute_reply": "2023-07-31T02:15:12.900607Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.478948Z", + "iopub.status.busy": "2023-08-06T17:35:21.478666Z", + "iopub.status.idle": "2023-08-06T17:35:21.485079Z", + "shell.execute_reply": "2023-08-06T17:35:21.483529Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -319,7 +325,7 @@ " ax.set_title(title, fontsize=20)\n", " ax.set_xlabel('Age', fontsize=20)\n", " ax.set_ylabel('Wage', fontsize=20);\n", - " return ax" + " return ax\n" ] }, { @@ -345,11 +351,12 @@ "id": "1a10422f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:12.906678Z", - "iopub.status.busy": "2023-07-31T02:15:12.906136Z", - "iopub.status.idle": "2023-07-31T02:15:13.107710Z", - "shell.execute_reply": "2023-07-31T02:15:13.087852Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.488959Z", + "iopub.status.busy": "2023-08-06T17:35:21.488554Z", + "iopub.status.idle": "2023-08-06T17:35:21.692366Z", + "shell.execute_reply": "2023-08-06T17:35:21.691588Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -366,7 +373,17 @@ "source": [ "plot_wage_fit(age_df, \n", " poly_age,\n", - " 'Degree-4 Polynomial');" + " 'Degree-4 Polynomial');\n" + ] + }, + { + "cell_type": "markdown", + "id": "6c5aa81b", + "metadata": {}, + "source": [ + " \n", + "\n", + " " ] }, { @@ -403,10 +420,10 @@ "id": "8105e672", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.114340Z", - "iopub.status.busy": "2023-07-31T02:15:13.114020Z", - "iopub.status.idle": "2023-07-31T02:15:13.141638Z", - "shell.execute_reply": "2023-07-31T02:15:13.140560Z" + "iopub.execute_input": "2023-08-06T17:35:21.697560Z", + "iopub.status.busy": "2023-08-06T17:35:21.696560Z", + "iopub.status.idle": "2023-08-06T17:35:21.728524Z", + "shell.execute_reply": "2023-08-06T17:35:21.727179Z" } }, "outputs": [ @@ -508,7 +525,7 @@ " for d in range(1, 6)]\n", "Xs = [model.fit_transform(Wage) for model in models]\n", "anova_lm(*[sm.OLS(y, X_).fit()\n", - " for X_ in Xs])" + " for X_ in Xs])\n" ] }, { @@ -543,11 +560,12 @@ "id": "095fca7f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.145828Z", - "iopub.status.busy": "2023-07-31T02:15:13.145445Z", - "iopub.status.idle": "2023-07-31T02:15:13.169693Z", - "shell.execute_reply": "2023-07-31T02:15:13.167380Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.733139Z", + "iopub.status.busy": "2023-08-06T17:35:21.732766Z", + "iopub.status.idle": "2023-08-06T17:35:21.750879Z", + "shell.execute_reply": "2023-08-06T17:35:21.749464Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -632,7 +650,7 @@ } ], "source": [ - "summarize(M)" + "summarize(M)\n" ] }, { @@ -642,7 +660,7 @@ "source": [ "Notice that the p-values are the same, and in fact the square of\n", "the t-statistics are equal to the F-statistics from the\n", - "`anova_lm()` function; for example:" + "`anova_lm()` function; for example: " ] }, { @@ -651,11 +669,12 @@ "id": "0b576607", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.175385Z", - "iopub.status.busy": "2023-07-31T02:15:13.174868Z", - "iopub.status.idle": "2023-07-31T02:15:13.182332Z", - "shell.execute_reply": "2023-07-31T02:15:13.180605Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.755203Z", + "iopub.status.busy": "2023-08-06T17:35:21.754884Z", + "iopub.status.idle": "2023-08-06T17:35:21.761326Z", + "shell.execute_reply": "2023-08-06T17:35:21.760717Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -670,7 +689,7 @@ } ], "source": [ - "(-11.983)**2" + "(-11.983)**2\n" ] }, { @@ -691,11 +710,12 @@ "id": "7242df77", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.186100Z", - "iopub.status.busy": "2023-07-31T02:15:13.185344Z", - "iopub.status.idle": "2023-07-31T02:15:13.208027Z", - "shell.execute_reply": "2023-07-31T02:15:13.207412Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.765904Z", + "iopub.status.busy": "2023-08-06T17:35:21.764924Z", + "iopub.status.idle": "2023-08-06T17:35:21.791670Z", + "shell.execute_reply": "2023-08-06T17:35:21.790956Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -776,7 +796,7 @@ " for d in range(1, 4)]\n", "XEs = [model.fit_transform(Wage)\n", " for model in models]\n", - "anova_lm(*[sm.OLS(y, X_).fit() for X_ in XEs])" + "anova_lm(*[sm.OLS(y, X_).fit() for X_ in XEs])\n" ] }, { @@ -800,11 +820,12 @@ "id": "c7972aea", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.211801Z", - "iopub.status.busy": "2023-07-31T02:15:13.211211Z", - "iopub.status.idle": "2023-07-31T02:15:13.242153Z", - "shell.execute_reply": "2023-07-31T02:15:13.241395Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.795901Z", + "iopub.status.busy": "2023-08-06T17:35:21.795658Z", + "iopub.status.idle": "2023-08-06T17:35:21.825289Z", + "shell.execute_reply": "2023-08-06T17:35:21.824414Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -895,7 +916,7 @@ " X,\n", " family=sm.families.Binomial())\n", "B = glm.fit()\n", - "summarize(B)" + "summarize(B)\n" ] }, { @@ -912,17 +933,17 @@ "id": "84f172f2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.247244Z", - "iopub.status.busy": "2023-07-31T02:15:13.246976Z", - "iopub.status.idle": "2023-07-31T02:15:13.255536Z", - "shell.execute_reply": "2023-07-31T02:15:13.254338Z" + "iopub.execute_input": "2023-08-06T17:35:21.829774Z", + "iopub.status.busy": "2023-08-06T17:35:21.829523Z", + "iopub.status.idle": "2023-08-06T17:35:21.836744Z", + "shell.execute_reply": "2023-08-06T17:35:21.836082Z" } }, "outputs": [], "source": [ "newX = poly_age.transform(age_df)\n", "preds = B.get_prediction(newX)\n", - "bands = preds.conf_int(alpha=0.05)" + "bands = preds.conf_int(alpha=0.05)\n" ] }, { @@ -939,11 +960,12 @@ "id": "fcf376bd", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.259381Z", - "iopub.status.busy": "2023-07-31T02:15:13.258869Z", - "iopub.status.idle": "2023-07-31T02:15:13.400610Z", - "shell.execute_reply": "2023-07-31T02:15:13.399907Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.840987Z", + "iopub.status.busy": "2023-08-06T17:35:21.840629Z", + "iopub.status.idle": "2023-08-06T17:35:21.990343Z", + "shell.execute_reply": "2023-08-06T17:35:21.989640Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -973,7 +995,7 @@ "ax.set_title('Degree-4 Polynomial', fontsize=20)\n", "ax.set_xlabel('Age', fontsize=20)\n", "ax.set_ylim([0,0.2])\n", - "ax.set_ylabel('P(Wage > 250)', fontsize=20);" + "ax.set_ylabel('P(Wage > 250)', fontsize=20);\n" ] }, { @@ -1003,11 +1025,12 @@ "id": "c4d00900", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.404776Z", - "iopub.status.busy": "2023-07-31T02:15:13.404541Z", - "iopub.status.idle": "2023-07-31T02:15:13.431905Z", - "shell.execute_reply": "2023-07-31T02:15:13.430918Z" - } + "iopub.execute_input": "2023-08-06T17:35:21.994681Z", + "iopub.status.busy": "2023-08-06T17:35:21.994430Z", + "iopub.status.idle": "2023-08-06T17:35:22.019141Z", + "shell.execute_reply": "2023-08-06T17:35:22.018456Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1085,7 +1108,7 @@ ], "source": [ "cut_age = pd.qcut(age, 4)\n", - "summarize(sm.OLS(y, pd.get_dummies(cut_age)).fit())" + "summarize(sm.OLS(y, pd.get_dummies(cut_age)).fit())\n" ] }, { @@ -1131,11 +1154,12 @@ "id": "d3817102", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.436340Z", - "iopub.status.busy": "2023-07-31T02:15:13.435972Z", - "iopub.status.idle": "2023-07-31T02:15:13.446536Z", - "shell.execute_reply": "2023-07-31T02:15:13.445841Z" - } + "iopub.execute_input": "2023-08-06T17:35:22.023709Z", + "iopub.status.busy": "2023-08-06T17:35:22.023437Z", + "iopub.status.idle": "2023-08-06T17:35:22.035865Z", + "shell.execute_reply": "2023-08-06T17:35:22.035182Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1152,7 +1176,7 @@ "source": [ "bs_ = BSpline(internal_knots=[25,40,60], intercept=True).fit(age)\n", "bs_age = bs_.transform(age)\n", - "bs_age.shape" + "bs_age.shape\n" ] }, { @@ -1164,7 +1188,7 @@ "We can form this same matrix using the `bs()` object,\n", "which facilitates adding this to a model-matrix builder (as in `poly()` versus its workhorse `Poly()`) described in Section 7.8.1.\n", "\n", - "We now fit a cubic spline model to the `Wage` data." + "We now fit a cubic spline model to the `Wage` data. " ] }, { @@ -1173,11 +1197,12 @@ "id": "c06c0f27", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.450289Z", - "iopub.status.busy": "2023-07-31T02:15:13.450050Z", - "iopub.status.idle": "2023-07-31T02:15:13.484718Z", - "shell.execute_reply": "2023-07-31T02:15:13.484068Z" - } + "iopub.execute_input": "2023-08-06T17:35:22.039936Z", + "iopub.status.busy": "2023-08-06T17:35:22.039676Z", + "iopub.status.idle": "2023-08-06T17:35:22.075107Z", + "shell.execute_reply": "2023-08-06T17:35:22.073405Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1281,7 +1306,7 @@ "bs_age = MS([bs('age', internal_knots=[25,40,60])])\n", "Xbs = bs_age.fit_transform(Wage)\n", "M = sm.OLS(y, Xbs).fit()\n", - "summarize(M)" + "summarize(M)\n" ] }, { @@ -1298,10 +1323,10 @@ "id": "8cb32db0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.491702Z", - "iopub.status.busy": "2023-07-31T02:15:13.491344Z", - "iopub.status.idle": "2023-07-31T02:15:13.515616Z", - "shell.execute_reply": "2023-07-31T02:15:13.514950Z" + "iopub.execute_input": "2023-08-06T17:35:22.079217Z", + "iopub.status.busy": "2023-08-06T17:35:22.078971Z", + "iopub.status.idle": "2023-08-06T17:35:22.109222Z", + "shell.execute_reply": "2023-08-06T17:35:22.108320Z" } }, "outputs": [ @@ -1408,7 +1433,7 @@ " name='bs(age)')])\n", "Xbs = bs_age.fit_transform(Wage)\n", "M = sm.OLS(y, Xbs).fit()\n", - "summarize(M)" + "summarize(M)\n" ] }, { @@ -1434,11 +1459,12 @@ "id": "f26b715f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.519557Z", - "iopub.status.busy": "2023-07-31T02:15:13.519136Z", - "iopub.status.idle": "2023-07-31T02:15:13.527502Z", - "shell.execute_reply": "2023-07-31T02:15:13.526873Z" - } + "iopub.execute_input": "2023-08-06T17:35:22.113083Z", + "iopub.status.busy": "2023-08-06T17:35:22.112406Z", + "iopub.status.idle": "2023-08-06T17:35:22.118984Z", + "shell.execute_reply": "2023-08-06T17:35:22.118255Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1453,7 +1479,7 @@ } ], "source": [ - "BSpline(df=6).fit(age).internal_knots_" + "BSpline(df=6).fit(age).internal_knots_\n" ] }, { @@ -1469,7 +1495,7 @@ "When using B-splines we need not limit ourselves to cubic polynomials\n", "(i.e. `degree=3`). For instance, using `degree=0` results\n", "in piecewise constant functions, as in our example with\n", - "`pd.qcut()` above." + "`pd.qcut()` above.\n" ] }, { @@ -1478,11 +1504,12 @@ "id": "d6109816", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.531197Z", - "iopub.status.busy": "2023-07-31T02:15:13.530889Z", - "iopub.status.idle": "2023-07-31T02:15:13.556693Z", - "shell.execute_reply": "2023-07-31T02:15:13.554858Z" - } + "iopub.execute_input": "2023-08-06T17:35:22.121895Z", + "iopub.status.busy": "2023-08-06T17:35:22.121657Z", + "iopub.status.idle": "2023-08-06T17:35:22.143870Z", + "shell.execute_reply": "2023-08-06T17:35:22.143234Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1563,7 +1590,7 @@ " df=3, \n", " degree=0)]).fit(Wage)\n", "Xbs0 = bs_age0.transform(Wage)\n", - "summarize(sm.OLS(y, Xbs0).fit())" + "summarize(sm.OLS(y, Xbs0).fit())\n" ] }, { @@ -1583,7 +1610,16 @@ "of ones, so the second, third and fourth coefficients are increments\n", "for those bins. Why is the sum not exactly the same? It turns out that\n", "the `qcut()` uses $\\leq$, while `bs()` uses $<$ when\n", - "deciding bin membership." + "deciding bin membership.\n", + "\n", + "\n", + " \n", + " \n", + "\n", + " \n", + "\n", + " \n", + " " ] }, { @@ -1602,11 +1638,12 @@ "id": "7c73a3da", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.561268Z", - "iopub.status.busy": "2023-07-31T02:15:13.560708Z", - "iopub.status.idle": "2023-07-31T02:15:13.586124Z", - "shell.execute_reply": "2023-07-31T02:15:13.584767Z" - } + "iopub.execute_input": "2023-08-06T17:35:22.147520Z", + "iopub.status.busy": "2023-08-06T17:35:22.146792Z", + "iopub.status.idle": "2023-08-06T17:35:22.169905Z", + "shell.execute_reply": "2023-08-06T17:35:22.169307Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1718,10 +1755,10 @@ "id": "d73789b4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.590643Z", - "iopub.status.busy": "2023-07-31T02:15:13.590004Z", - "iopub.status.idle": "2023-07-31T02:15:13.736172Z", - "shell.execute_reply": "2023-07-31T02:15:13.735465Z" + "iopub.execute_input": "2023-08-06T17:35:22.173921Z", + "iopub.status.busy": "2023-08-06T17:35:22.173285Z", + "iopub.status.idle": "2023-08-06T17:35:22.327012Z", + "shell.execute_reply": "2023-08-06T17:35:22.326243Z" } }, "outputs": [ @@ -1739,7 +1776,7 @@ "source": [ "plot_wage_fit(age_df,\n", " ns_age,\n", - " 'Natural spline, df=5');" + " 'Natural spline, df=5');\n" ] }, { @@ -1766,10 +1803,10 @@ "id": "3e70b87d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.740381Z", - "iopub.status.busy": "2023-07-31T02:15:13.739967Z", - "iopub.status.idle": "2023-07-31T02:15:13.777379Z", - "shell.execute_reply": "2023-07-31T02:15:13.776553Z" + "iopub.execute_input": "2023-08-06T17:35:22.331968Z", + "iopub.status.busy": "2023-08-06T17:35:22.331518Z", + "iopub.status.idle": "2023-08-06T17:35:22.372362Z", + "shell.execute_reply": "2023-08-06T17:35:22.370490Z" } }, "outputs": [ @@ -1789,7 +1826,7 @@ "source": [ "X_age = np.asarray(age).reshape((-1,1))\n", "gam = LinearGAM(s_gam(0, lam=0.6))\n", - "gam.fit(X_age, y)" + "gam.fit(X_age, y)\n" ] }, { @@ -1812,10 +1849,10 @@ "id": "efe03b12", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:13.781500Z", - "iopub.status.busy": "2023-07-31T02:15:13.781187Z", - "iopub.status.idle": "2023-07-31T02:15:14.064112Z", - "shell.execute_reply": "2023-07-31T02:15:14.063430Z" + "iopub.execute_input": "2023-08-06T17:35:22.376074Z", + "iopub.status.busy": "2023-08-06T17:35:22.375540Z", + "iopub.status.idle": "2023-08-06T17:35:22.722554Z", + "shell.execute_reply": "2023-08-06T17:35:22.721832Z" } }, "outputs": [ @@ -1841,7 +1878,7 @@ " linewidth=3)\n", "ax.set_xlabel('Age', fontsize=20)\n", "ax.set_ylabel('Wage', fontsize=20);\n", - "ax.legend(title='$\\lambda$');" + "ax.legend(title='$\\lambda$');\n" ] }, { @@ -1858,10 +1895,10 @@ "id": "acff2af2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:14.068893Z", - "iopub.status.busy": "2023-07-31T02:15:14.068635Z", - "iopub.status.idle": "2023-07-31T02:15:14.408960Z", - "shell.execute_reply": "2023-07-31T02:15:14.408263Z" + "iopub.execute_input": "2023-08-06T17:35:22.724493Z", + "iopub.status.busy": "2023-08-06T17:35:22.724387Z", + "iopub.status.idle": "2023-08-06T17:35:23.386569Z", + "shell.execute_reply": "2023-08-06T17:35:23.385869Z" } }, "outputs": [ @@ -1891,7 +1928,7 @@ " label='Grid search',\n", " linewidth=4)\n", "ax.legend()\n", - "fig" + "fig\n" ] }, { @@ -1913,11 +1950,12 @@ "id": "a2d25550", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:14.413448Z", - "iopub.status.busy": "2023-07-31T02:15:14.413122Z", - "iopub.status.idle": "2023-07-31T02:15:14.436392Z", - "shell.execute_reply": "2023-07-31T02:15:14.435474Z" - } + "iopub.execute_input": "2023-08-06T17:35:23.390727Z", + "iopub.status.busy": "2023-08-06T17:35:23.390039Z", + "iopub.status.idle": "2023-08-06T17:35:23.409507Z", + "shell.execute_reply": "2023-08-06T17:35:23.408815Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1935,7 +1973,7 @@ "age_term = gam.terms[0]\n", "lam_4 = approx_lam(X_age, age_term, 4)\n", "age_term.lam = lam_4\n", - "degrees_of_freedom(X_age, age_term)" + "degrees_of_freedom(X_age, age_term)\n" ] }, { @@ -1954,10 +1992,10 @@ "id": "bc6322de", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:14.440489Z", - "iopub.status.busy": "2023-07-31T02:15:14.440065Z", - "iopub.status.idle": "2023-07-31T02:15:14.764590Z", - "shell.execute_reply": "2023-07-31T02:15:14.763753Z" + "iopub.execute_input": "2023-08-06T17:35:23.412957Z", + "iopub.status.busy": "2023-08-06T17:35:23.412505Z", + "iopub.status.idle": "2023-08-06T17:35:23.730459Z", + "shell.execute_reply": "2023-08-06T17:35:23.729594Z" } }, "outputs": [ @@ -1988,7 +2026,7 @@ " linewidth=4)\n", "ax.set_xlabel('Age', fontsize=20)\n", "ax.set_ylabel('Wage', fontsize=20);\n", - "ax.legend(title='Degrees of freedom');" + "ax.legend(title='Degrees of freedom');\n" ] }, { @@ -2016,11 +2054,12 @@ "id": "703d2570", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:14.769077Z", - "iopub.status.busy": "2023-07-31T02:15:14.768693Z", - "iopub.status.idle": "2023-07-31T02:15:14.787733Z", - "shell.execute_reply": "2023-07-31T02:15:14.787073Z" - } + "iopub.execute_input": "2023-08-06T17:35:23.734256Z", + "iopub.status.busy": "2023-08-06T17:35:23.733981Z", + "iopub.status.idle": "2023-08-06T17:35:23.754589Z", + "shell.execute_reply": "2023-08-06T17:35:23.753337Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -2030,7 +2069,7 @@ " ns_year.transform(Wage['year']),\n", " pd.get_dummies(Wage['education']).values]\n", "X_bh = np.hstack(Xs)\n", - "gam_bh = sm.OLS(y, X_bh).fit()" + "gam_bh = sm.OLS(y, X_bh).fit()\n" ] }, { @@ -2054,11 +2093,12 @@ "id": "766a7b1f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:14.791620Z", - "iopub.status.busy": "2023-07-31T02:15:14.791297Z", - "iopub.status.idle": "2023-07-31T02:15:14.975843Z", - "shell.execute_reply": "2023-07-31T02:15:14.975148Z" - } + "iopub.execute_input": "2023-08-06T17:35:23.759585Z", + "iopub.status.busy": "2023-08-06T17:35:23.759049Z", + "iopub.status.idle": "2023-08-06T17:35:23.884772Z", + "shell.execute_reply": "2023-08-06T17:35:23.884035Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2091,7 +2131,7 @@ "ax.plot(age_grid, bounds_age[:,1], 'r--', linewidth=3)\n", "ax.set_xlabel('Age')\n", "ax.set_ylabel('Effect on wage')\n", - "ax.set_title('Partial dependence of age on wage', fontsize=20);" + "ax.set_title('Partial dependence of age on wage', fontsize=20);\n" ] }, { @@ -2116,10 +2156,10 @@ "id": "2a9ed841", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:14.980341Z", - "iopub.status.busy": "2023-07-31T02:15:14.980093Z", - "iopub.status.idle": "2023-07-31T02:15:15.126673Z", - "shell.execute_reply": "2023-07-31T02:15:15.126362Z" + "iopub.execute_input": "2023-08-06T17:35:23.888947Z", + "iopub.status.busy": "2023-08-06T17:35:23.888274Z", + "iopub.status.idle": "2023-08-06T17:35:24.065464Z", + "shell.execute_reply": "2023-08-06T17:35:24.065124Z" } }, "outputs": [ @@ -2154,7 +2194,7 @@ "ax.plot(year_grid, bounds_year[:,1], 'r--', linewidth=3)\n", "ax.set_xlabel('Year')\n", "ax.set_ylabel('Effect on wage')\n", - "ax.set_title('Partial dependence of year on wage', fontsize=20);" + "ax.set_title('Partial dependence of year on wage', fontsize=20);\n" ] }, { @@ -2177,11 +2217,12 @@ "id": "ccf068b1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.128328Z", - "iopub.status.busy": "2023-07-31T02:15:15.128214Z", - "iopub.status.idle": "2023-07-31T02:15:15.153262Z", - "shell.execute_reply": "2023-07-31T02:15:15.150282Z" - } + "iopub.execute_input": "2023-08-06T17:35:24.067233Z", + "iopub.status.busy": "2023-08-06T17:35:24.067111Z", + "iopub.status.idle": "2023-08-06T17:35:24.089243Z", + "shell.execute_reply": "2023-08-06T17:35:24.088305Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -2191,7 +2232,7 @@ "Xgam = np.column_stack([age,\n", " Wage['year'],\n", " Wage['education'].cat.codes])\n", - "gam_full = gam_full.fit(Xgam, y)" + "gam_full = gam_full.fit(Xgam, y)\n" ] }, { @@ -2213,10 +2254,10 @@ "id": "38b719f1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.158595Z", - "iopub.status.busy": "2023-07-31T02:15:15.158140Z", - "iopub.status.idle": "2023-07-31T02:15:15.303226Z", - "shell.execute_reply": "2023-07-31T02:15:15.301663Z" + "iopub.execute_input": "2023-08-06T17:35:24.093193Z", + "iopub.status.busy": "2023-08-06T17:35:24.092751Z", + "iopub.status.idle": "2023-08-06T17:35:24.282656Z", + "shell.execute_reply": "2023-08-06T17:35:24.281548Z" } }, "outputs": [ @@ -2236,7 +2277,7 @@ "plot_gam(gam_full, 0, ax=ax)\n", "ax.set_xlabel('Age')\n", "ax.set_ylabel('Effect on wage')\n", - "ax.set_title('Partial dependence of age on wage - default lam=0.6', fontsize=20);" + "ax.set_title('Partial dependence of age on wage - default lam=0.6', fontsize=20);\n" ] }, { @@ -2256,11 +2297,12 @@ "id": "02142f6e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.308692Z", - "iopub.status.busy": "2023-07-31T02:15:15.308306Z", - "iopub.status.idle": "2023-07-31T02:15:15.345188Z", - "shell.execute_reply": "2023-07-31T02:15:15.344373Z" - } + "iopub.execute_input": "2023-08-06T17:35:24.286568Z", + "iopub.status.busy": "2023-08-06T17:35:24.286086Z", + "iopub.status.idle": "2023-08-06T17:35:24.343400Z", + "shell.execute_reply": "2023-08-06T17:35:24.342678Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -2268,7 +2310,7 @@ "age_term.lam = approx_lam(Xgam, age_term, df=4+1)\n", "year_term = gam_full.terms[1]\n", "year_term.lam = approx_lam(Xgam, year_term, df=4+1)\n", - "gam_full = gam_full.fit(Xgam, y)" + "gam_full = gam_full.fit(Xgam, y)\n" ] }, { @@ -2288,11 +2330,12 @@ "id": "94587b05", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.349565Z", - "iopub.status.busy": "2023-07-31T02:15:15.348808Z", - "iopub.status.idle": "2023-07-31T02:15:15.493969Z", - "shell.execute_reply": "2023-07-31T02:15:15.493186Z" - } + "iopub.execute_input": "2023-08-06T17:35:24.347280Z", + "iopub.status.busy": "2023-08-06T17:35:24.346878Z", + "iopub.status.idle": "2023-08-06T17:35:24.511252Z", + "shell.execute_reply": "2023-08-06T17:35:24.510569Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2323,7 +2366,7 @@ " ax=ax)\n", "ax.set_xlabel('Year')\n", "ax.set_ylabel('Effect on wage')\n", - "ax.set_title('Partial dependence of year on wage', fontsize=20)" + "ax.set_title('Partial dependence of year on wage', fontsize=20)\n" ] }, { @@ -2331,7 +2374,7 @@ "id": "5b373d5c", "metadata": {}, "source": [ - "Finally we plot `education`, which is categorical. The partial dependence plot is different, and more suitable for the set of fitted constants for each level of this variable." + "Finally we plot `education`, which is categorical. The partial dependence plot is different, and more suitable for the set of fitted constants for each level of this variable. " ] }, { @@ -2340,10 +2383,10 @@ "id": "bba4c757", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.497724Z", - "iopub.status.busy": "2023-07-31T02:15:15.497435Z", - "iopub.status.idle": "2023-07-31T02:15:15.654244Z", - "shell.execute_reply": "2023-07-31T02:15:15.653870Z" + "iopub.execute_input": "2023-08-06T17:35:24.515732Z", + "iopub.status.busy": "2023-08-06T17:35:24.515470Z", + "iopub.status.idle": "2023-08-06T17:35:24.666853Z", + "shell.execute_reply": "2023-08-06T17:35:24.666565Z" } }, "outputs": [ @@ -2365,7 +2408,7 @@ "ax.set_ylabel('Effect on wage')\n", "ax.set_title('Partial dependence of wage on education',\n", " fontsize=20);\n", - "ax.set_xticklabels(Wage['education'].cat.categories, fontsize=8);" + "ax.set_xticklabels(Wage['education'].cat.categories, fontsize=8);\n" ] }, { @@ -2387,10 +2430,10 @@ "id": "32368085", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.655935Z", - "iopub.status.busy": "2023-07-31T02:15:15.655824Z", - "iopub.status.idle": "2023-07-31T02:15:15.686432Z", - "shell.execute_reply": "2023-07-31T02:15:15.685688Z" + "iopub.execute_input": "2023-08-06T17:35:24.668508Z", + "iopub.status.busy": "2023-08-06T17:35:24.668401Z", + "iopub.status.idle": "2023-08-06T17:35:24.701806Z", + "shell.execute_reply": "2023-08-06T17:35:24.700424Z" } }, "outputs": [ @@ -2413,7 +2456,7 @@ "gam_linear = LinearGAM(age_term +\n", " l_gam(1, lam=0) +\n", " f_gam(2, lam=0))\n", - "gam_linear.fit(Xgam, y)" + "gam_linear.fit(Xgam, y)\n" ] }, { @@ -2434,11 +2477,12 @@ "id": "e7ba9957", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.691690Z", - "iopub.status.busy": "2023-07-31T02:15:15.691016Z", - "iopub.status.idle": "2023-07-31T02:15:15.703660Z", - "shell.execute_reply": "2023-07-31T02:15:15.702988Z" - } + "iopub.execute_input": "2023-08-06T17:35:24.705887Z", + "iopub.status.busy": "2023-08-06T17:35:24.705492Z", + "iopub.status.idle": "2023-08-06T17:35:24.719138Z", + "shell.execute_reply": "2023-08-06T17:35:24.717774Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2515,7 +2559,7 @@ } ], "source": [ - "anova_gam(gam_0, gam_linear, gam_full)" + "anova_gam(gam_0, gam_linear, gam_full)\n" ] }, { @@ -2541,10 +2585,10 @@ "id": "ffc0099a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.707900Z", - "iopub.status.busy": "2023-07-31T02:15:15.707547Z", - "iopub.status.idle": "2023-07-31T02:15:15.750369Z", - "shell.execute_reply": "2023-07-31T02:15:15.749682Z" + "iopub.execute_input": "2023-08-06T17:35:24.725028Z", + "iopub.status.busy": "2023-08-06T17:35:24.724616Z", + "iopub.status.idle": "2023-08-06T17:35:24.770728Z", + "shell.execute_reply": "2023-08-06T17:35:24.769960Z" } }, "outputs": [ @@ -2651,10 +2695,10 @@ "id": "08026a6b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.754363Z", - "iopub.status.busy": "2023-07-31T02:15:15.753938Z", - "iopub.status.idle": "2023-07-31T02:15:15.761799Z", - "shell.execute_reply": "2023-07-31T02:15:15.760383Z" + "iopub.execute_input": "2023-08-06T17:35:24.776059Z", + "iopub.status.busy": "2023-08-06T17:35:24.775063Z", + "iopub.status.idle": "2023-08-06T17:35:24.783501Z", + "shell.execute_reply": "2023-08-06T17:35:24.781979Z" } }, "outputs": [ @@ -2693,7 +2737,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/var/folders/16/8y65_zv174qgdp4ktlmpv12h0000gq/T/ipykernel_87737/3870570873.py:1: UserWarning: KNOWN BUG: p-values computed in this summary are likely much smaller than they should be. \n", + "/var/folders/16/8y65_zv174qgdp4ktlmpv12h0000gq/T/ipykernel_85019/2135516388.py:1: UserWarning: KNOWN BUG: p-values computed in this summary are likely much smaller than they should be. \n", " \n", "Please do not make inferences based on these values! \n", "\n", @@ -2705,7 +2749,7 @@ } ], "source": [ - "gam_full.summary()" + "gam_full.summary()\n" ] }, { @@ -2724,15 +2768,15 @@ "id": "9191d615", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.766013Z", - "iopub.status.busy": "2023-07-31T02:15:15.765724Z", - "iopub.status.idle": "2023-07-31T02:15:15.779820Z", - "shell.execute_reply": "2023-07-31T02:15:15.779119Z" + "iopub.execute_input": "2023-08-06T17:35:24.787789Z", + "iopub.status.busy": "2023-08-06T17:35:24.787540Z", + "iopub.status.idle": "2023-08-06T17:35:24.802733Z", + "shell.execute_reply": "2023-08-06T17:35:24.801551Z" } }, "outputs": [], "source": [ - "Yhat = gam_full.predict(Xgam)" + "Yhat = gam_full.predict(Xgam)\n" ] }, { @@ -2750,11 +2794,12 @@ "id": "92007a5f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.783636Z", - "iopub.status.busy": "2023-07-31T02:15:15.783296Z", - "iopub.status.idle": "2023-07-31T02:15:15.907664Z", - "shell.execute_reply": "2023-07-31T02:15:15.906806Z" - } + "iopub.execute_input": "2023-08-06T17:35:24.807058Z", + "iopub.status.busy": "2023-08-06T17:35:24.806737Z", + "iopub.status.idle": "2023-08-06T17:35:24.915626Z", + "shell.execute_reply": "2023-08-06T17:35:24.914906Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2774,7 +2819,7 @@ "gam_logit = LogisticGAM(age_term + \n", " l_gam(1, lam=0) +\n", " f_gam(2, lam=0))\n", - "gam_logit.fit(Xgam, high_earn)" + "gam_logit.fit(Xgam, high_earn)\n" ] }, { @@ -2783,11 +2828,12 @@ "id": "4dd6aa2f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:15.911434Z", - "iopub.status.busy": "2023-07-31T02:15:15.910708Z", - "iopub.status.idle": "2023-07-31T02:15:16.048530Z", - "shell.execute_reply": "2023-07-31T02:15:16.047846Z" - } + "iopub.execute_input": "2023-08-06T17:35:24.919443Z", + "iopub.status.busy": "2023-08-06T17:35:24.919192Z", + "iopub.status.idle": "2023-08-06T17:35:25.080317Z", + "shell.execute_reply": "2023-08-06T17:35:25.078256Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2808,7 +2854,7 @@ "ax.set_ylabel('Effect on wage')\n", "ax.set_title('Partial dependence of wage on education',\n", " fontsize=20);\n", - "ax.set_xticklabels(Wage['education'].cat.categories, fontsize=8);" + "ax.set_xticklabels(Wage['education'].cat.categories, fontsize=8);\n" ] }, { @@ -2826,11 +2872,12 @@ "id": "5a6e8754", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.052843Z", - "iopub.status.busy": "2023-07-31T02:15:16.052407Z", - "iopub.status.idle": "2023-07-31T02:15:16.079850Z", - "shell.execute_reply": "2023-07-31T02:15:16.078984Z" - } + "iopub.execute_input": "2023-08-06T17:35:25.084731Z", + "iopub.status.busy": "2023-08-06T17:35:25.084443Z", + "iopub.status.idle": "2023-08-06T17:35:25.109581Z", + "shell.execute_reply": "2023-08-06T17:35:25.108827Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -2908,7 +2955,7 @@ } ], "source": [ - "pd.crosstab(Wage['high_earn'], Wage['education'])" + "pd.crosstab(Wage['high_earn'], Wage['education'])\n" ] }, { @@ -2925,7 +2972,7 @@ "we could subset the model matrix, though this will not remove the\n", "column from `Xgam`. While we can deduce which column corresponds\n", "to this feature, for reproducibility’s sake we reform the model matrix\n", - "on this smaller subset." + "on this smaller subset.\n" ] }, { @@ -2934,11 +2981,12 @@ "id": "c92b60be", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.083887Z", - "iopub.status.busy": "2023-07-31T02:15:16.083527Z", - "iopub.status.idle": "2023-07-31T02:15:16.091266Z", - "shell.execute_reply": "2023-07-31T02:15:16.090319Z" - } + "iopub.execute_input": "2023-08-06T17:35:25.114462Z", + "iopub.status.busy": "2023-08-06T17:35:25.114086Z", + "iopub.status.idle": "2023-08-06T17:35:25.120741Z", + "shell.execute_reply": "2023-08-06T17:35:25.120108Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -2947,7 +2995,7 @@ "Xgam_ = np.column_stack([Wage_['age'],\n", " Wage_['year'],\n", " Wage_['education'].cat.codes-1])\n", - "high_earn_ = Wage_['high_earn']" + "high_earn_ = Wage_['high_earn']\n" ] }, { @@ -2967,11 +3015,12 @@ "id": "e525e8d0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.095914Z", - "iopub.status.busy": "2023-07-31T02:15:16.095270Z", - "iopub.status.idle": "2023-07-31T02:15:16.153654Z", - "shell.execute_reply": "2023-07-31T02:15:16.152986Z" - } + "iopub.execute_input": "2023-08-06T17:35:25.124664Z", + "iopub.status.busy": "2023-08-06T17:35:25.124412Z", + "iopub.status.idle": "2023-08-06T17:35:25.187015Z", + "shell.execute_reply": "2023-08-06T17:35:25.186350Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -2991,7 +3040,7 @@ "gam_logit_ = LogisticGAM(age_term +\n", " year_term +\n", " f_gam(2, lam=0))\n", - "gam_logit_.fit(Xgam_, high_earn_)" + "gam_logit_.fit(Xgam_, high_earn_)\n" ] }, { @@ -3009,10 +3058,10 @@ "id": "c3e66cf9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.157725Z", - "iopub.status.busy": "2023-07-31T02:15:16.157380Z", - "iopub.status.idle": "2023-07-31T02:15:16.283378Z", - "shell.execute_reply": "2023-07-31T02:15:16.282779Z" + "iopub.execute_input": "2023-08-06T17:35:25.191341Z", + "iopub.status.busy": "2023-08-06T17:35:25.191048Z", + "iopub.status.idle": "2023-08-06T17:35:25.340618Z", + "shell.execute_reply": "2023-08-06T17:35:25.339704Z" } }, "outputs": [ @@ -3034,7 +3083,7 @@ "ax.set_ylabel('Effect on wage')\n", "ax.set_title('Partial dependence of high earner status on education', fontsize=20);\n", "ax.set_xticklabels(Wage['education'].cat.categories[1:],\n", - " fontsize=8);" + " fontsize=8);\n" ] }, { @@ -3043,10 +3092,10 @@ "id": "fd924348", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.286495Z", - "iopub.status.busy": "2023-07-31T02:15:16.286234Z", - "iopub.status.idle": "2023-07-31T02:15:16.460530Z", - "shell.execute_reply": "2023-07-31T02:15:16.460174Z" + "iopub.execute_input": "2023-08-06T17:35:25.345459Z", + "iopub.status.busy": "2023-08-06T17:35:25.345074Z", + "iopub.status.idle": "2023-08-06T17:35:25.463152Z", + "shell.execute_reply": "2023-08-06T17:35:25.462836Z" } }, "outputs": [ @@ -3067,7 +3116,7 @@ "ax.set_xlabel('Year')\n", "ax.set_ylabel('Effect on wage')\n", "ax.set_title('Partial dependence of high earner status on year',\n", - " fontsize=20);" + " fontsize=20);\n" ] }, { @@ -3076,11 +3125,12 @@ "id": "2d3ec90a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.462091Z", - "iopub.status.busy": "2023-07-31T02:15:16.461971Z", - "iopub.status.idle": "2023-07-31T02:15:16.573978Z", - "shell.execute_reply": "2023-07-31T02:15:16.573664Z" - } + "iopub.execute_input": "2023-08-06T17:35:25.464839Z", + "iopub.status.busy": "2023-08-06T17:35:25.464711Z", + "iopub.status.idle": "2023-08-06T17:35:25.574888Z", + "shell.execute_reply": "2023-08-06T17:35:25.574562Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -3099,7 +3149,7 @@ "ax = plot_gam(gam_logit_, 0)\n", "ax.set_xlabel('Age')\n", "ax.set_ylabel('Effect on wage')\n", - "ax.set_title('Partial dependence of high earner status on age', fontsize=20);" + "ax.set_title('Partial dependence of high earner status on age', fontsize=20);\n" ] }, { @@ -3123,11 +3173,12 @@ "id": "4f2bc0eb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:16.575762Z", - "iopub.status.busy": "2023-07-31T02:15:16.575621Z", - "iopub.status.idle": "2023-07-31T02:15:16.719422Z", - "shell.execute_reply": "2023-07-31T02:15:16.719075Z" - } + "iopub.execute_input": "2023-08-06T17:35:25.576662Z", + "iopub.status.busy": "2023-08-06T17:35:25.576532Z", + "iopub.status.idle": "2023-08-06T17:35:25.718350Z", + "shell.execute_reply": "2023-08-06T17:35:25.718022Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -3156,15 +3207,24 @@ " linewidth=4)\n", "ax.set_xlabel('Age', fontsize=20)\n", "ax.set_ylabel('Wage', fontsize=20);\n", - "ax.legend(title='span', fontsize=15);" + "ax.legend(title='span', fontsize=15);\n" + ] + }, + { + "cell_type": "markdown", + "id": "3ce87f4b", + "metadata": {}, + "source": [ + " \n", + " \n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch8-baggboost-lab.ipynb b/Ch8-baggboost-lab.ipynb index 826f96f..98394d6 100644 --- a/Ch8-baggboost-lab.ipynb +++ b/Ch8-baggboost-lab.ipynb @@ -2,15 +2,17 @@ "cells": [ { "cell_type": "markdown", - "id": "7b0242c6", + "id": "15894965", "metadata": {}, "source": [ - "# Chapter 8" + "\n", + "# Chapter 8\n", + "\n" ] }, { "cell_type": "markdown", - "id": "db138cdf", + "id": "997ad844", "metadata": {}, "source": [ "# Lab: Tree-Based Methods\n", @@ -21,14 +23,15 @@ { "cell_type": "code", "execution_count": 1, - "id": "4cc7120f", + "id": "03f4774e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:40.300816Z", - "iopub.status.busy": "2023-07-31T04:30:40.300524Z", - "iopub.status.idle": "2023-07-31T04:30:41.427594Z", - "shell.execute_reply": "2023-07-31T04:30:41.427210Z" - } + "iopub.execute_input": "2023-08-06T17:35:26.973875Z", + "iopub.status.busy": "2023-08-06T17:35:26.973371Z", + "iopub.status.idle": "2023-08-06T17:35:28.034474Z", + "shell.execute_reply": "2023-08-06T17:35:28.034036Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -37,12 +40,12 @@ "from matplotlib.pyplot import subplots\n", "import sklearn.model_selection as skm\n", "from ISLP import load_data, confusion_table\n", - "from ISLP.models import ModelSpec as MS" + "from ISLP.models import ModelSpec as MS\n" ] }, { "cell_type": "markdown", - "id": "75645461", + "id": "87f2f0d6", "metadata": {}, "source": [ "We also collect the new imports\n", @@ -52,14 +55,15 @@ { "cell_type": "code", "execution_count": 2, - "id": "864fa15e", + "id": "45944bc2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.429527Z", - "iopub.status.busy": "2023-07-31T04:30:41.429365Z", - "iopub.status.idle": "2023-07-31T04:30:41.482154Z", - "shell.execute_reply": "2023-07-31T04:30:41.481876Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.036518Z", + "iopub.status.busy": "2023-08-06T17:35:28.036337Z", + "iopub.status.idle": "2023-08-06T17:35:28.099133Z", + "shell.execute_reply": "2023-08-06T17:35:28.098845Z" + }, + "lines_to_next_cell": 2 }, "outputs": [], "source": [ @@ -72,12 +76,12 @@ "from sklearn.ensemble import \\\n", " (RandomForestRegressor as RF,\n", " GradientBoostingRegressor as GBR)\n", - "from ISLP.bart import BART" + "from ISLP.bart import BART\n" ] }, { "cell_type": "markdown", - "id": "7b68e1e9", + "id": "72228f44", "metadata": {}, "source": [ "## Fitting Classification Trees" @@ -85,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "85b1d9af", + "id": "de444669", "metadata": {}, "source": [ "We first use classification trees to analyze the `Carseats` data set.\n", @@ -99,13 +103,13 @@ { "cell_type": "code", "execution_count": 3, - "id": "bfb4c83b", + "id": "f5b68c46", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.483971Z", - "iopub.status.busy": "2023-07-31T04:30:41.483851Z", - "iopub.status.idle": "2023-07-31T04:30:41.488856Z", - "shell.execute_reply": "2023-07-31T04:30:41.488596Z" + "iopub.execute_input": "2023-08-06T17:35:28.100949Z", + "iopub.status.busy": "2023-08-06T17:35:28.100843Z", + "iopub.status.idle": "2023-08-06T17:35:28.106734Z", + "shell.execute_reply": "2023-08-06T17:35:28.106477Z" } }, "outputs": [], @@ -113,43 +117,44 @@ "Carseats = load_data('Carseats')\n", "High = np.where(Carseats.Sales > 8,\n", " \"Yes\",\n", - " \"No\")" + " \"No\")\n" ] }, { "cell_type": "markdown", - "id": "8e50828c", + "id": "0b64c42c", "metadata": {}, "source": [ "We now use `DecisionTreeClassifier()` to fit a classification tree in\n", "order to predict `High` using all variables but `Sales`.\n", "To do so, we must form a model matrix as we did when fitting regression\n", - "models." + "models. " ] }, { "cell_type": "code", "execution_count": 4, - "id": "5d9e7a14", + "id": "a04ebae3", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.490354Z", - "iopub.status.busy": "2023-07-31T04:30:41.490251Z", - "iopub.status.idle": "2023-07-31T04:30:41.500107Z", - "shell.execute_reply": "2023-07-31T04:30:41.499827Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.108295Z", + "iopub.status.busy": "2023-08-06T17:35:28.108194Z", + "iopub.status.idle": "2023-08-06T17:35:28.117988Z", + "shell.execute_reply": "2023-08-06T17:35:28.117702Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "model = MS(Carseats.columns.drop('Sales'), intercept=False)\n", "D = model.fit_transform(Carseats)\n", "feature_names = list(D.columns)\n", - "X = np.asarray(D)" + "X = np.asarray(D)\n" ] }, { "cell_type": "markdown", - "id": "b42d6270", + "id": "48a7240b", "metadata": {}, "source": [ "We have converted `D` from a data frame to an array `X`, which is needed in some of the analysis below. We also need the `feature_names` for annotating our plots later.\n", @@ -164,14 +169,15 @@ { "cell_type": "code", "execution_count": 5, - "id": "970c4515", + "id": "c859e1bc", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.501612Z", - "iopub.status.busy": "2023-07-31T04:30:41.501506Z", - "iopub.status.idle": "2023-07-31T04:30:41.506829Z", - "shell.execute_reply": "2023-07-31T04:30:41.506566Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.119451Z", + "iopub.status.busy": "2023-08-06T17:35:28.119371Z", + "iopub.status.idle": "2023-08-06T17:35:28.125117Z", + "shell.execute_reply": "2023-08-06T17:35:28.124870Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -192,12 +198,12 @@ "clf = DTC(criterion='entropy',\n", " max_depth=3,\n", " random_state=0) \n", - "clf.fit(X, High)" + "clf.fit(X, High)\n" ] }, { "cell_type": "markdown", - "id": "5ccdc9e7", + "id": "1f96b0d3", "metadata": {}, "source": [ "In our discussion of qualitative features in Section 3.3,\n", @@ -215,14 +221,15 @@ { "cell_type": "code", "execution_count": 6, - "id": "2d9a51dc", + "id": "25f3d7d9", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.508361Z", - "iopub.status.busy": "2023-07-31T04:30:41.508261Z", - "iopub.status.idle": "2023-07-31T04:30:41.511129Z", - "shell.execute_reply": "2023-07-31T04:30:41.510866Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.126685Z", + "iopub.status.busy": "2023-08-06T17:35:28.126586Z", + "iopub.status.idle": "2023-08-06T17:35:28.129337Z", + "shell.execute_reply": "2023-08-06T17:35:28.129084Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -237,12 +244,12 @@ } ], "source": [ - "accuracy_score(High, clf.predict(X))" + "accuracy_score(High, clf.predict(X))\n" ] }, { "cell_type": "markdown", - "id": "7fd4219f", + "id": "0be04bee", "metadata": {}, "source": [ "With only the default arguments, the training error rate is\n", @@ -261,13 +268,13 @@ { "cell_type": "code", "execution_count": 7, - "id": "cbc04b67", + "id": "1aee216b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.512528Z", - "iopub.status.busy": "2023-07-31T04:30:41.512435Z", - "iopub.status.idle": "2023-07-31T04:30:41.515596Z", - "shell.execute_reply": "2023-07-31T04:30:41.515356Z" + "iopub.execute_input": "2023-08-06T17:35:28.130735Z", + "iopub.status.busy": "2023-08-06T17:35:28.130643Z", + "iopub.status.idle": "2023-08-06T17:35:28.133827Z", + "shell.execute_reply": "2023-08-06T17:35:28.133540Z" } }, "outputs": [ @@ -284,12 +291,12 @@ ], "source": [ "resid_dev = np.sum(log_loss(High, clf.predict_proba(X)))\n", - "resid_dev" + "resid_dev\n" ] }, { "cell_type": "markdown", - "id": "bca81c07", + "id": "e226e2e0", "metadata": {}, "source": [ "This is closely related to the *entropy*, defined in (8.7).\n", @@ -304,14 +311,15 @@ { "cell_type": "code", "execution_count": 8, - "id": "809830c7", + "id": "7404fab4", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.516955Z", - "iopub.status.busy": "2023-07-31T04:30:41.516861Z", - "iopub.status.idle": "2023-07-31T04:30:41.819909Z", - "shell.execute_reply": "2023-07-31T04:30:41.819123Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.135195Z", + "iopub.status.busy": "2023-08-06T17:35:28.135115Z", + "iopub.status.idle": "2023-08-06T17:35:28.448517Z", + "shell.execute_reply": "2023-08-06T17:35:28.447797Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -329,12 +337,12 @@ "ax = subplots(figsize=(12,12))[1]\n", "plot_tree(clf,\n", " feature_names=feature_names,\n", - " ax=ax);" + " ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "c7cf2e12", + "id": "95052722", "metadata": {}, "source": [ "The most important indicator of `Sales` appears to be `ShelveLoc`.\n", @@ -351,13 +359,13 @@ { "cell_type": "code", "execution_count": 9, - "id": "abe8c7fc", + "id": "f9774fa0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.825044Z", - "iopub.status.busy": "2023-07-31T04:30:41.824582Z", - "iopub.status.idle": "2023-07-31T04:30:41.833443Z", - "shell.execute_reply": "2023-07-31T04:30:41.831954Z" + "iopub.execute_input": "2023-08-06T17:35:28.452296Z", + "iopub.status.busy": "2023-08-06T17:35:28.451809Z", + "iopub.status.idle": "2023-08-06T17:35:28.458584Z", + "shell.execute_reply": "2023-08-06T17:35:28.456974Z" } }, "outputs": [ @@ -394,12 +402,12 @@ "source": [ "print(export_text(clf,\n", " feature_names=feature_names,\n", - " show_weights=True))" + " show_weights=True))\n" ] }, { "cell_type": "markdown", - "id": "f06c2f4c", + "id": "b4bdd532", "metadata": {}, "source": [ "In order to properly evaluate the performance of a classification tree\n", @@ -416,14 +424,15 @@ { "cell_type": "code", "execution_count": 10, - "id": "f7a1f736", + "id": "17d3bb25", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.839397Z", - "iopub.status.busy": "2023-07-31T04:30:41.839140Z", - "iopub.status.idle": "2023-07-31T04:30:41.855525Z", - "shell.execute_reply": "2023-07-31T04:30:41.854837Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.464919Z", + "iopub.status.busy": "2023-08-06T17:35:28.464498Z", + "iopub.status.idle": "2023-08-06T17:35:28.477773Z", + "shell.execute_reply": "2023-08-06T17:35:28.477055Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -445,12 +454,20 @@ " D,\n", " High,\n", " cv=validation)\n", - "results['test_score']" + "results['test_score']\n" ] }, { "cell_type": "markdown", - "id": "533af069", + "id": "890d1cd6", + "metadata": {}, + "source": [ + " " + ] + }, + { + "cell_type": "markdown", + "id": "273ee930", "metadata": {}, "source": [ "Next, we consider whether pruning the tree might lead to improved\n", @@ -463,14 +480,15 @@ { "cell_type": "code", "execution_count": 11, - "id": "c663a623", + "id": "0534db0a", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.859695Z", - "iopub.status.busy": "2023-07-31T04:30:41.859181Z", - "iopub.status.idle": "2023-07-31T04:30:41.871569Z", - "shell.execute_reply": "2023-07-31T04:30:41.869736Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.481429Z", + "iopub.status.busy": "2023-08-06T17:35:28.480921Z", + "iopub.status.idle": "2023-08-06T17:35:28.488563Z", + "shell.execute_reply": "2023-08-06T17:35:28.485938Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ @@ -486,23 +504,24 @@ }, { "cell_type": "markdown", - "id": "9e618049", + "id": "666f4683", "metadata": {}, "source": [ - "We first refit the full tree on the training set; here we do not set a `max_depth` parameter, since we will learn that through cross-validation." + "We first refit the full tree on the training set; here we do not set a `max_depth` parameter, since we will learn that through cross-validation.\n" ] }, { "cell_type": "code", "execution_count": 12, - "id": "c2f2a403", + "id": "32518104", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.875825Z", - "iopub.status.busy": "2023-07-31T04:30:41.875521Z", - "iopub.status.idle": "2023-07-31T04:30:41.887622Z", - "shell.execute_reply": "2023-07-31T04:30:41.886986Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.492422Z", + "iopub.status.busy": "2023-08-06T17:35:28.491746Z", + "iopub.status.idle": "2023-08-06T17:35:28.500287Z", + "shell.execute_reply": "2023-08-06T17:35:28.499728Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -519,41 +538,42 @@ "source": [ "clf = DTC(criterion='entropy', random_state=0)\n", "clf.fit(X_train, High_train)\n", - "accuracy_score(High_test, clf.predict(X_test))" + "accuracy_score(High_test, clf.predict(X_test))\n" ] }, { "cell_type": "markdown", - "id": "bb59eecd", + "id": "fa0ef12b", "metadata": {}, "source": [ "Next we use the `cost_complexity_pruning_path()` method of\n", - "`clf` to extract cost-complexity values." + "`clf` to extract cost-complexity values. " ] }, { "cell_type": "code", "execution_count": 13, - "id": "b2505658", + "id": "72399ed8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.891688Z", - "iopub.status.busy": "2023-07-31T04:30:41.891302Z", - "iopub.status.idle": "2023-07-31T04:30:41.900931Z", - "shell.execute_reply": "2023-07-31T04:30:41.900021Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.505447Z", + "iopub.status.busy": "2023-08-06T17:35:28.504547Z", + "iopub.status.idle": "2023-08-06T17:35:28.512277Z", + "shell.execute_reply": "2023-08-06T17:35:28.511610Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "ccp_path = clf.cost_complexity_pruning_path(X_train, High_train)\n", "kfold = skm.KFold(10,\n", " random_state=1,\n", - " shuffle=True)" + " shuffle=True)\n" ] }, { "cell_type": "markdown", - "id": "0fdf1106", + "id": "0ebebce3", "metadata": {}, "source": [ "This yields a set of impurities and $\\alpha$ values\n", @@ -563,14 +583,15 @@ { "cell_type": "code", "execution_count": 14, - "id": "09a7bd33", + "id": "65729550", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:41.906506Z", - "iopub.status.busy": "2023-07-31T04:30:41.906147Z", - "iopub.status.idle": "2023-07-31T04:30:42.181528Z", - "shell.execute_reply": "2023-07-31T04:30:42.181248Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.517138Z", + "iopub.status.busy": "2023-08-06T17:35:28.516471Z", + "iopub.status.idle": "2023-08-06T17:35:28.789396Z", + "shell.execute_reply": "2023-08-06T17:35:28.789088Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -591,12 +612,12 @@ " cv=kfold,\n", " scoring='accuracy')\n", "grid.fit(X_train, High_train)\n", - "grid.best_score_" + "grid.best_score_\n" ] }, { "cell_type": "markdown", - "id": "ff585d2c", + "id": "9df5690f", "metadata": {}, "source": [ "Let’s take a look at the pruned true." @@ -605,14 +626,15 @@ { "cell_type": "code", "execution_count": 15, - "id": "a75dea32", + "id": "f08fac89", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:42.183092Z", - "iopub.status.busy": "2023-07-31T04:30:42.183007Z", - "iopub.status.idle": "2023-07-31T04:30:42.935282Z", - "shell.execute_reply": "2023-07-31T04:30:42.934918Z" - } + "iopub.execute_input": "2023-08-06T17:35:28.791085Z", + "iopub.status.busy": "2023-08-06T17:35:28.790968Z", + "iopub.status.idle": "2023-08-06T17:35:29.552519Z", + "shell.execute_reply": "2023-08-06T17:35:29.552196Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -631,12 +653,12 @@ "best_ = grid.best_estimator_\n", "plot_tree(best_,\n", " feature_names=feature_names,\n", - " ax=ax);" + " ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "c81a06b3", + "id": "ad338c5d", "metadata": {}, "source": [ "This is quite a bushy tree. We could count the leaves, or query\n", @@ -646,14 +668,15 @@ { "cell_type": "code", "execution_count": 16, - "id": "3f1e3d19", + "id": "9d9f3282", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:42.937030Z", - "iopub.status.busy": "2023-07-31T04:30:42.936913Z", - "iopub.status.idle": "2023-07-31T04:30:42.939665Z", - "shell.execute_reply": "2023-07-31T04:30:42.939410Z" - } + "iopub.execute_input": "2023-08-06T17:35:29.554224Z", + "iopub.status.busy": "2023-08-06T17:35:29.554116Z", + "iopub.status.idle": "2023-08-06T17:35:29.556614Z", + "shell.execute_reply": "2023-08-06T17:35:29.556269Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -668,12 +691,12 @@ } ], "source": [ - "best_.tree_.n_leaves" + "best_.tree_.n_leaves\n" ] }, { "cell_type": "markdown", - "id": "7a32f63a", + "id": "c7026950", "metadata": {}, "source": [ "The tree with 30 terminal\n", @@ -685,14 +708,15 @@ { "cell_type": "code", "execution_count": 17, - "id": "30f5c2f9", + "id": "acf1ff61", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:42.941120Z", - "iopub.status.busy": "2023-07-31T04:30:42.941021Z", - "iopub.status.idle": "2023-07-31T04:30:42.947592Z", - "shell.execute_reply": "2023-07-31T04:30:42.947326Z" - } + "iopub.execute_input": "2023-08-06T17:35:29.558209Z", + "iopub.status.busy": "2023-08-06T17:35:29.558093Z", + "iopub.status.idle": "2023-08-06T17:35:29.564243Z", + "shell.execute_reply": "2023-08-06T17:35:29.563972Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -764,20 +788,22 @@ " best_.predict(X_test)))\n", "confusion = confusion_table(best_.predict(X_test),\n", " High_test)\n", - "confusion" + "confusion\n" ] }, { "cell_type": "markdown", - "id": "adbe5709", + "id": "18a49a50", "metadata": {}, "source": [ - "Now 72.0% of the test observations are correctly classified, which is slightly worse than the error for the full tree (with 35 leaves). So cross-validation has not helped us much here; it only pruned off 5 leaves, at a cost of a slightly worse error. These results would change if we were to change the random number seeds above; even though cross-validation gives an unbiased approach to model selection, it does have variance." + "Now 72.0% of the test observations are correctly classified, which is slightly worse than the error for the full tree (with 35 leaves). So cross-validation has not helped us much here; it only pruned off 5 leaves, at a cost of a slightly worse error. These results would change if we were to change the random number seeds above; even though cross-validation gives an unbiased approach to model selection, it does have variance.\n", + "\n", + " " ] }, { "cell_type": "markdown", - "id": "ad50114a", + "id": "29a0f063", "metadata": {}, "source": [ "## Fitting Regression Trees\n", @@ -788,13 +814,13 @@ { "cell_type": "code", "execution_count": 18, - "id": "1ca6bc7a", + "id": "852e2e4e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:42.949053Z", - "iopub.status.busy": "2023-07-31T04:30:42.948951Z", - "iopub.status.idle": "2023-07-31T04:30:42.956250Z", - "shell.execute_reply": "2023-07-31T04:30:42.955993Z" + "iopub.execute_input": "2023-08-06T17:35:29.565881Z", + "iopub.status.busy": "2023-08-06T17:35:29.565776Z", + "iopub.status.idle": "2023-08-06T17:35:29.573325Z", + "shell.execute_reply": "2023-08-06T17:35:29.573078Z" } }, "outputs": [], @@ -803,28 +829,28 @@ "model = MS(Boston.columns.drop('medv'), intercept=False)\n", "D = model.fit_transform(Boston)\n", "feature_names = list(D.columns)\n", - "X = np.asarray(D)" + "X = np.asarray(D)\n" ] }, { "cell_type": "markdown", - "id": "ebebb4a7", + "id": "1c386d58", "metadata": {}, "source": [ "First, we split the data into training and test sets, and fit the tree\n", - "to the training data. Here we use 30% of the data for the test set." + "to the training data. Here we use 30% of the data for the test set.\n" ] }, { "cell_type": "code", "execution_count": 19, - "id": "15cfb553", + "id": "2e09e93b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:42.957800Z", - "iopub.status.busy": "2023-07-31T04:30:42.957699Z", - "iopub.status.idle": "2023-07-31T04:30:42.960385Z", - "shell.execute_reply": "2023-07-31T04:30:42.960128Z" + "iopub.execute_input": "2023-08-06T17:35:29.574985Z", + "iopub.status.busy": "2023-08-06T17:35:29.574896Z", + "iopub.status.idle": "2023-08-06T17:35:29.577600Z", + "shell.execute_reply": "2023-08-06T17:35:29.577322Z" } }, "outputs": [], @@ -835,12 +861,12 @@ " y_test) = skm.train_test_split(X,\n", " Boston['medv'],\n", " test_size=0.3,\n", - " random_state=0)" + " random_state=0)\n" ] }, { "cell_type": "markdown", - "id": "ae21c490", + "id": "f60141a3", "metadata": {}, "source": [ "Having formed our training and test data sets, we fit the regression tree." @@ -849,19 +875,19 @@ { "cell_type": "code", "execution_count": 20, - "id": "d18820a3", + "id": "74aa3bf0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:42.961789Z", - "iopub.status.busy": "2023-07-31T04:30:42.961700Z", - "iopub.status.idle": "2023-07-31T04:30:43.237847Z", - "shell.execute_reply": "2023-07-31T04:30:43.237495Z" + "iopub.execute_input": "2023-08-06T17:35:29.579141Z", + "iopub.status.busy": "2023-08-06T17:35:29.579050Z", + "iopub.status.idle": "2023-08-06T17:35:29.856587Z", + "shell.execute_reply": "2023-08-06T17:35:29.856261Z" } }, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAA7YAAAOwCAYAAAAKo+iFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADzq0lEQVR4nOzdd3zN9//+8eskSMRendRK7bbEJjgZxN57V6maRe2Z+qiiLW2tUluM2psYSYyiVpUaMVNF1YpVIiHn94dfzldqNEjyPuNxv916a5xz3udcSRzPXK/XO+eYLBaLRQAAAAAA2CkXowMAAAAAAPAqKLYAAAAAALtGsQUAAAAA2DWKLQAAAADArlFsAQAAAAB2jWILAAAAALBrFFsAAAAAgF2j2AIAAAAA7BrFFgAAAABg1yi2AAAAAAC7RrEFAAAAANg1ii0AAAAAwK5RbAEAAAAAdo1iCwAAAACwaxRbAAAAAIBdo9gCAAAAAOwaxRYAAAAAYNcotgAAAAAAu0axBQAAAADYNYotAAAAAMCuUWwBAAAAAHaNYgsAAAAAsGsUWwAAAACAXaPYAgAAAADsGsUWAAAAAGDXKLYAAAAAALtGsQUAAAAA2DWKLQAAAADArlFsAQAAAAB2jWILAAAAALBrFFsAAAAAgF2j2AIAAAAA7BrFFgAAAABg1yi2AAAAAAC7RrEFAAAAANg1ii0AAAAAwK5RbAEAAAAAdo1iCwAAAACwaxRbAAAAAIBdo9gCAAAAAOwaxRYAAAAAYNcotgAAAAAAu0axBQAAAADYNYotAAAAAMCuUWwB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969tWTJknjv9ys9es/fzZs3v3BGAACSGju2AACbEBERofLly8vHx0dms1mRkZH6+++/5efnpypVqqhz587y9/eXJLVt21Y7duyQJIWFhal9+/aSpO+++06+vr4qUaKEBg8ebL3vnDlzqkuXLqpSpYpu3rypxo0by9fXVz4+Pjpx4oQkafny5SpatKhq166t/fv3PzNnTEyMOnToIF9fX3l7e2vXrl3WTJ06dVKtWrUUHBwsT09PDRo0SH5+fjp//ryaNm2qSpUqqXz58tb7//cxL6NgwYK6deuWJOn69et67bXXrNcFBgbG+zo8S1BQkFq0aCFJ2r17t9KlS6fWrVvLbDbHew/e3377TRUqVFDLli115cqVl8oLAEBSYMcWAGATQkJCVLlyZQUGBkp6tNPZs2dPtWvXTi1atNCMGTOsJfRZ2rdvr08//VQWi0XlypVThw4dlDNnTl28eFF9+vRRrly51L9/f9WvX19NmzbVkSNH1LdvXy1btkz9+/fXnj17lC5dOvn6+j7zMaZPn668efPqxx9/1JUrV1S7dm1ruc2ePbsmT54sSercubOqV6+uL774Qt99950KFCighQsXKjw8XG3atNHu3bufOOZxnTt31tGjR+NdljZt2nhFU5K8vLw0ZMgQFSlSRDdu3NC2bdskSYcOHZIkFS5c+LlfM+nRru/atWslPdrlPXDggA4ePCiLxaLy5curYsWKevPNN3XmzBmlS5dOM2bMUO/evTV79uz/vG8AAJIDxRYAYBMaN26skSNHqkWLFsqZM6cCAwMVHh6ubt26SZLKlSun+fPnS4p/Wu/jb8e+dOlSTZs2TSaTSWfPntX58+eVM2dOZc+eXbly5ZIkHT58WFu3btUPP/xgva8rV67otddes556W6ZMmWfmPHz4sHbu3KkNGzZIkm7cuGG9ztvb2/qxq6urypUrJ0k6fvy4GjRoIEnKnz+/rl279tRjHjdp0qTnfLX+z5gxY1S/fn317t1bu3fvVpcuXbR+/XoNHTpUEyZM+M/j9+/fr6xZs+qdd96RJGXOnFllypRRxowZJUnvv/++Tp06JS8vL7m5uUmSWrRoobFjxyYoHwAAyYFiCwCwCS4uLho5cqQkqV27d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at26tVq1aafr06ZRaG+bq6qqZM2fKZDKpZcuWslgsat68udGxAABOjmILADBUUFCQ2rRpozZt2ujHH3+k1NoBV1dXzZgxQy4uLmrVqpViY2PVsmVLo2MBAJwYxRYAYJg5c+aobdu2+vDDD/Xjjz/KxYUX67cXrq6umj59ukwmk9q0aSOLxaJWrVoZHQsA4KQotgAAQ8yePVsffvihPvroI02ZMoVSa4dcXFw0bdo0ubi4qE2bNoqNjVWbNm2MjgUAcEIUWwBAsps5c6Y++ugjtW/fXj/88AOl1o65uLho6tSpMplM+vDDD2WxWNS2bVujYwEAnAzFFgCQrGbMmKH27dvr448/1qRJkyi1DsDFxcW6696uXTtZLBZ9+OGHRscCADgRii0AINlMmzZNHTp00CeffKKJEydSah2Ii4uLJk+eLJPJpI8++kixsbH66KOPjI4FAHASFFsAQLL48ccf9fHHH6tz586aMGGCTCaT0ZGQyFxcXKy78O3bt5fFYlH79u2NjgUAcAIUWwBAkps6dao6duyoLl26aPz48ZRaB+bi4qKJEyfKZDKpQ4cOio2N1ccff2x0LACAg6PYAgCS1A8//KBOnTqpW7du+u677yi1TsBkMmnChAlycXFRx44dZbFY1LFjR6NjAQAcGMUWAJBkJk2apC5duujTTz/VuHHjKLVOxGQy6fvvv5eLi4s++eQTxcbGqlOnTkbHAgA4KIotACBJTJw4UV27dlWPHj00duxYSq0TMplM+vbbb2UymdS5c2dZLBZ17tzZ6FgAAAdEsQUAJLrx48ere/fu6tmzp7755htKrRMzmUzW3fouXbooNjZWXbt2NToWAMDBUGwBAInq+++/16effqrPPvtMX331FaUWMplMGjt2rFxcXNStWzdZLBZ169bN6FgAAAdCsQUAJJpvv/1WPXv2VJ8+fTR69GhKLaxMJpO+/vprubi4qHv37oqNjdWnn35qdCwAgIOg2AIAEsW4cePUq1cv9e3bV6NGjaLU4gkmk0ljxoyRyWRSjx49FBsbq549exodCwDgACi2AIBX9s0336h3797q37+/Ro4cSanFM5lMJo0ePVouLi7q1auXLBaLevXqZXQsAICdo9gCAF7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aMWOGdYA+S/v27fXpp5/KYrGoXLly6tChg3LmzKmLFy+qT58+ypUrl/r376/69euradOmOnLkiPr27atly5apf//+2rNnj9KlSydfX99nPsb06dOVN29e/fjjj7py5Ypq165tHczZs2fX5MmTJT16D93q1avriy++0HfffacCBQpo4cKFCg8PV5s2bbR79+4njnnci7xR/fLly/XFF1/o5s2bWr9+vSSpW7duGjZsmO7fv686deqoaNGi8vHxsR5z7dq1eEU1U6ZMunbt2nO/vgAA28QMjS+hM9TLy0tDhgxRkSJFdOPGDW3btk3Sf89QSbp3754CAgJ05MgRjRo1SpKUJ08e3b17VwUKFNCNGze0cuVKSZKfn58CAgI0ffp0RUVFac+ePc/9XgCOhmILp9K4cWONHDlSLVq0UM6cORUYGKjw8HB169ZN0qPfZZk/f74kxXtD9sdPUVq6dKmmTZsmk8mks2fP6vz588qZM6eyZ8+uXLlySZIOHz6srVu36ocffrDe15UrV/Taa68pQ4YMkqQyZco8M+fhw4e1c+dObdiwQZKsK7CS5O3tbf3Y1dVV5cqVkyQdP35cDRo0kCTlz58/XoF8/JjHvcgb1derV0/16tXTwoULNXDgQC1atEhZsmSRJLm7u6tBgwbat29fvKGcJUsWRUZGWv9848YN6zEAAPvCDI0voTN0zJgxql+/vnr37q3du3erS5cuWr9+/X/OUElKnTq1tm3bpqtXr6pkyZJq3LixFi5cqOzZs2vFihWKiIhQvXr19Ouvv6pfv3763//+p4YNG2rhwoUaMGDAUws54KgotnAqLi4uGjlypCSpXbt2Cg4OVr58+fTLL78ob9681tVZScqcObPOnTsnSdbTZyVpyJAhOn78uNzc3FS+fHnrwHZ1dbXepnDhwipbtqzq1asn6dELPbi6uurvv//WrVu3lC5dOu3Zs0dFihR5as7ChQvL09NTPXv2tB4f5/HHMZlM1h8eChQooO3bt8vf31/h4eHxCuTjxzwuoavNUVFRcnd3l/Ro19XDw0PSox8WMmbMKIvFotDQUDVr1izecZ6enoqIiFBkZKQ8PDy0c+dOffnll0/NAgCwbczQ+F7krKds2bJZ/x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5c6dW82aNWOGAnhp7NgCiWD8+PH6559/1L9/f6OjJKsBAwbozp07Gj9+vNFRAAB2Km63dsCAAUZHSVbMUCBxsWMLvKKbN28qd+7catGihVMOp65du2r+/PmKiIhQ+vTpjY4DALAjzFBmKJBY2LEFXtH333+vu3fvOt1Kc5wBAwbo7t27+v77742OAgCwM8xQZiiQWNixBV7BjRs3lDt3brVu3Vrfffed0XEM0717d82dO1cRERHKkCGD0XEAAHaAGfoIMxRIHOzYAq/gu+++U1RUlNP9bu2/9e/fX1FRUU79gwkA4MUwQx9hhgKJgx1b4CXduHFDuXLl0ocffqhx48YZHcdwPXr00OzZs3X27FllzJjR6DgAABvGDI2PGQq8OnZsgZf07bff6v79++rbt6/RUWxCv379WHEGACRI3Azt16+f0VFsAjMUeHUUW+AlREZGaty4cerUqZPefPNNo+PYhDfffFOffPKJxo0bpxs3bhgdBwBgox6foW+88YbRcWwCMxR4dRRb4CWMGzdOMTExrDT/S79+/RQdHc1pZQCAZ2KGPh0zFHg1FFvgBV2/fl3ffvutOnfurNdff93oODbljTfeUKdOnfTtt98qMjLS6DgAABvDDH02Zijwaii2wAsaO3asHj58yO/WPkPfvn0VExOjsWPHGh0FAGBjmKHPxwwFXh7FFngB165d03fffacuXbrotddeMzqOTXr99dfVpUsXfffdd7p+/brRcQAANuLatWv6/vvvmaHPwQwFXh7FFngBY8eOVWxsrHr37m10FJvWp08fPXz4kBVnAIBV3G5tnz59jI5i05ihwMuh2AIJdPXqVX3//ffq2rUrK83/4bXXXrOuOF+7ds3oOAAAgz0+Q7Nly2Z0HJvGDAVeDsUWSKBvvvlGFouFleYE6tOnjywWi7755hujowAADMYMfTHMUODFUWyBBLhy5YrGjx+vbt26KWvWrEbHsQvZsmVT165dNX78eF29etXoOAAAgzBDXxwzFHhxFFsgAb7++muZTCZ+t/YFxX29vv76a4OTAACMwgx9OcxQ4MVQbIH/cPnyZU2YMEHdu3dXlixZjI5jV7Jmzapu3bppwoQJunLlitFxAADJ7MqVK8zQ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/L5vnZ0nz8OWXXxa9e/cWISEh4uGHH7Y4CZmtOPLkUXqNZ1FFTxb0999/i/79+4vIyEgxYsQI9eRu5u9EJ06cEC4uLiIsLEyN3e0xKjpvMzIyxH333SciIiJEYGCgemJGe9Di5FF6jW9J312+++479ffloEGDxI0bN4QQ/8zXkr7bOvL3bFHliamLEJW/bkViYiJ69uyJhIQE9OjRo7IvR5V0p3gwXs6F8XQujKfz+eqrr/DQQw8xpk6i6BwFwPlqUOY4rlixgvPTiTCHOp/yxNTYB4oRERERERFRlcfCloiIiIiIiAyNhS0REREREREZGgtbIiIiIiIiMjSbXu4nJSXFli9HFVTWODBezsEcR8bTOTCezufkyZMAGFNnYS2OjK3x3B4zxtA5MIc6n/LE0iZnRT516hQ6dOiAzMzMyr4U2YinpydSUlLQqlWrYvcxXs7H1dUVBQUFWg+DbITxdD5ubm7qtZLJ+Mw5FgDzqYF5enpi8+bNiImJYQydCHOo8ymtrinKJoUtUFgsXb582RYvRTbQsGHDUoPPeDmXc+fOAYB6QW8yNsbT+WRnZ8Pd3V3rYZCNFM2xzKfGZY4jY+hcmEOdz53qGjObFbZEREREREREWuDJo4iIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGj/BxWf2d82Buy4AAAAAElFTkSuQmCC", + "image/png": "iVBORw0KGgoAAAANSUhEUgAAA7YAAAOwCAYAAAAKo+iFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAADzpklEQVR4nOzdd3zN9//+8eskSMRendRK7bbEJjgZxN57V6maRe2Z+qiiLW2tUluM2psYSYyiVpUaMVNF1YpVIiHn94dfzldqNEjyPuN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x47KmjVrgnds/fz8rC/8dObMGWXOnPmpj7du3TpVrFhRadKksV4W9yJRt2/fVoMGDVSyZEnrdUFBQVqyZMlzPwcAABwRxRYAgBdgMpnk7e0tb29vxcTEaP369fr777+VNWvWBO/Y+vn5aePGjTKbzYqOjra+4vGGDRt05coV66nHc+fOVceOHeMd27dvX+3du1cpUqTQqFGjlDJlSknS4cOH5eHhobx58ybiZwsAgH0wWSwWi9EhAADO58CBAypevLj279/P+9g6AL6fAAAj8arIAAAAAAC7RrEFAAAAANg1ii0AAAAAwK5RbAEA+JfAwEAFBQUZHSNBIiMjVaVKFVWqVEnlypXTr7/+Gu/6oUOHytPT84njoqOjra+wbDab5e7ursOHD0uSfvvtN1WtWlW+vr768MMPJT16/99MmTJZb79q1aqk/+QAAEggXhUZAOA0Hj58+MTb/ST148S9RuN/vZXQy2abN2+eypcvr2HDhmnHjh0aMWKEli5dKkm6cOGCTp48+dTjUqVKpbCwMEnS+fPnVbVqVb333nuKjo5W7969tWTJknjv9ys9es/fzZs3v3BGAACSGju2AACbEBERofLly8vHx0dms1mRkZH6+++/5efnpypVqqhz587y9/eXJLVt21Y7duyQJIWFhal9+/aSpO+++06+vr4qUaKEBg8ebL3vnDlzqkuXLqpSpYpu3rypxo0by9fXVz4+Pjpx4oQkafny5SpatKhq166t/fv3PzNnTEyMOnToIF9fX3l7e2vXrl3WTJ06dVKtWrUUHBwsT09PDRo0SH5+fjp//ryaNm2qSpUqqXz58tb7//cxL6NgwYK6deuWJOn69et67bXXrNcFBgbG+zo8S1BQkFq0aCFJ2r17t9KlS6fWrVvLbDbHew/e3377TRUqVFDLli115cqVl8oLAEBSYMcWAGATQkJCVLlyZQUGBkp6tNPZs2dPtWvXTi1atNCMGTOsJfRZ2rdvr08//VQWi0XlypVThw4dlDNnTl28eFF9+vRRrly51L9/f9WvX19NmzbVkSNH1LdvXy1btkz9+/fXnj17lC5dOvn6+j7zMaZPn668efPqxx9/1JUrV1S7dm1ruc2ePbsmT54sSercubOqV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DwUWwDAU1ksFg0bNkz/+9//9OWXX/JKtUh2AwcOlMlk0sCBA63llreVAgA8DcUWAPAEi8WiIUOG6IsvvtDo0aN5b1EYZsCAAXJxcVH//v0VGxur4cOHU24BAE+g2AIA4rFYLBo8eLBGjhypr776Sr179zY6Epxcv3795OLior59+8piseh///sf5RYAEA/FFgBgZbFYNHDgQI0aNUpff/21PvvsM6MjAZKkPn36yGQyqU+fPoqNjdUXX3xBuQUAWFFsAQCSHpXa/v37a8yYMRo7dqx69uxpdCQgnt69e8vFxUWfffaZYmNj9eWXX1JuAQCSKLYAAD0qtf369dNXX32lcePGqUePHkZHAp6qV69eMplM6tWrlywWi0aNGkW5BQBQbAHA2VksFvXp00fffPONvvvuO3Xv3t3oSMBz9ezZUy4uLurRo4diY2M1ZswYyi0AODmKLQA4MYvFos8++0zjxo3T+PHj1bVrV6MjAQny6aefysXFRd27d1dsbKy+/vpryi0AODGKLQA4KYvFol69eunbb7/VhAkT1KVLF6MjAS+kW7duMplM6tatmywWi7755hvKLQA4KYotADghi8WiHj166Pvvv9fEiRPVuXNnoyMBL6Vr164ymUzq2rWrYmNjNW7cOMotADghii0AOBmLxaJPP/1U48eP1+TJk/XJJ58YHQl4JV26dJGLi4s6d+4si8Wib7/9lnILAE6GYgsATsRisahbt26aOHGipkyZoo8//tjoSECi6NSpk1xcXPTJJ58oNjZW33//PeUWAJwIxRYAnERsbKy6du2qyZMna+rUqerQoYPRkYBE1bFjR5lMJnXs2FGxsbGaMGEC5RYAnATFFgCcQGxsrLp06aIpU6Zo2rRp+uijj4yOBCSJjz/+WC4uLurQoYMsFosmTJggFxcXo2MBAJIYxRYAHFxsbKw6d+6sqVOnatq0aWrXrp3RkYAk1b59e5lMJmu5nThxIuUWABwcxRYAHFhsbKw++eQTTZs2TdOnT9eHH35odCQgWXz00UcymUxq3769YmNjNXnyZMotADgwii0AOKjY2Fh17NhR06dP18yZM9WmTRujIwHJql27dnJxcVG7du0UGxurKVOmUG4BwEFRbAHAAcX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PmzVP58uW1detWjRkzJt6C7vNmqCSFhYVp69at2rJliwYOHChJ2rhxo9KkSaPt27dr6dKl6t+/v6RH79H70UcfKSwsTO3bt483qwFnQLGFU4mIiFD58uXl4+Mjs9msyMhI/f333/Lz81OVKlXUuXNn+fv7S5Latm1r3TWMGxLSo7fQ8fX1VYkSJTR48GDrfefMmVNdunRRlSpVdPPmTTVu3Fi+vr7y8fHRiRMnJEnLly9X0aJFVbt2be3fv/+ZOWNiYtShQwf5+vrK29tbu3btsmbq1KmTatWqpeDgYHl6emrQoEHy8/PT+fPn1bRpU1WqVEnly5e33v+/j3kZjw/bGzduxHvD+zFjxsjb21vjxo174rhTp04pV65cypIli1KnTq1y5cpp7969kh6V2H/z8PBQpkyZXiojACBpMUNfboYWLFhQt27dkiRdv35dr732mvW6581Q6f/m7+3bt1W4cGFJUt68eXX//n1ZLBZFRkZa769w4cK6cePGUx8HcAa8jy2cSkhIiCpXrqzAwEBJj1Zpe/bsqXbt2qlFixaaMWOGdYA+S/v27fXpp5/KYrGoXLly6tChg3LmzKmLFy+qT58+ypUrl/r376/69euradOmOnLkiPr27atly5apf//+2rNnj9KlSydfX99nPsb06dOVN29e/fjjj7py5Ypq165tHczZs2fX5MmTJT16D93q1avriy++0HfffacCBQpo4cKFCg8PV5s2bbR79+4njnnci7xR/fLly/XFF1/o5s2bWr9+vSSpW7duGjZsmO7fv686deqoaNGi8vHxsR5z7dq1eEU1U6ZMunbt2nO/vgAA28QMjS+hM9TLy0tDhgxRkSJFdOPGDW3btk3Sf89QSbp3754CAgJ05MgRjRo1SpKUJ08e3b17VwUKFNCNGze0cuVKSZKfn58CAgI0ffp0RUVFac+ePc/9XgCOhmILp9K4cWONHDlSLVq0UM6cORUYGKjw8HB169ZN0qPfZZk/f74kxXtD9sdPUVq6dKmmTZsmk8mks2fP6vz588qZM6eyZ8+uXLlySZIOHz6srVu36ocffrDe15UrV/Taa68pQ4YMkqQyZco8M+fhw4e1c+dObdiwQZKsK7CS5O3tbf3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Zw7dw4A1At6k7Exns4nOzsb7u7uWg+DbKRojmU+NS5zHBlD58Ic6pzuVNsANixsiYiIiIiIiLTAk0cRERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQWNgSERERERGRobGwJSIiIiIiIkNjYUtERERERESGxsKWiIiIiIiIDI2FLRERERERERkaC1siIiIiIiIyNBa2REREREREZGgsbImIiIiIiMjQ/g/QNdsvQNw/pQAAAABJRU5ErkJggg==", "text/plain": [ "
" ] @@ -876,12 +902,12 @@ "ax = subplots(figsize=(12,12))[1]\n", "plot_tree(reg,\n", " feature_names=feature_names,\n", - " ax=ax);" + " ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "5a4deec7", + "id": "baeedcf4", "metadata": {}, "source": [ "The variable `lstat` measures the percentage of individuals with\n", @@ -893,7 +919,7 @@ }, { "cell_type": "markdown", - "id": "f5cad860", + "id": "bf4867c8", "metadata": {}, "source": [ "Now we use the cross-validation function to see whether pruning\n", @@ -903,13 +929,13 @@ { "cell_type": "code", "execution_count": 21, - "id": "619f8d94", + "id": "9e563bf2", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:43.239633Z", - "iopub.status.busy": "2023-07-31T04:30:43.239507Z", - "iopub.status.idle": "2023-07-31T04:30:43.285310Z", - "shell.execute_reply": "2023-07-31T04:30:43.285044Z" + "iopub.execute_input": "2023-08-06T17:35:29.858346Z", + "iopub.status.busy": "2023-08-06T17:35:29.858233Z", + "iopub.status.idle": "2023-08-06T17:35:29.904185Z", + "shell.execute_reply": "2023-08-06T17:35:29.903909Z" } }, "outputs": [], @@ -923,12 +949,12 @@ " refit=True,\n", " cv=kfold,\n", " scoring='neg_mean_squared_error')\n", - "G = grid.fit(X_train, y_train)" + "G = grid.fit(X_train, y_train)\n" ] }, { "cell_type": "markdown", - "id": "b971e775", + "id": "de0ed389", "metadata": {}, "source": [ "In keeping with the cross-validation results, we use the pruned tree\n", @@ -938,14 +964,15 @@ { "cell_type": "code", "execution_count": 22, - "id": "779a14b6", + "id": "3a635c52", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:43.287027Z", - "iopub.status.busy": "2023-07-31T04:30:43.286940Z", - "iopub.status.idle": "2023-07-31T04:30:43.290148Z", - "shell.execute_reply": "2023-07-31T04:30:43.289861Z" - } + "iopub.execute_input": "2023-08-06T17:35:29.905726Z", + "iopub.status.busy": "2023-08-06T17:35:29.905630Z", + "iopub.status.idle": "2023-08-06T17:35:29.908294Z", + "shell.execute_reply": "2023-08-06T17:35:29.908021Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -961,12 +988,12 @@ ], "source": [ "best_ = grid.best_estimator_\n", - "np.mean((y_test - best_.predict(X_test))**2)" + "np.mean((y_test - best_.predict(X_test))**2)\n" ] }, { "cell_type": "markdown", - "id": "507d174f", + "id": "41a34a36", "metadata": {}, "source": [ "In other words, the test set MSE associated with the regression tree\n", @@ -983,14 +1010,15 @@ { "cell_type": "code", "execution_count": 23, - "id": "2b04030b", + "id": "5542ece6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:43.291793Z", - "iopub.status.busy": "2023-07-31T04:30:43.291674Z", - "iopub.status.idle": "2023-07-31T04:30:43.564079Z", - "shell.execute_reply": "2023-07-31T04:30:43.563765Z" - } + "iopub.execute_input": "2023-08-06T17:35:29.909676Z", + "iopub.status.busy": "2023-08-06T17:35:29.909598Z", + "iopub.status.idle": "2023-08-06T17:35:30.183559Z", + "shell.execute_reply": "2023-08-06T17:35:30.183181Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1008,12 +1036,21 @@ "ax = subplots(figsize=(12,12))[1]\n", "plot_tree(G.best_estimator_,\n", " feature_names=feature_names,\n", - " ax=ax);" + " ax=ax);\n" ] }, { "cell_type": "markdown", - "id": "8e9aba94", + "id": "817eff2c", + "metadata": {}, + "source": [ + " \n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "3e4b98e4", "metadata": {}, "source": [ "## Bagging and Random Forests" @@ -1021,7 +1058,7 @@ }, { "cell_type": "markdown", - "id": "81afb557", + "id": "878b4a89", "metadata": {}, "source": [ "Here we apply bagging and random forests to the `Boston` data, using\n", @@ -1034,14 +1071,15 @@ { "cell_type": "code", "execution_count": 24, - "id": "7dedce31", + "id": "c82eb98b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:43.565753Z", - "iopub.status.busy": "2023-07-31T04:30:43.565635Z", - "iopub.status.idle": "2023-07-31T04:30:43.724357Z", - "shell.execute_reply": "2023-07-31T04:30:43.724077Z" - } + "iopub.execute_input": "2023-08-06T17:35:30.185335Z", + "iopub.status.busy": "2023-08-06T17:35:30.185213Z", + "iopub.status.idle": "2023-08-06T17:35:30.352413Z", + "shell.execute_reply": "2023-08-06T17:35:30.352112Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1060,12 +1098,12 @@ ], "source": [ "bag_boston = RF(max_features=X_train.shape[1], random_state=0)\n", - "bag_boston.fit(X_train, y_train)" + "bag_boston.fit(X_train, y_train)\n" ] }, { "cell_type": "markdown", - "id": "b020aef3", + "id": "06cf548a", "metadata": {}, "source": [ "The argument `max_features` indicates that all 12 predictors should\n", @@ -1077,13 +1115,13 @@ { "cell_type": "code", "execution_count": 25, - "id": "1f2c7336", + "id": "7d592004", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:43.725963Z", - "iopub.status.busy": "2023-07-31T04:30:43.725843Z", - "iopub.status.idle": "2023-07-31T04:30:43.814871Z", - "shell.execute_reply": "2023-07-31T04:30:43.814581Z" + "iopub.execute_input": "2023-08-06T17:35:30.353934Z", + "iopub.status.busy": "2023-08-06T17:35:30.353844Z", + "iopub.status.idle": "2023-08-06T17:35:30.443422Z", + "shell.execute_reply": "2023-08-06T17:35:30.443112Z" } }, "outputs": [ @@ -1112,12 +1150,12 @@ "ax = subplots(figsize=(8,8))[1]\n", "y_hat_bag = bag_boston.predict(X_test)\n", "ax.scatter(y_hat_bag, y_test)\n", - "np.mean((y_test - y_hat_bag)**2)" + "np.mean((y_test - y_hat_bag)**2)\n" ] }, { "cell_type": "markdown", - "id": "6e6db784", + "id": "f38f7522", "metadata": {}, "source": [ "The test set MSE associated with the bagged regression tree is\n", @@ -1130,14 +1168,15 @@ { "cell_type": "code", "execution_count": 26, - "id": "0bba2439", + "id": "892aa556", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:43.816519Z", - "iopub.status.busy": "2023-07-31T04:30:43.816405Z", - "iopub.status.idle": "2023-07-31T04:30:44.608840Z", - "shell.execute_reply": "2023-07-31T04:30:44.608555Z" - } + "iopub.execute_input": "2023-08-06T17:35:30.445151Z", + "iopub.status.busy": "2023-08-06T17:35:30.445025Z", + "iopub.status.idle": "2023-08-06T17:35:31.282001Z", + "shell.execute_reply": "2023-08-06T17:35:31.281728Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1161,7 +1200,7 @@ }, { "cell_type": "markdown", - "id": "7fa447de", + "id": "6c2a8868", "metadata": {}, "source": [ "There is not much change. Bagging and random forests cannot overfit by\n", @@ -1178,14 +1217,15 @@ { "cell_type": "code", "execution_count": 27, - "id": "90457fbe", + "id": "35636d87", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:44.610512Z", - "iopub.status.busy": "2023-07-31T04:30:44.610403Z", - "iopub.status.idle": "2023-07-31T04:30:44.716253Z", - "shell.execute_reply": "2023-07-31T04:30:44.715979Z" - } + "iopub.execute_input": "2023-08-06T17:35:31.283642Z", + "iopub.status.busy": "2023-08-06T17:35:31.283529Z", + "iopub.status.idle": "2023-08-06T17:35:31.394819Z", + "shell.execute_reply": "2023-08-06T17:35:31.394556Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1203,12 +1243,12 @@ "RF_boston = RF(max_features=6,\n", " random_state=0).fit(X_train, y_train)\n", "y_hat_RF = RF_boston.predict(X_test)\n", - "np.mean((y_test - y_hat_RF)**2)" + "np.mean((y_test - y_hat_RF)**2)\n" ] }, { "cell_type": "markdown", - "id": "f9ddb8fa", + "id": "a6edace1", "metadata": {}, "source": [ "The test set MSE is 20.04;\n", @@ -1220,14 +1260,15 @@ { "cell_type": "code", "execution_count": 28, - "id": "8aae1857", + "id": "b5a0869f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:44.717793Z", - "iopub.status.busy": "2023-07-31T04:30:44.717706Z", - "iopub.status.idle": "2023-07-31T04:30:44.723886Z", - "shell.execute_reply": "2023-07-31T04:30:44.723635Z" - } + "iopub.execute_input": "2023-08-06T17:35:31.396329Z", + "iopub.status.busy": "2023-08-06T17:35:31.396243Z", + "iopub.status.idle": "2023-08-06T17:35:31.402359Z", + "shell.execute_reply": "2023-08-06T17:35:31.402086Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1337,7 +1378,7 @@ }, { "cell_type": "markdown", - "id": "74b9ffb6", + "id": "4acf5bdc", "metadata": {}, "source": [ " This\n", @@ -1346,12 +1387,14 @@ "\n", "The results indicate that across all of the trees considered in the\n", "random forest, the wealth level of the community (`lstat`) and the\n", - "house size (`rm`) are by far the two most important variables." + "house size (`rm`) are by far the two most important variables.\n", + "\n", + " " ] }, { "cell_type": "markdown", - "id": "82ed6937", + "id": "9a07b01d", "metadata": {}, "source": [ "## Boosting" @@ -1359,7 +1402,7 @@ }, { "cell_type": "markdown", - "id": "d420075c", + "id": "f2b3dde2", "metadata": {}, "source": [ "Here we use `GradientBoostingRegressor()` from `sklearn.ensemble`\n", @@ -1375,13 +1418,13 @@ { "cell_type": "code", "execution_count": 29, - "id": "887b4fa9", + "id": "844fce26", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:44.725445Z", - "iopub.status.busy": "2023-07-31T04:30:44.725345Z", - "iopub.status.idle": "2023-07-31T04:30:48.357276Z", - "shell.execute_reply": "2023-07-31T04:30:48.357015Z" + "iopub.execute_input": "2023-08-06T17:35:31.403876Z", + "iopub.status.busy": "2023-08-06T17:35:31.403792Z", + "iopub.status.idle": "2023-08-06T17:35:35.087934Z", + "shell.execute_reply": "2023-08-06T17:35:35.087643Z" } }, "outputs": [ @@ -1407,12 +1450,12 @@ " learning_rate=0.001,\n", " max_depth=3,\n", " random_state=0)\n", - "boost_boston.fit(X_train, y_train)" + "boost_boston.fit(X_train, y_train)\n" ] }, { "cell_type": "markdown", - "id": "97019e71", + "id": "15f35667", "metadata": {}, "source": [ "We can see how the training error decreases with the `train_score_` attribute.\n", @@ -1423,13 +1466,13 @@ { "cell_type": "code", "execution_count": 30, - "id": "6c56696c", + "id": "eae8687c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:48.358860Z", - "iopub.status.busy": "2023-07-31T04:30:48.358753Z", - "iopub.status.idle": "2023-07-31T04:30:48.808502Z", - "shell.execute_reply": "2023-07-31T04:30:48.808208Z" + "iopub.execute_input": "2023-08-06T17:35:35.089607Z", + "iopub.status.busy": "2023-08-06T17:35:35.089492Z", + "iopub.status.idle": "2023-08-06T17:35:35.561123Z", + "shell.execute_reply": "2023-08-06T17:35:35.560847Z" } }, "outputs": [ @@ -1459,12 +1502,12 @@ " test_error,\n", " 'r',\n", " label='Test')\n", - "ax.legend();" + "ax.legend();\n" ] }, { "cell_type": "markdown", - "id": "f1a851f2", + "id": "e0499e04", "metadata": {}, "source": [ "We now use the boosted model to predict `medv` on the test set:" @@ -1473,13 +1516,13 @@ { "cell_type": "code", "execution_count": 31, - "id": "8a636f63", + "id": "46947fc6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:48.810244Z", - "iopub.status.busy": "2023-07-31T04:30:48.810139Z", - "iopub.status.idle": "2023-07-31T04:30:48.821958Z", - "shell.execute_reply": "2023-07-31T04:30:48.821612Z" + "iopub.execute_input": "2023-08-06T17:35:35.562826Z", + "iopub.status.busy": "2023-08-06T17:35:35.562711Z", + "iopub.status.idle": "2023-08-06T17:35:35.574783Z", + "shell.execute_reply": "2023-08-06T17:35:35.574501Z" } }, "outputs": [ @@ -1496,12 +1539,12 @@ ], "source": [ "y_hat_boost = boost_boston.predict(X_test);\n", - "np.mean((y_test - y_hat_boost)**2)" + "np.mean((y_test - y_hat_boost)**2)\n" ] }, { "cell_type": "markdown", - "id": "fb7f53af", + "id": "07d3ccd4", "metadata": {}, "source": [ " The test MSE obtained is 14.48,\n", @@ -1514,14 +1557,15 @@ { "cell_type": "code", "execution_count": 32, - "id": "4e2ab3c7", + "id": "f67fdfec", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:48.823909Z", - "iopub.status.busy": "2023-07-31T04:30:48.823807Z", - "iopub.status.idle": "2023-07-31T04:30:51.196994Z", - "shell.execute_reply": "2023-07-31T04:30:51.196708Z" - } + "iopub.execute_input": "2023-08-06T17:35:35.576453Z", + "iopub.status.busy": "2023-08-06T17:35:35.576344Z", + "iopub.status.idle": "2023-08-06T17:35:37.994899Z", + "shell.execute_reply": "2023-08-06T17:35:37.994597Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1543,21 +1587,23 @@ "boost_boston.fit(X_train,\n", " y_train)\n", "y_hat_boost = boost_boston.predict(X_test);\n", - "np.mean((y_test - y_hat_boost)**2)" + "np.mean((y_test - y_hat_boost)**2)\n" ] }, { "cell_type": "markdown", - "id": "9360b5b0", + "id": "f767c57a", "metadata": {}, "source": [ "In this case, using $\\lambda=0.2$ leads to a almost the same test MSE\n", - "as $\\lambda=0.001$." + "as when using $\\lambda=0.001$.\n", + "\n", + " " ] }, { "cell_type": "markdown", - "id": "1693f5da", + "id": "37cf0481", "metadata": {}, "source": [ "## Bayesian Additive Regression Trees" @@ -1565,7 +1611,7 @@ }, { "cell_type": "markdown", - "id": "47c83ab9", + "id": "c3a3419a", "metadata": {}, "source": [ "In this section we demonstrate a `Python` implementation of BART found in the\n", @@ -1578,14 +1624,15 @@ { "cell_type": "code", "execution_count": 33, - "id": "b0b41c04", + "id": "06b92877", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:51.198695Z", - "iopub.status.busy": "2023-07-31T04:30:51.198593Z", - "iopub.status.idle": "2023-07-31T04:30:52.615191Z", - "shell.execute_reply": "2023-07-31T04:30:52.614890Z" - } + "iopub.execute_input": "2023-08-06T17:35:37.996608Z", + "iopub.status.busy": "2023-08-06T17:35:37.996500Z", + "iopub.status.idle": "2023-08-06T17:35:39.436950Z", + "shell.execute_reply": "2023-08-06T17:35:39.436644Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1604,12 +1651,12 @@ ], "source": [ "bart_boston = BART(random_state=0, burnin=5, ndraw=15)\n", - "bart_boston.fit(X_train, y_train)" + "bart_boston.fit(X_train, y_train)\n" ] }, { "cell_type": "markdown", - "id": "af48867c", + "id": "d6d7ad70", "metadata": {}, "source": [ "On this data set, with this split into test and training, we see that the test error of BART is similar to that of random forest." @@ -1618,14 +1665,15 @@ { "cell_type": "code", "execution_count": 34, - "id": "fda8fffc", + "id": "c09cb099", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:52.616789Z", - "iopub.status.busy": "2023-07-31T04:30:52.616675Z", - "iopub.status.idle": "2023-07-31T04:30:52.911570Z", - "shell.execute_reply": "2023-07-31T04:30:52.911292Z" - } + "iopub.execute_input": "2023-08-06T17:35:39.438580Z", + "iopub.status.busy": "2023-08-06T17:35:39.438474Z", + "iopub.status.idle": "2023-08-06T17:35:39.742100Z", + "shell.execute_reply": "2023-08-06T17:35:39.741831Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -1641,12 +1689,12 @@ ], "source": [ "yhat_test = bart_boston.predict(X_test.astype(np.float32))\n", - "np.mean((y_test - yhat_test)**2)" + "np.mean((y_test - yhat_test)**2)\n" ] }, { "cell_type": "markdown", - "id": "bad852b7", + "id": "bb48211a", "metadata": {}, "source": [ "We can check how many times each variable appeared in the collection of trees.\n", @@ -1656,14 +1704,15 @@ { "cell_type": "code", "execution_count": 35, - "id": "be77f0e4", + "id": "f9d6b394", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T04:30:52.913135Z", - "iopub.status.busy": "2023-07-31T04:30:52.913052Z", - "iopub.status.idle": "2023-07-31T04:30:52.915894Z", - "shell.execute_reply": "2023-07-31T04:30:52.915657Z" - } + "iopub.execute_input": "2023-08-06T17:35:39.743981Z", + "iopub.status.busy": "2023-08-06T17:35:39.743858Z", + "iopub.status.idle": "2023-08-06T17:35:39.746694Z", + "shell.execute_reply": "2023-08-06T17:35:39.746443Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1692,20 +1741,26 @@ "source": [ "var_inclusion = pd.Series(bart_boston.variable_inclusion_.mean(0),\n", " index=D.columns)\n", - "var_inclusion" + "var_inclusion\n" + ] + }, + { + "cell_type": "markdown", + "id": "0aac2d50", + "metadata": {}, + "source": [ + " \n", + " \n", + " \n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" - }, - "kernelspec": { - "display_name": "Python3 (islp_freeze_311)", - "language": "python", - "name": "islp_freeze_311" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": { diff --git a/Ch9-svm-lab.ipynb b/Ch9-svm-lab.ipynb index 0f272a8..1bb68a3 100644 --- a/Ch9-svm-lab.ipynb +++ b/Ch9-svm-lab.ipynb @@ -5,7 +5,9 @@ "id": "d45c6d2b", "metadata": {}, "source": [ - "# Chapter 9" + "\n", + "# Chapter 9\n", + "\n" ] }, { @@ -26,18 +28,19 @@ "id": "eeaa5be0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:31.933940Z", - "iopub.status.busy": "2023-07-31T02:15:31.933716Z", - "iopub.status.idle": "2023-07-31T02:15:32.774361Z", - "shell.execute_reply": "2023-07-31T02:15:32.773846Z" - } + "iopub.execute_input": "2023-08-06T17:35:41.109844Z", + "iopub.status.busy": "2023-08-06T17:35:41.109434Z", + "iopub.status.idle": "2023-08-06T17:35:41.992454Z", + "shell.execute_reply": "2023-08-06T17:35:41.991881Z" + }, + "lines_to_next_cell": 0 }, "outputs": [], "source": [ "import numpy as np\n", "from matplotlib.pyplot import subplots, cm\n", "import sklearn.model_selection as skm\n", - "from ISLP import load_data, confusion_table" + "from ISLP import load_data, confusion_table\n" ] }, { @@ -55,17 +58,17 @@ "id": "41a59634", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:32.776623Z", - "iopub.status.busy": "2023-07-31T02:15:32.776343Z", - "iopub.status.idle": "2023-07-31T02:15:32.807761Z", - "shell.execute_reply": "2023-07-31T02:15:32.807471Z" + "iopub.execute_input": "2023-08-06T17:35:41.994815Z", + "iopub.status.busy": "2023-08-06T17:35:41.994482Z", + "iopub.status.idle": "2023-08-06T17:35:42.026716Z", + "shell.execute_reply": "2023-08-06T17:35:42.026409Z" } }, "outputs": [], "source": [ "from sklearn.svm import SVC\n", "from ISLP.svm import plot as plot_svm\n", - "from sklearn.metrics import RocCurveDisplay" + "from sklearn.metrics import RocCurveDisplay\n" ] }, { @@ -83,15 +86,15 @@ "id": "c9a175d7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:32.809461Z", - "iopub.status.busy": "2023-07-31T02:15:32.809366Z", - "iopub.status.idle": "2023-07-31T02:15:32.811185Z", - "shell.execute_reply": "2023-07-31T02:15:32.810941Z" + "iopub.execute_input": "2023-08-06T17:35:42.028394Z", + "iopub.status.busy": "2023-08-06T17:35:42.028303Z", + "iopub.status.idle": "2023-08-06T17:35:42.030112Z", + "shell.execute_reply": "2023-08-06T17:35:42.029879Z" } }, "outputs": [], "source": [ - "roc_curve = RocCurveDisplay.from_estimator # shorthand" + "roc_curve = RocCurveDisplay.from_estimator # shorthand\n" ] }, { @@ -123,11 +126,12 @@ "id": "a7216b47", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:32.812622Z", - "iopub.status.busy": "2023-07-31T02:15:32.812526Z", - "iopub.status.idle": "2023-07-31T02:15:32.919064Z", - "shell.execute_reply": "2023-07-31T02:15:32.918299Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.031508Z", + "iopub.status.busy": "2023-08-06T17:35:42.031412Z", + "iopub.status.idle": "2023-08-06T17:35:42.144107Z", + "shell.execute_reply": "2023-08-06T17:35:42.141512Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -150,7 +154,7 @@ "ax.scatter(X[:,0],\n", " X[:,1],\n", " c=y,\n", - " cmap=cm.coolwarm);" + " cmap=cm.coolwarm);\n" ] }, { @@ -167,11 +171,12 @@ "id": "ed329198", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:32.924346Z", - "iopub.status.busy": "2023-07-31T02:15:32.922626Z", - "iopub.status.idle": "2023-07-31T02:15:32.934623Z", - "shell.execute_reply": "2023-07-31T02:15:32.934041Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.148661Z", + "iopub.status.busy": "2023-08-06T17:35:42.148275Z", + "iopub.status.idle": "2023-08-06T17:35:42.164597Z", + "shell.execute_reply": "2023-08-06T17:35:42.162951Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -190,7 +195,7 @@ ], "source": [ "svm_linear = SVC(C=10, kernel='linear')\n", - "svm_linear.fit(X, y)" + "svm_linear.fit(X, y)\n" ] }, { @@ -210,10 +215,10 @@ "id": "95494b8b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:32.938730Z", - "iopub.status.busy": "2023-07-31T02:15:32.937883Z", - "iopub.status.idle": "2023-07-31T02:15:33.117216Z", - "shell.execute_reply": "2023-07-31T02:15:33.116876Z" + "iopub.execute_input": "2023-08-06T17:35:42.170134Z", + "iopub.status.busy": "2023-08-06T17:35:42.169857Z", + "iopub.status.idle": "2023-08-06T17:35:42.356574Z", + "shell.execute_reply": "2023-08-06T17:35:42.356275Z" } }, "outputs": [ @@ -233,7 +238,7 @@ "plot_svm(X,\n", " y,\n", " svm_linear,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -255,11 +260,12 @@ "id": "98c2236f", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.119014Z", - "iopub.status.busy": "2023-07-31T02:15:33.118891Z", - "iopub.status.idle": "2023-07-31T02:15:33.258092Z", - "shell.execute_reply": "2023-07-31T02:15:33.257817Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.358304Z", + "iopub.status.busy": "2023-08-06T17:35:42.358185Z", + "iopub.status.idle": "2023-08-06T17:35:42.497338Z", + "shell.execute_reply": "2023-08-06T17:35:42.496986Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -280,7 +286,7 @@ "plot_svm(X,\n", " y,\n", " svm_linear_small,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -300,11 +306,12 @@ "id": "b498f594", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.259755Z", - "iopub.status.busy": "2023-07-31T02:15:33.259627Z", - "iopub.status.idle": "2023-07-31T02:15:33.262432Z", - "shell.execute_reply": "2023-07-31T02:15:33.262105Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.499133Z", + "iopub.status.busy": "2023-08-06T17:35:42.499013Z", + "iopub.status.idle": "2023-08-06T17:35:42.501656Z", + "shell.execute_reply": "2023-08-06T17:35:42.501370Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -319,7 +326,7 @@ } ], "source": [ - "svm_linear.coef_" + "svm_linear.coef_\n" ] }, { @@ -337,11 +344,12 @@ "id": "b65e80d6", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.263978Z", - "iopub.status.busy": "2023-07-31T02:15:33.263877Z", - "iopub.status.idle": "2023-07-31T02:15:33.290665Z", - "shell.execute_reply": "2023-07-31T02:15:33.290398Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.503232Z", + "iopub.status.busy": "2023-08-06T17:35:42.503114Z", + "iopub.status.idle": "2023-08-06T17:35:42.530360Z", + "shell.execute_reply": "2023-08-06T17:35:42.530089Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -365,7 +373,7 @@ " cv=kfold,\n", " scoring='accuracy')\n", "grid.fit(X, y)\n", - "grid.best_params_" + "grid.best_params_\n" ] }, { @@ -384,11 +392,12 @@ "id": "bba8fad7", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.292219Z", - "iopub.status.busy": "2023-07-31T02:15:33.292135Z", - "iopub.status.idle": "2023-07-31T02:15:33.294550Z", - "shell.execute_reply": "2023-07-31T02:15:33.294318Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.533039Z", + "iopub.status.busy": "2023-08-06T17:35:42.532868Z", + "iopub.status.idle": "2023-08-06T17:35:42.535494Z", + "shell.execute_reply": "2023-08-06T17:35:42.535174Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -403,7 +412,7 @@ } ], "source": [ - "grid.cv_results_[('mean_test_score')]" + "grid.cv_results_[('mean_test_score')]\n" ] }, { @@ -424,17 +433,17 @@ "id": "ad64269d", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.296023Z", - "iopub.status.busy": "2023-07-31T02:15:33.295928Z", - "iopub.status.idle": "2023-07-31T02:15:33.297787Z", - "shell.execute_reply": "2023-07-31T02:15:33.297542Z" + "iopub.execute_input": "2023-08-06T17:35:42.537255Z", + "iopub.status.busy": "2023-08-06T17:35:42.537133Z", + "iopub.status.idle": "2023-08-06T17:35:42.539335Z", + "shell.execute_reply": "2023-08-06T17:35:42.538987Z" } }, "outputs": [], "source": [ "X_test = rng.standard_normal((20, 2))\n", "y_test = np.array([-1]*10+[1]*10)\n", - "X_test[y_test==1] += 1" + "X_test[y_test==1] += 1\n" ] }, { @@ -453,10 +462,10 @@ "id": "5107fca1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.299207Z", - "iopub.status.busy": "2023-07-31T02:15:33.299107Z", - "iopub.status.idle": "2023-07-31T02:15:33.304700Z", - "shell.execute_reply": "2023-07-31T02:15:33.304434Z" + "iopub.execute_input": "2023-08-06T17:35:42.540795Z", + "iopub.status.busy": "2023-08-06T17:35:42.540697Z", + "iopub.status.idle": "2023-08-06T17:35:42.546310Z", + "shell.execute_reply": "2023-08-06T17:35:42.546056Z" } }, "outputs": [ @@ -520,7 +529,7 @@ "source": [ "best_ = grid.best_estimator_\n", "y_test_hat = best_.predict(X_test)\n", - "confusion_table(y_test_hat, y_test)" + "confusion_table(y_test_hat, y_test)\n" ] }, { @@ -540,10 +549,10 @@ "id": "0320d9e0", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.306170Z", - "iopub.status.busy": "2023-07-31T02:15:33.306087Z", - "iopub.status.idle": "2023-07-31T02:15:33.310352Z", - "shell.execute_reply": "2023-07-31T02:15:33.310107Z" + "iopub.execute_input": "2023-08-06T17:35:42.547949Z", + "iopub.status.busy": "2023-08-06T17:35:42.547859Z", + "iopub.status.idle": "2023-08-06T17:35:42.552481Z", + "shell.execute_reply": "2023-08-06T17:35:42.552209Z" } }, "outputs": [ @@ -608,7 +617,7 @@ "svm_ = SVC(C=0.001,\n", " kernel='linear').fit(X, y)\n", "y_test_hat = svm_.predict(X_test)\n", - "confusion_table(y_test_hat, y_test)" + "confusion_table(y_test_hat, y_test)\n" ] }, { @@ -631,10 +640,10 @@ "id": "84d7e778", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.311857Z", - "iopub.status.busy": "2023-07-31T02:15:33.311774Z", - "iopub.status.idle": "2023-07-31T02:15:33.434376Z", - "shell.execute_reply": "2023-07-31T02:15:33.434084Z" + "iopub.execute_input": "2023-08-06T17:35:42.554007Z", + "iopub.status.busy": "2023-08-06T17:35:42.553921Z", + "iopub.status.idle": "2023-08-06T17:35:42.677356Z", + "shell.execute_reply": "2023-08-06T17:35:42.677072Z" } }, "outputs": [ @@ -652,7 +661,7 @@ "source": [ "X[y==1] += 1.9;\n", "fig, ax = subplots(figsize=(8,8))\n", - "ax.scatter(X[:,0], X[:,1], c=y, cmap=cm.coolwarm);" + "ax.scatter(X[:,0], X[:,1], c=y, cmap=cm.coolwarm);\n" ] }, { @@ -669,10 +678,10 @@ "id": "abb1f8be", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.436068Z", - "iopub.status.busy": "2023-07-31T02:15:33.435948Z", - "iopub.status.idle": "2023-07-31T02:15:33.440665Z", - "shell.execute_reply": "2023-07-31T02:15:33.440404Z" + "iopub.execute_input": "2023-08-06T17:35:42.679000Z", + "iopub.status.busy": "2023-08-06T17:35:42.678886Z", + "iopub.status.idle": "2023-08-06T17:35:42.683759Z", + "shell.execute_reply": "2023-08-06T17:35:42.683448Z" } }, "outputs": [ @@ -736,7 +745,7 @@ "source": [ "svm_ = SVC(C=1e5, kernel='linear').fit(X, y)\n", "y_hat = svm_.predict(X)\n", - "confusion_table(y_hat, y)" + "confusion_table(y_hat, y)\n" ] }, { @@ -747,7 +756,7 @@ "We fit the\n", "support vector classifier and plot the resulting hyperplane, using a\n", "very large value of `C` so that no observations are\n", - "misclassified." + "misclassified. " ] }, { @@ -756,11 +765,12 @@ "id": "2e4ed2f5", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.442227Z", - "iopub.status.busy": "2023-07-31T02:15:33.442140Z", - "iopub.status.idle": "2023-07-31T02:15:33.558482Z", - "shell.execute_reply": "2023-07-31T02:15:33.558203Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.685443Z", + "iopub.status.busy": "2023-08-06T17:35:42.685337Z", + "iopub.status.idle": "2023-08-06T17:35:42.800013Z", + "shell.execute_reply": "2023-08-06T17:35:42.799680Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -779,7 +789,7 @@ "plot_svm(X,\n", " y,\n", " svm_,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -800,10 +810,10 @@ "id": "164a611c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.560147Z", - "iopub.status.busy": "2023-07-31T02:15:33.560028Z", - "iopub.status.idle": "2023-07-31T02:15:33.565003Z", - "shell.execute_reply": "2023-07-31T02:15:33.564720Z" + "iopub.execute_input": "2023-08-06T17:35:42.801762Z", + "iopub.status.busy": "2023-08-06T17:35:42.801639Z", + "iopub.status.idle": "2023-08-06T17:35:42.806674Z", + "shell.execute_reply": "2023-08-06T17:35:42.806389Z" } }, "outputs": [ @@ -867,7 +877,7 @@ "source": [ "svm_ = SVC(C=0.1, kernel='linear').fit(X, y)\n", "y_hat = svm_.predict(X)\n", - "confusion_table(y_hat, y)" + "confusion_table(y_hat, y)\n" ] }, { @@ -887,11 +897,12 @@ "id": "c67591a1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.566489Z", - "iopub.status.busy": "2023-07-31T02:15:33.566402Z", - "iopub.status.idle": "2023-07-31T02:15:33.687614Z", - "shell.execute_reply": "2023-07-31T02:15:33.687292Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.808296Z", + "iopub.status.busy": "2023-08-06T17:35:42.808164Z", + "iopub.status.idle": "2023-08-06T17:35:42.929878Z", + "shell.execute_reply": "2023-08-06T17:35:42.929590Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { @@ -910,7 +921,7 @@ "plot_svm(X,\n", " y,\n", " svm_,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -939,10 +950,10 @@ "id": "322be574", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.689275Z", - "iopub.status.busy": "2023-07-31T02:15:33.689167Z", - "iopub.status.idle": "2023-07-31T02:15:33.691316Z", - "shell.execute_reply": "2023-07-31T02:15:33.690975Z" + "iopub.execute_input": "2023-08-06T17:35:42.931502Z", + "iopub.status.busy": "2023-08-06T17:35:42.931386Z", + "iopub.status.idle": "2023-08-06T17:35:42.933592Z", + "shell.execute_reply": "2023-08-06T17:35:42.933305Z" } }, "outputs": [], @@ -950,7 +961,7 @@ "X = rng.standard_normal((200, 2))\n", "X[:100] += 2\n", "X[100:150] -= 2\n", - "y = np.array([1]*150+[2]*50)" + "y = np.array([1]*150+[2]*50)\n" ] }, { @@ -967,17 +978,18 @@ "id": "04fda182", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.692938Z", - "iopub.status.busy": "2023-07-31T02:15:33.692827Z", - "iopub.status.idle": "2023-07-31T02:15:33.780286Z", - "shell.execute_reply": "2023-07-31T02:15:33.779983Z" - } + "iopub.execute_input": "2023-08-06T17:35:42.935158Z", + "iopub.status.busy": "2023-08-06T17:35:42.935059Z", + "iopub.status.idle": "2023-08-06T17:35:43.022251Z", + "shell.execute_reply": "2023-08-06T17:35:43.021963Z" + }, + "lines_to_next_cell": 2 }, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 20, @@ -1000,7 +1012,7 @@ "ax.scatter(X[:,0],\n", " X[:,1],\n", " c=y,\n", - " cmap=cm.coolwarm)" + " cmap=cm.coolwarm)\n" ] }, { @@ -1019,10 +1031,10 @@ "id": "0c2690d1", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.782021Z", - "iopub.status.busy": "2023-07-31T02:15:33.781908Z", - "iopub.status.idle": "2023-07-31T02:15:33.786110Z", - "shell.execute_reply": "2023-07-31T02:15:33.785823Z" + "iopub.execute_input": "2023-08-06T17:35:43.024031Z", + "iopub.status.busy": "2023-08-06T17:35:43.023910Z", + "iopub.status.idle": "2023-08-06T17:35:43.028070Z", + "shell.execute_reply": "2023-08-06T17:35:43.027774Z" } }, "outputs": [ @@ -1049,7 +1061,7 @@ " test_size=0.5,\n", " random_state=0)\n", "svm_rbf = SVC(kernel=\"rbf\", gamma=1, C=1)\n", - "svm_rbf.fit(X_train, y_train)" + "svm_rbf.fit(X_train, y_train)\n" ] }, { @@ -1058,7 +1070,7 @@ "metadata": {}, "source": [ "The plot shows that the resulting SVM has a decidedly non-linear\n", - "boundary." + "boundary. " ] }, { @@ -1067,10 +1079,10 @@ "id": "3eb171e8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:33.787740Z", - "iopub.status.busy": "2023-07-31T02:15:33.787646Z", - "iopub.status.idle": "2023-07-31T02:15:34.044862Z", - "shell.execute_reply": "2023-07-31T02:15:34.044553Z" + "iopub.execute_input": "2023-08-06T17:35:43.029639Z", + "iopub.status.busy": "2023-08-06T17:35:43.029527Z", + "iopub.status.idle": "2023-08-06T17:35:43.285558Z", + "shell.execute_reply": "2023-08-06T17:35:43.285220Z" } }, "outputs": [ @@ -1090,7 +1102,7 @@ "plot_svm(X_train,\n", " y_train,\n", " svm_rbf,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -1111,10 +1123,10 @@ "id": "9a6b905b", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.046569Z", - "iopub.status.busy": "2023-07-31T02:15:34.046449Z", - "iopub.status.idle": "2023-07-31T02:15:34.197967Z", - "shell.execute_reply": "2023-07-31T02:15:34.197661Z" + "iopub.execute_input": "2023-08-06T17:35:43.287370Z", + "iopub.status.busy": "2023-08-06T17:35:43.287120Z", + "iopub.status.idle": "2023-08-06T17:35:43.439266Z", + "shell.execute_reply": "2023-08-06T17:35:43.438933Z" } }, "outputs": [ @@ -1136,7 +1148,7 @@ "plot_svm(X_train,\n", " y_train,\n", " svm_rbf,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -1155,10 +1167,10 @@ "id": "5ab01d6c", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.199716Z", - "iopub.status.busy": "2023-07-31T02:15:34.199590Z", - "iopub.status.idle": "2023-07-31T02:15:34.297753Z", - "shell.execute_reply": "2023-07-31T02:15:34.297384Z" + "iopub.execute_input": "2023-08-06T17:35:43.440929Z", + "iopub.status.busy": "2023-08-06T17:35:43.440803Z", + "iopub.status.idle": "2023-08-06T17:35:43.533538Z", + "shell.execute_reply": "2023-08-06T17:35:43.533266Z" } }, "outputs": [ @@ -1184,7 +1196,7 @@ " cv=kfold,\n", " scoring='accuracy');\n", "grid.fit(X_train, y_train)\n", - "grid.best_params_" + "grid.best_params_\n" ] }, { @@ -1203,10 +1215,10 @@ "id": "166a6acb", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.299759Z", - "iopub.status.busy": "2023-07-31T02:15:34.299634Z", - "iopub.status.idle": "2023-07-31T02:15:34.531852Z", - "shell.execute_reply": "2023-07-31T02:15:34.531406Z" + "iopub.execute_input": "2023-08-06T17:35:43.535272Z", + "iopub.status.busy": "2023-08-06T17:35:43.535151Z", + "iopub.status.idle": "2023-08-06T17:35:43.767970Z", + "shell.execute_reply": "2023-08-06T17:35:43.767689Z" } }, "outputs": [ @@ -1286,7 +1298,7 @@ " ax=ax)\n", "\n", "y_hat_test = best_svm.predict(X_test)\n", - "confusion_table(y_hat_test, y_test)" + "confusion_table(y_hat_test, y_test)\n" ] }, { @@ -1337,11 +1349,12 @@ "id": "0607fc41", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.533790Z", - "iopub.status.busy": "2023-07-31T02:15:34.533662Z", - "iopub.status.idle": "2023-07-31T02:15:34.622732Z", - "shell.execute_reply": "2023-07-31T02:15:34.622432Z" - } + "iopub.execute_input": "2023-08-06T17:35:43.769863Z", + "iopub.status.busy": "2023-08-06T17:35:43.769754Z", + "iopub.status.idle": "2023-08-06T17:35:43.862697Z", + "shell.execute_reply": "2023-08-06T17:35:43.862378Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1362,7 +1375,7 @@ " y_train,\n", " name='Training',\n", " color='r',\n", - " ax=ax);" + " ax=ax);\n" ] }, { @@ -1381,10 +1394,10 @@ "id": "5211a882", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.624457Z", - "iopub.status.busy": "2023-07-31T02:15:34.624340Z", - "iopub.status.idle": "2023-07-31T02:15:34.760006Z", - "shell.execute_reply": "2023-07-31T02:15:34.759724Z" + "iopub.execute_input": "2023-08-06T17:35:43.864472Z", + "iopub.status.busy": "2023-08-06T17:35:43.864353Z", + "iopub.status.idle": "2023-08-06T17:35:44.004720Z", + "shell.execute_reply": "2023-08-06T17:35:44.004393Z" } }, "outputs": [ @@ -1410,7 +1423,7 @@ " y_train,\n", " name='Training $\\gamma=50$',\n", " color='r',\n", - " ax=ax);" + " ax=ax);\n" ] }, { @@ -1430,10 +1443,10 @@ "id": "12acc4ff", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.761683Z", - "iopub.status.busy": "2023-07-31T02:15:34.761571Z", - "iopub.status.idle": "2023-07-31T02:15:34.765670Z", - "shell.execute_reply": "2023-07-31T02:15:34.765355Z" + "iopub.execute_input": "2023-08-06T17:35:44.006556Z", + "iopub.status.busy": "2023-08-06T17:35:44.006435Z", + "iopub.status.idle": "2023-08-06T17:35:44.010443Z", + "shell.execute_reply": "2023-08-06T17:35:44.010158Z" } }, "outputs": [], @@ -1444,7 +1457,7 @@ " name='Test $\\gamma=50$',\n", " color='b',\n", " ax=ax)\n", - "fig;" + "fig;\n" ] }, { @@ -1461,10 +1474,10 @@ "id": "21c81913", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.767320Z", - "iopub.status.busy": "2023-07-31T02:15:34.767196Z", - "iopub.status.idle": "2023-07-31T02:15:34.862379Z", - "shell.execute_reply": "2023-07-31T02:15:34.862109Z" + "iopub.execute_input": "2023-08-06T17:35:44.012048Z", + "iopub.status.busy": "2023-08-06T17:35:44.011950Z", + "iopub.status.idle": "2023-08-06T17:35:44.108784Z", + "shell.execute_reply": "2023-08-06T17:35:44.108364Z" } }, "outputs": [ @@ -1492,7 +1505,7 @@ " y_,\n", " name=name,\n", " ax=ax,\n", - " color=c)" + " color=c)\n" ] }, { @@ -1516,10 +1529,10 @@ "id": "2fff4fa8", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.864078Z", - "iopub.status.busy": "2023-07-31T02:15:34.863962Z", - "iopub.status.idle": "2023-07-31T02:15:34.950893Z", - "shell.execute_reply": "2023-07-31T02:15:34.950574Z" + "iopub.execute_input": "2023-08-06T17:35:44.110511Z", + "iopub.status.busy": "2023-08-06T17:35:44.110386Z", + "iopub.status.idle": "2023-08-06T17:35:44.198408Z", + "shell.execute_reply": "2023-08-06T17:35:44.198028Z" } }, "outputs": [ @@ -1540,7 +1553,7 @@ "y = np.hstack([y, [0]*50])\n", "X[y==0,1] += 2\n", "fig, ax = subplots(figsize=(8,8))\n", - "ax.scatter(X[:,0], X[:,1], c=y, cmap=cm.coolwarm);" + "ax.scatter(X[:,0], X[:,1], c=y, cmap=cm.coolwarm);\n" ] }, { @@ -1557,11 +1570,12 @@ "id": "5396f2df", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:34.952587Z", - "iopub.status.busy": "2023-07-31T02:15:34.952475Z", - "iopub.status.idle": "2023-07-31T02:15:35.530841Z", - "shell.execute_reply": "2023-07-31T02:15:35.530380Z" - } + "iopub.execute_input": "2023-08-06T17:35:44.200116Z", + "iopub.status.busy": "2023-08-06T17:35:44.200009Z", + "iopub.status.idle": "2023-08-06T17:35:44.778024Z", + "shell.execute_reply": "2023-08-06T17:35:44.777739Z" + }, + "lines_to_next_cell": 0 }, "outputs": [ { @@ -1586,7 +1600,7 @@ " y,\n", " svm_rbf_3,\n", " scatter_cmap=cm.tab10,\n", - " ax=ax)" + " ax=ax)\n" ] }, { @@ -1620,10 +1634,10 @@ "id": "f63c575e", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:35.532698Z", - "iopub.status.busy": "2023-07-31T02:15:35.532574Z", - "iopub.status.idle": "2023-07-31T02:15:35.607009Z", - "shell.execute_reply": "2023-07-31T02:15:35.606701Z" + "iopub.execute_input": "2023-08-06T17:35:44.779762Z", + "iopub.status.busy": "2023-08-06T17:35:44.779640Z", + "iopub.status.idle": "2023-08-06T17:35:44.856770Z", + "shell.execute_reply": "2023-08-06T17:35:44.856276Z" } }, "outputs": [ @@ -1640,7 +1654,7 @@ ], "source": [ "Khan = load_data('Khan')\n", - "Khan['xtrain'].shape, Khan['xtest'].shape" + "Khan['xtrain'].shape, Khan['xtest'].shape\n" ] }, { @@ -1657,7 +1671,7 @@ "large number of features relative to the number of observations. This\n", "suggests that we should use a linear kernel, because the additional\n", "flexibility that will result from using a polynomial or radial kernel \n", - "is unnecessary." + "is unnecessary. " ] }, { @@ -1666,10 +1680,10 @@ "id": "32091338", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:35.608711Z", - "iopub.status.busy": "2023-07-31T02:15:35.608596Z", - "iopub.status.idle": "2023-07-31T02:15:35.637522Z", - "shell.execute_reply": "2023-07-31T02:15:35.637236Z" + "iopub.execute_input": "2023-08-06T17:35:44.858879Z", + "iopub.status.busy": "2023-08-06T17:35:44.858701Z", + "iopub.status.idle": "2023-08-06T17:35:44.889028Z", + "shell.execute_reply": "2023-08-06T17:35:44.888737Z" } }, "outputs": [ @@ -1758,7 +1772,7 @@ "khan_linear = SVC(kernel='linear', C=10)\n", "khan_linear.fit(Khan['xtrain'], Khan['ytrain'])\n", "confusion_table(khan_linear.predict(Khan['xtrain']),\n", - " Khan['ytrain'])" + " Khan['ytrain'])\n" ] }, { @@ -1780,10 +1794,10 @@ "id": "d9058023", "metadata": { "execution": { - "iopub.execute_input": "2023-07-31T02:15:35.639109Z", - "iopub.status.busy": "2023-07-31T02:15:35.639016Z", - "iopub.status.idle": "2023-07-31T02:15:35.649929Z", - "shell.execute_reply": "2023-07-31T02:15:35.649661Z" + "iopub.execute_input": "2023-08-06T17:35:44.891247Z", + "iopub.status.busy": "2023-08-06T17:35:44.891089Z", + "iopub.status.idle": "2023-08-06T17:35:44.902454Z", + "shell.execute_reply": "2023-08-06T17:35:44.902106Z" } }, "outputs": [ @@ -1870,7 +1884,7 @@ ], "source": [ "confusion_table(khan_linear.predict(Khan['xtest']),\n", - " Khan['ytest'])" + " Khan['ytest'])\n" ] }, { @@ -1878,15 +1892,16 @@ "id": "d0d5aba4", "metadata": {}, "source": [ - "We see that using `C=10` yields two test set errors on these data." + "We see that using `C=10` yields two test set errors on these data.\n", + "\n" ] } ], "metadata": { "jupytext": { "cell_metadata_filter": "-all", - "formats": "ipynb,md:myst", - "main_language": "python" + "main_language": "python", + "notebook_metadata_filter": "-all" }, "language_info": { "codemirror_mode": {