From 46ab1f607ec4b9a3461738114cbfe52c6a0fe5e4 Mon Sep 17 00:00:00 2001 From: Faisal N Date: Mon, 12 Aug 2024 00:40:55 -0400 Subject: [PATCH] FINAL --- logistic-regression.ipynb | 298 +++++++++++++++++++------------------- 1 file changed, 149 insertions(+), 149 deletions(-) diff --git a/logistic-regression.ipynb b/logistic-regression.ipynb index 4adfc02..73e03ef 100644 --- a/logistic-regression.ipynb +++ b/logistic-regression.ipynb @@ -3,21 +3,21 @@ { "cell_type": "code", "execution_count": 1, - "id": "339b5c78", + "id": "ce3ec5be", "metadata": { "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19", "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5", "execution": { - "iopub.execute_input": "2024-07-29T15:18:12.071238Z", - "iopub.status.busy": "2024-07-29T15:18:12.070817Z", - "iopub.status.idle": "2024-07-29T15:18:16.029312Z", - "shell.execute_reply": "2024-07-29T15:18:16.028010Z" + "iopub.execute_input": "2024-08-12T04:39:22.114309Z", + "iopub.status.busy": "2024-08-12T04:39:22.113791Z", + "iopub.status.idle": "2024-08-12T04:39:26.425226Z", + "shell.execute_reply": "2024-08-12T04:39:26.423883Z" }, "papermill": { - "duration": 3.966793, - "end_time": "2024-07-29T15:18:16.031944", + "duration": 4.32132, + "end_time": "2024-08-12T04:39:26.428472", "exception": false, - "start_time": "2024-07-29T15:18:12.065151", + "start_time": "2024-08-12T04:39:22.107152", "status": "completed" }, "tags": [] @@ -57,21 +57,21 @@ { "cell_type": "code", "execution_count": 2, - "id": "b7c419a0", + "id": "42f050da", "metadata": { "_kg_hide-input": false, "_kg_hide-output": true, "execution": { - "iopub.execute_input": "2024-07-29T15:18:16.040541Z", - "iopub.status.busy": "2024-07-29T15:18:16.040117Z", - "iopub.status.idle": "2024-07-29T15:18:16.051331Z", - "shell.execute_reply": "2024-07-29T15:18:16.050268Z" + "iopub.execute_input": "2024-08-12T04:39:26.439778Z", + "iopub.status.busy": "2024-08-12T04:39:26.439268Z", + "iopub.status.idle": "2024-08-12T04:39:26.453751Z", + "shell.execute_reply": "2024-08-12T04:39:26.452243Z" }, "papermill": { - "duration": 0.01798, - "end_time": "2024-07-29T15:18:16.053510", + "duration": 0.023376, + "end_time": "2024-08-12T04:39:26.456525", "exception": false, - "start_time": "2024-07-29T15:18:16.035530", + "start_time": "2024-08-12T04:39:26.433149", "status": "completed" }, "tags": [] @@ -173,20 +173,20 @@ { "cell_type": "code", "execution_count": 3, - "id": "1aa8a3ac", + "id": "ca357d42", "metadata": { "_kg_hide-output": true, "execution": { - "iopub.execute_input": "2024-07-29T15:18:16.062786Z", - "iopub.status.busy": "2024-07-29T15:18:16.061961Z", - "iopub.status.idle": "2024-07-29T15:18:16.069656Z", - "shell.execute_reply": "2024-07-29T15:18:16.068449Z" + "iopub.execute_input": "2024-08-12T04:39:26.467330Z", + "iopub.status.busy": "2024-08-12T04:39:26.466886Z", + "iopub.status.idle": "2024-08-12T04:39:26.475504Z", + "shell.execute_reply": "2024-08-12T04:39:26.474419Z" }, "papermill": { - "duration": 0.014739, - "end_time": "2024-07-29T15:18:16.071955", + "duration": 0.016816, + "end_time": "2024-08-12T04:39:26.477915", "exception": false, - "start_time": "2024-07-29T15:18:16.057216", + "start_time": "2024-08-12T04:39:26.461099", "status": "completed" }, "tags": [] @@ -229,19 +229,19 @@ { "cell_type": "code", "execution_count": 4, - "id": "86463a89", + "id": "611a5876", "metadata": { "execution": { - "iopub.execute_input": "2024-07-29T15:18:16.081911Z", - "iopub.status.busy": "2024-07-29T15:18:16.080923Z", - "iopub.status.idle": "2024-07-29T15:18:19.148693Z", - "shell.execute_reply": "2024-07-29T15:18:19.147461Z" + "iopub.execute_input": "2024-08-12T04:39:26.489651Z", + "iopub.status.busy": "2024-08-12T04:39:26.488665Z", + "iopub.status.idle": "2024-08-12T04:39:31.126372Z", + "shell.execute_reply": "2024-08-12T04:39:31.125045Z" }, "papermill": { - "duration": 3.075555, - "end_time": "2024-07-29T15:18:19.151159", + "duration": 4.647058, + "end_time": "2024-08-12T04:39:31.129626", "exception": false, - "start_time": "2024-07-29T15:18:16.075604", + "start_time": "2024-08-12T04:39:26.482568", "status": "completed" }, "tags": [] @@ -424,19 +424,19 @@ { "cell_type": "code", "execution_count": 5, - "id": "7ff85aea", + "id": "26ba8d84", "metadata": { "execution": { - "iopub.execute_input": "2024-07-29T15:18:19.166047Z", - "iopub.status.busy": "2024-07-29T15:18:19.165689Z", - "iopub.status.idle": "2024-07-29T15:18:19.173360Z", - "shell.execute_reply": "2024-07-29T15:18:19.172249Z" + "iopub.execute_input": "2024-08-12T04:39:31.149752Z", + "iopub.status.busy": "2024-08-12T04:39:31.149314Z", + "iopub.status.idle": "2024-08-12T04:39:31.158852Z", + "shell.execute_reply": "2024-08-12T04:39:31.157608Z" }, "papermill": { - "duration": 0.017946, - "end_time": "2024-07-29T15:18:19.175777", + "duration": 0.023808, + "end_time": "2024-08-12T04:39:31.162143", "exception": false, - "start_time": "2024-07-29T15:18:19.157831", + "start_time": "2024-08-12T04:39:31.138335", "status": "completed" }, "tags": [] @@ -504,19 +504,19 @@ { "cell_type": "code", "execution_count": 6, - "id": "09179bc8", + "id": "0beaaa7b", "metadata": { "execution": { - "iopub.execute_input": "2024-07-29T15:18:19.193562Z", - "iopub.status.busy": "2024-07-29T15:18:19.192882Z", - "iopub.status.idle": "2024-07-29T15:19:09.754956Z", - "shell.execute_reply": "2024-07-29T15:19:09.753864Z" + "iopub.execute_input": "2024-08-12T04:39:31.182366Z", + "iopub.status.busy": "2024-08-12T04:39:31.181913Z", + "iopub.status.idle": "2024-08-12T04:40:41.920278Z", + "shell.execute_reply": "2024-08-12T04:40:41.918670Z" }, "papermill": { - "duration": 50.57309, - "end_time": "2024-07-29T15:19:09.757451", + "duration": 70.751624, + "end_time": "2024-08-12T04:40:41.923006", "exception": false, - "start_time": "2024-07-29T15:18:19.184361", + "start_time": "2024-08-12T04:39:31.171382", "status": "completed" }, "tags": [] @@ -533,7 +533,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "db3d5705978349729b5b0c2cb10f6bd6", + "model_id": "121b445da1a14d51a814d0d5a8541ddb", "version_major": 2, "version_minor": 0 }, @@ -641,7 +641,7 @@ " if (show_detailed_output):\n", " print(f\"Train Accuracy: {round(metrics.accuracy_score(y_train, lr.predict(X_train)) * 100, 5)}%\")\n", " print(f\"Train Confusion matrix: {metrics.confusion_matrix(y_train, lr.predict(X_train))}\")\n", - " print(f\"Train Classificiation report: {metrics.confusion_matrix(y_train, lr.predict(X_train))}\")\n", + " print(f\"Train Classificiation report: {metrics.classification_report(y_train, lr.predict(X_train))}\")\n", " print(f\"Test Accuracy: {round(metrics.accuracy_score(y_test, lr.predict(X_test)) * 100, 5)}%\")\n", " print(f\"Test Confusion matrix: {metrics.confusion_matrix(y_test,lr.predict(X_test))}\")\n", " print(f\"Test Classification report: {metrics.classification_report(y_test, lr.predict(X_test))}\")\n", @@ -665,19 +665,19 @@ { "cell_type": "code", "execution_count": 7, - "id": "9094f71a", + "id": "c5bc4d49", "metadata": { "execution": { - "iopub.execute_input": "2024-07-29T15:19:09.773612Z", - "iopub.status.busy": "2024-07-29T15:19:09.773181Z", - "iopub.status.idle": "2024-07-29T15:19:10.610975Z", - "shell.execute_reply": "2024-07-29T15:19:10.609650Z" + "iopub.execute_input": "2024-08-12T04:40:41.943223Z", + "iopub.status.busy": "2024-08-12T04:40:41.942822Z", + "iopub.status.idle": "2024-08-12T04:40:43.092155Z", + "shell.execute_reply": "2024-08-12T04:40:43.090122Z" }, "papermill": { - "duration": 0.848895, - "end_time": "2024-07-29T15:19:10.613513", + "duration": 1.163045, + "end_time": "2024-08-12T04:40:43.095118", "exception": false, - "start_time": "2024-07-29T15:19:09.764618", + "start_time": "2024-08-12T04:40:41.932073", "status": "completed" }, "tags": [] @@ -788,20 +788,42 @@ }, "papermill": { "default_parameters": {}, - "duration": 62.233328, - "end_time": "2024-07-29T15:19:11.345113", + "duration": 85.280797, + "end_time": "2024-08-12T04:40:44.039085", "environment_variables": {}, "exception": null, "input_path": "__notebook__.ipynb", "output_path": "__notebook__.ipynb", "parameters": {}, - "start_time": "2024-07-29T15:18:09.111785", + "start_time": "2024-08-12T04:39:18.758288", "version": "2.5.0" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "065e3ef0af6244fcaaf0f6f11fac9d27": { + "121b445da1a14d51a814d0d5a8541ddb": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_f2b78c9c026d4fe2a9e5780ade6ac019", + "IPY_MODEL_8be9502b256f4d4ca0e1a86409336448", + "IPY_MODEL_c919309b7cbc4bca8c052be894760105" + ], + "layout": "IPY_MODEL_7db9497fd08f44149482d4cc03c9e284" + } + }, + "165272cecc1d420b96e5c6b62798b8c8": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", @@ -853,31 +875,38 @@ "width": null } }, - "19d8210db3954a7f90a335007a026d0a": { + "34c2579741dd43ec94fbcaebe56ae2bd": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", - "model_name": "FloatProgressModel", + "model_name": "ProgressStyleModel", "state": { - "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", - "_model_name": "FloatProgressModel", + "_model_name": "ProgressStyleModel", "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "ProgressView", - "bar_style": "success", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_ef9d98caecba4f3f90dc7e0aa724620a", - "max": 256.0, - "min": 0.0, - "orientation": "horizontal", - "style": "IPY_MODEL_ea93967b47c94e40a1b2bb7d5ded2725", - "value": 256.0 + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" } }, - "5651b30776e84c3db939f265a0b344d5": { + "6b4fc507e2604eb388219144ef7f6747": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "7db9497fd08f44149482d4cc03c9e284": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", @@ -929,7 +958,31 @@ "width": null } }, - "599a257aef1a4b5189a9ea68a57e6378": { + "8be9502b256f4d4ca0e1a86409336448": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_165272cecc1d420b96e5c6b62798b8c8", + "max": 256.0, + "min": 0.0, + "orientation": "horizontal", + "style": "IPY_MODEL_34c2579741dd43ec94fbcaebe56ae2bd", + "value": 256.0 + } + }, + "a38495706db44a4584e522d685499cb2": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", @@ -981,7 +1034,7 @@ "width": null } }, - "ac3429549c534c2dbe9686d9550cac9b": { + "b1b4e92cd1384abd907c1d1bb05944c0": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", @@ -996,7 +1049,7 @@ "description_width": "" } }, - "be7c3c58d27044b58804646c00fd7ae0": { + "c919309b7cbc4bca8c052be894760105": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", @@ -1011,51 +1064,34 @@ "_view_name": "HTMLView", "description": "", "description_tooltip": null, - "layout": "IPY_MODEL_599a257aef1a4b5189a9ea68a57e6378", + "layout": "IPY_MODEL_fe385d4b49ac453f87f36a8ade00cd33", "placeholder": "​", - "style": "IPY_MODEL_f85d3f725c9d42c8a5d4e5a183f8ccb7", - "value": "100%" + "style": "IPY_MODEL_b1b4e92cd1384abd907c1d1bb05944c0", + "value": " 256/256 [01:10<00:00,  3.88it/s]" } }, - "db3d5705978349729b5b0c2cb10f6bd6": { + "f2b78c9c026d4fe2a9e5780ade6ac019": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", - "model_name": "HBoxModel", + "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", - "_model_name": "HBoxModel", + "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", - "_view_name": "HBoxView", - "box_style": "", - "children": [ - "IPY_MODEL_be7c3c58d27044b58804646c00fd7ae0", - "IPY_MODEL_19d8210db3954a7f90a335007a026d0a", - "IPY_MODEL_fc69e71382b34a2bbc06c3fb70d44338" - ], - "layout": "IPY_MODEL_5651b30776e84c3db939f265a0b344d5" - } - }, - "ea93967b47c94e40a1b2bb7d5ded2725": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "ProgressStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "ProgressStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "bar_color": null, - "description_width": "" + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_a38495706db44a4584e522d685499cb2", + "placeholder": "​", + "style": "IPY_MODEL_6b4fc507e2604eb388219144ef7f6747", + "value": "100%" } }, - "ef9d98caecba4f3f90dc7e0aa724620a": { + "fe385d4b49ac453f87f36a8ade00cd33": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", @@ -1106,42 +1142,6 @@ "visibility": null, "width": null } - }, - "f85d3f725c9d42c8a5d4e5a183f8ccb7": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "DescriptionStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "DescriptionStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "1.2.0", - "_view_name": "StyleView", - "description_width": "" - } - }, - "fc69e71382b34a2bbc06c3fb70d44338": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "1.5.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "1.5.0", - "_view_name": "HTMLView", - "description": "", - "description_tooltip": null, - "layout": "IPY_MODEL_065e3ef0af6244fcaaf0f6f11fac9d27", - "placeholder": "​", - "style": "IPY_MODEL_ac3429549c534c2dbe9686d9550cac9b", - "value": " 256/256 [00:50<00:00,  5.09it/s]" - } } }, "version_major": 2,