From a3bd83bb85bcc8069ce67b8baf05ef4bcc0369d3 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 00:43:52 +0100 Subject: [PATCH 01/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index fa192115..a8c7e446 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -49,23 +49,6 @@ "df['Y'] = sample_data.target" ] }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(442, 10)\n" - ] - } - ], - "source": [ - "print(df.shape)" - ] - }, { "cell_type": "code", "execution_count": 11, From c3b6e0a3b8043f8947d00a5be08ab4dee77dae0d Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:24:35 +0100 Subject: [PATCH 02/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 286 +----------------- 1 file changed, 3 insertions(+), 283 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index a8c7e446..49cd4061 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -1,19 +1,3 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Train a Ridge Regression Model on the Diabetes Dataset" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This notebook loads the Diabetes dataset from sklearn, splits the data into training and validation sets, trains a Ridge regression model, validates the model on the validation set, and saves the model." - ] - }, { "cell_type": "code", "execution_count": 1, @@ -28,13 +12,6 @@ "import pandas as pd" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load Data" - ] - }, { "cell_type": "code", "execution_count": 6, @@ -49,211 +26,6 @@ "df['Y'] = sample_data.target" ] }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
agesexbmibps1s2s3s4s5s6Y
count4.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+02442.000000
mean-3.634285e-161.308343e-16-8.045349e-161.281655e-16-8.835316e-171.327024e-16-4.574646e-163.777301e-16-3.830854e-16-3.412882e-16152.133484
std4.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-0277.093005
min-1.072256e-01-4.464164e-02-9.027530e-02-1.123996e-01-1.267807e-01-1.156131e-01-1.023071e-01-7.639450e-02-1.260974e-01-1.377672e-0125.000000
25%-3.729927e-02-4.464164e-02-3.422907e-02-3.665645e-02-3.424784e-02-3.035840e-02-3.511716e-02-3.949338e-02-3.324879e-02-3.317903e-0287.000000
50%5.383060e-03-4.464164e-02-7.283766e-03-5.670611e-03-4.320866e-03-3.819065e-03-6.584468e-03-2.592262e-03-1.947634e-03-1.077698e-03140.500000
75%3.807591e-025.068012e-023.124802e-023.564384e-022.835801e-022.984439e-022.931150e-023.430886e-023.243323e-022.791705e-02211.500000
max1.107267e-015.068012e-021.705552e-011.320442e-011.539137e-011.987880e-011.811791e-011.852344e-011.335990e-011.356118e-01346.000000
\n", - "
" - ], - "text/plain": [ - " age sex bmi bp s1 \\\n", - "count 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 \n", - "mean -3.634285e-16 1.308343e-16 -8.045349e-16 1.281655e-16 -8.835316e-17 \n", - "std 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 \n", - "min -1.072256e-01 -4.464164e-02 -9.027530e-02 -1.123996e-01 -1.267807e-01 \n", - "25% -3.729927e-02 -4.464164e-02 -3.422907e-02 -3.665645e-02 -3.424784e-02 \n", - "50% 5.383060e-03 -4.464164e-02 -7.283766e-03 -5.670611e-03 -4.320866e-03 \n", - "75% 3.807591e-02 5.068012e-02 3.124802e-02 3.564384e-02 2.835801e-02 \n", - "max 1.107267e-01 5.068012e-02 1.705552e-01 1.320442e-01 1.539137e-01 \n", - "\n", - " s2 s3 s4 s5 s6 \\\n", - "count 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 \n", - "mean 1.327024e-16 -4.574646e-16 3.777301e-16 -3.830854e-16 -3.412882e-16 \n", - "std 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 \n", - "min -1.156131e-01 -1.023071e-01 -7.639450e-02 -1.260974e-01 -1.377672e-01 \n", - "25% -3.035840e-02 -3.511716e-02 -3.949338e-02 -3.324879e-02 -3.317903e-02 \n", - "50% -3.819065e-03 -6.584468e-03 -2.592262e-03 -1.947634e-03 -1.077698e-03 \n", - "75% 2.984439e-02 2.931150e-02 3.430886e-02 3.243323e-02 2.791705e-02 \n", - "max 1.987880e-01 1.811791e-01 1.852344e-01 1.335990e-01 1.356118e-01 \n", - "\n", - " Y \n", - "count 442.000000 \n", - "mean 152.133484 \n", - "std 77.093005 \n", - "min 25.000000 \n", - "25% 87.000000 \n", - "50% 140.500000 \n", - "75% 211.500000 \n", - "max 346.000000 " - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# All data in a single dataframe\n", - "df.describe()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Split Data into Training and Validation Sets" - ] - }, { "cell_type": "code", "execution_count": 12, @@ -269,30 +41,11 @@ " \"test\": {\"X\": X_test, \"y\": y_test}}" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train Model on Training Set" - ] - }, { "cell_type": "code", "execution_count": 16, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "Ridge(alpha=0.5, copy_X=True, fit_intercept=True, max_iter=None,\n", - " normalize=False, random_state=None, solver='auto', tol=0.001)" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# experiment parameters\n", "args = {\n", @@ -303,26 +56,11 @@ "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Validate Model on Validation Set" - ] - }, { "cell_type": "code", "execution_count": 18, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'mse': 3298.9096058070622}\n" - ] - } - ], + "outputs": [], "source": [ "preds = reg_model.predict(data[\"test\"][\"X\"])\n", "mse = mean_squared_error(preds, y_test)\n", @@ -330,29 +68,11 @@ "print(metrics)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Save Model" - ] - }, { "cell_type": "code", "execution_count": 7, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['sklearn_regression_model.pkl']" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "model_name = \"sklearn_regression_model.pkl\"\n", "\n", From f2ff0b6baa98b5d4d1733f164fc5e1e0801eb303 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:29:18 +0100 Subject: [PATCH 03/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 49cd4061..25bbfb7e 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -68,37 +68,4 @@ "print(metrics)" ] }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "model_name = \"sklearn_regression_model.pkl\"\n", - "\n", - "joblib.dump(value=reg, filename=model_name)" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.4" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} + From 465393cf3fe70206609a75cd4acd78415ae4fe67 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:29:52 +0100 Subject: [PATCH 04/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 25bbfb7e..cf986d2a 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -67,5 +67,5 @@ "metrics = {\"mse\": mse}\n", "print(metrics)" ] - }, + } From 304587e6350b8f368602958e7ce6d81196c8c91d Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:38:48 +0100 Subject: [PATCH 05/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index cf986d2a..6f7891ca 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -1,4 +1,20 @@ +{ + "cells": [ { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Train a Ridge Regression Model on the Diabetes Dataset" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook loads the Diabetes dataset from sklearn, splits the data into training and validation sets, trains a Ridge regression model, validates the model on the validation set, and saves the model." + ] +}, +{ "cell_type": "code", "execution_count": 1, "metadata": {}, From 7e07ff57e1cf16a0391b64ded07956944589bfc4 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:42:44 +0100 Subject: [PATCH 06/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 324 +++++++++++++++++- 1 file changed, 319 insertions(+), 5 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 6f7891ca..fa192115 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -13,8 +13,8 @@ "source": [ "This notebook loads the Diabetes dataset from sklearn, splits the data into training and validation sets, trains a Ridge regression model, validates the model on the validation set, and saves the model." ] -}, -{ + }, + { "cell_type": "code", "execution_count": 1, "metadata": {}, @@ -28,6 +28,13 @@ "import pandas as pd" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Load Data" + ] + }, { "cell_type": "code", "execution_count": 6, @@ -42,6 +49,228 @@ "df['Y'] = sample_data.target" ] }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(442, 10)\n" + ] + } + ], + "source": [ + "print(df.shape)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
agesexbmibps1s2s3s4s5s6Y
count4.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+02442.000000
mean-3.634285e-161.308343e-16-8.045349e-161.281655e-16-8.835316e-171.327024e-16-4.574646e-163.777301e-16-3.830854e-16-3.412882e-16152.133484
std4.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-0277.093005
min-1.072256e-01-4.464164e-02-9.027530e-02-1.123996e-01-1.267807e-01-1.156131e-01-1.023071e-01-7.639450e-02-1.260974e-01-1.377672e-0125.000000
25%-3.729927e-02-4.464164e-02-3.422907e-02-3.665645e-02-3.424784e-02-3.035840e-02-3.511716e-02-3.949338e-02-3.324879e-02-3.317903e-0287.000000
50%5.383060e-03-4.464164e-02-7.283766e-03-5.670611e-03-4.320866e-03-3.819065e-03-6.584468e-03-2.592262e-03-1.947634e-03-1.077698e-03140.500000
75%3.807591e-025.068012e-023.124802e-023.564384e-022.835801e-022.984439e-022.931150e-023.430886e-023.243323e-022.791705e-02211.500000
max1.107267e-015.068012e-021.705552e-011.320442e-011.539137e-011.987880e-011.811791e-011.852344e-011.335990e-011.356118e-01346.000000
\n", + "
" + ], + "text/plain": [ + " age sex bmi bp s1 \\\n", + "count 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 \n", + "mean -3.634285e-16 1.308343e-16 -8.045349e-16 1.281655e-16 -8.835316e-17 \n", + "std 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 \n", + "min -1.072256e-01 -4.464164e-02 -9.027530e-02 -1.123996e-01 -1.267807e-01 \n", + "25% -3.729927e-02 -4.464164e-02 -3.422907e-02 -3.665645e-02 -3.424784e-02 \n", + "50% 5.383060e-03 -4.464164e-02 -7.283766e-03 -5.670611e-03 -4.320866e-03 \n", + "75% 3.807591e-02 5.068012e-02 3.124802e-02 3.564384e-02 2.835801e-02 \n", + "max 1.107267e-01 5.068012e-02 1.705552e-01 1.320442e-01 1.539137e-01 \n", + "\n", + " s2 s3 s4 s5 s6 \\\n", + "count 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 \n", + "mean 1.327024e-16 -4.574646e-16 3.777301e-16 -3.830854e-16 -3.412882e-16 \n", + "std 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 \n", + "min -1.156131e-01 -1.023071e-01 -7.639450e-02 -1.260974e-01 -1.377672e-01 \n", + "25% -3.035840e-02 -3.511716e-02 -3.949338e-02 -3.324879e-02 -3.317903e-02 \n", + "50% -3.819065e-03 -6.584468e-03 -2.592262e-03 -1.947634e-03 -1.077698e-03 \n", + "75% 2.984439e-02 2.931150e-02 3.430886e-02 3.243323e-02 2.791705e-02 \n", + "max 1.987880e-01 1.811791e-01 1.852344e-01 1.335990e-01 1.356118e-01 \n", + "\n", + " Y \n", + "count 442.000000 \n", + "mean 152.133484 \n", + "std 77.093005 \n", + "min 25.000000 \n", + "25% 87.000000 \n", + "50% 140.500000 \n", + "75% 211.500000 \n", + "max 346.000000 " + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# All data in a single dataframe\n", + "df.describe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Split Data into Training and Validation Sets" + ] + }, { "cell_type": "code", "execution_count": 12, @@ -57,11 +286,30 @@ " \"test\": {\"X\": X_test, \"y\": y_test}}" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train Model on Training Set" + ] + }, { "cell_type": "code", "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "Ridge(alpha=0.5, copy_X=True, fit_intercept=True, max_iter=None,\n", + " normalize=False, random_state=None, solver='auto', tol=0.001)" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "# experiment parameters\n", "args = {\n", @@ -72,16 +320,82 @@ "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Validate Model on Validation Set" + ] + }, { "cell_type": "code", "execution_count": 18, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'mse': 3298.9096058070622}\n" + ] + } + ], "source": [ "preds = reg_model.predict(data[\"test\"][\"X\"])\n", "mse = mean_squared_error(preds, y_test)\n", "metrics = {\"mse\": mse}\n", "print(metrics)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Save Model" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['sklearn_regression_model.pkl']" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model_name = \"sklearn_regression_model.pkl\"\n", + "\n", + "joblib.dump(value=reg, filename=model_name)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.4" } - + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 380d272db475f57cfc5358b668a1034a12097c7d Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:46:38 +0100 Subject: [PATCH 07/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index fa192115..a8c7e446 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -49,23 +49,6 @@ "df['Y'] = sample_data.target" ] }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(442, 10)\n" - ] - } - ], - "source": [ - "print(df.shape)" - ] - }, { "cell_type": "code", "execution_count": 11, From f3aec3c0f3be65cdf796448e432ad08e7eb2ebe1 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 01:51:19 +0100 Subject: [PATCH 08/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 198 ------------------ 1 file changed, 198 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index a8c7e446..b95b2e54 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -49,204 +49,6 @@ "df['Y'] = sample_data.target" ] }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
agesexbmibps1s2s3s4s5s6Y
count4.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+024.420000e+02442.000000
mean-3.634285e-161.308343e-16-8.045349e-161.281655e-16-8.835316e-171.327024e-16-4.574646e-163.777301e-16-3.830854e-16-3.412882e-16152.133484
std4.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-024.761905e-0277.093005
min-1.072256e-01-4.464164e-02-9.027530e-02-1.123996e-01-1.267807e-01-1.156131e-01-1.023071e-01-7.639450e-02-1.260974e-01-1.377672e-0125.000000
25%-3.729927e-02-4.464164e-02-3.422907e-02-3.665645e-02-3.424784e-02-3.035840e-02-3.511716e-02-3.949338e-02-3.324879e-02-3.317903e-0287.000000
50%5.383060e-03-4.464164e-02-7.283766e-03-5.670611e-03-4.320866e-03-3.819065e-03-6.584468e-03-2.592262e-03-1.947634e-03-1.077698e-03140.500000
75%3.807591e-025.068012e-023.124802e-023.564384e-022.835801e-022.984439e-022.931150e-023.430886e-023.243323e-022.791705e-02211.500000
max1.107267e-015.068012e-021.705552e-011.320442e-011.539137e-011.987880e-011.811791e-011.852344e-011.335990e-011.356118e-01346.000000
\n", - "
" - ], - "text/plain": [ - " age sex bmi bp s1 \\\n", - "count 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 \n", - "mean -3.634285e-16 1.308343e-16 -8.045349e-16 1.281655e-16 -8.835316e-17 \n", - "std 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 \n", - "min -1.072256e-01 -4.464164e-02 -9.027530e-02 -1.123996e-01 -1.267807e-01 \n", - "25% -3.729927e-02 -4.464164e-02 -3.422907e-02 -3.665645e-02 -3.424784e-02 \n", - "50% 5.383060e-03 -4.464164e-02 -7.283766e-03 -5.670611e-03 -4.320866e-03 \n", - "75% 3.807591e-02 5.068012e-02 3.124802e-02 3.564384e-02 2.835801e-02 \n", - "max 1.107267e-01 5.068012e-02 1.705552e-01 1.320442e-01 1.539137e-01 \n", - "\n", - " s2 s3 s4 s5 s6 \\\n", - "count 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 4.420000e+02 \n", - "mean 1.327024e-16 -4.574646e-16 3.777301e-16 -3.830854e-16 -3.412882e-16 \n", - "std 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 4.761905e-02 \n", - "min -1.156131e-01 -1.023071e-01 -7.639450e-02 -1.260974e-01 -1.377672e-01 \n", - "25% -3.035840e-02 -3.511716e-02 -3.949338e-02 -3.324879e-02 -3.317903e-02 \n", - "50% -3.819065e-03 -6.584468e-03 -2.592262e-03 -1.947634e-03 -1.077698e-03 \n", - "75% 2.984439e-02 2.931150e-02 3.430886e-02 3.243323e-02 2.791705e-02 \n", - "max 1.987880e-01 1.811791e-01 1.852344e-01 1.335990e-01 1.356118e-01 \n", - "\n", - " Y \n", - "count 442.000000 \n", - "mean 152.133484 \n", - "std 77.093005 \n", - "min 25.000000 \n", - "25% 87.000000 \n", - "50% 140.500000 \n", - "75% 211.500000 \n", - "max 346.000000 " - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# All data in a single dataframe\n", - "df.describe()" - ] - }, { "cell_type": "markdown", "metadata": {}, From 77c01c2b37c50e290ca02a20b4401e7cf1c284d6 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:05:06 +0100 Subject: [PATCH 09/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index b95b2e54..2caab73f 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -62,6 +62,7 @@ "metadata": {}, "outputs": [], "source": [ + "def split_data(df):" "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", @@ -69,6 +70,7 @@ " X, y, test_size=0.2, random_state=0)\n", "data = {\"train\": {\"X\": X_train, \"y\": y_train},\n", " \"test\": {\"X\": X_test, \"y\": y_test}}" + "return data" ] }, { From 82209b807e90876d5ee3cd204187ad29d2387102 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:07:12 +0100 Subject: [PATCH 10/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 1 - 1 file changed, 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 2caab73f..db4f12ff 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -70,7 +70,6 @@ " X, y, test_size=0.2, random_state=0)\n", "data = {\"train\": {\"X\": X_train, \"y\": y_train},\n", " \"test\": {\"X\": X_test, \"y\": y_test}}" - "return data" ] }, { From f0f7d8dac6eb8d2439a10e433de7071422453e0b Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:08:08 +0100 Subject: [PATCH 11/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index db4f12ff..4d5eee54 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -62,7 +62,6 @@ "metadata": {}, "outputs": [], "source": [ - "def split_data(df):" "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", @@ -96,7 +95,7 @@ "output_type": "execute_result" } ], - "source": [ + "source": [ "# experiment parameters\n", "args = {\n", " \"alpha\": 0.5\n", From f7c5a8315d021cdc1605f87a56292a84274ab559 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:25:32 +0100 Subject: [PATCH 12/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 4d5eee54..897d69fb 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -56,6 +56,21 @@ "## Split Data into Training and Validation Sets" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Split Data into Training and Validation Sets" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": ["def = split_data(df):" + ] + }, { "cell_type": "code", "execution_count": 12, From 6affa5bc6add28de85d65f516d5f0298f0dad23b Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:29:39 +0100 Subject: [PATCH 13/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 897d69fb..e41dabfc 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -56,13 +56,6 @@ "## Split Data into Training and Validation Sets" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Split Data into Training and Validation Sets" - ] - }, { "cell_type": "code", "execution_count": 10, From 553b6eea153c5c64d1251281dac6a4199fc43d22 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:34:50 +0100 Subject: [PATCH 14/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index e41dabfc..f9c2d20e 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -53,7 +53,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Split Data into Training and Validation Sets" + "## Split the dataframe into test and train data" ] }, { From 9bee5a799b73c94aa65e8cc9654463b829b28421 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:36:45 +0100 Subject: [PATCH 15/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index f9c2d20e..746e1f8e 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -66,7 +66,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ From a793e9bf84e46c5eccff94be6ff0db9e20ec0793 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 02:56:47 +0100 Subject: [PATCH 16/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 746e1f8e..65c880e7 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -60,16 +60,9 @@ "cell_type": "code", "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": ["return data" + ], "source": ["def = split_data(df):" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", From 7ddc60fe99a9b7477a16846c4f8cfe93bc703777 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:06:01 +0100 Subject: [PATCH 17/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 65c880e7..4f219500 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -60,8 +60,7 @@ "cell_type": "code", "execution_count": 10, "metadata": {}, - "outputs": ["return data" - ], + "outputs": [], "source": ["def = split_data(df):" "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", From 9945fae7d76b33b4f15c558c7e8bd3c27f203efb Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:12:07 +0100 Subject: [PATCH 18/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 4f219500..b25a3d16 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -62,6 +62,16 @@ "metadata": {}, "outputs": [], "source": ["def = split_data(df):" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": ["def = split_data(df):" + ] + }, "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", From 79ae7f556852656ec862b301fcc30c16d605a40c Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:15:56 +0100 Subject: [PATCH 19/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index b25a3d16..6df1a01d 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -70,8 +70,7 @@ "metadata": {}, "outputs": [], "source": ["def = split_data(df):" - ] - }, + ], "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", From 2b98bb33bd25fd6db33a66573338e95ed1f5730e Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:22:26 +0100 Subject: [PATCH 20/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 1 - 1 file changed, 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 6df1a01d..03a36a48 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -70,7 +70,6 @@ "metadata": {}, "outputs": [], "source": ["def = split_data(df):" - ], "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", From 7b2e7f047ff9f7c8006903b30e2d9700c06e2500 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:29:50 +0100 Subject: [PATCH 21/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 03a36a48..bc258fe4 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -61,7 +61,8 @@ "execution_count": 10, "metadata": {}, "outputs": [], - "source": ["def = split_data(df):" + "source": [ + "def = split_data(df):" ] }, { @@ -69,7 +70,8 @@ "execution_count": 10, "metadata": {}, "outputs": [], - "source": ["def = split_data(df):" + "source": [ + "def = split_data(df):", "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", From c8ce23270763032dda78b9134f6fcbed5bf7cea5 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:33:59 +0100 Subject: [PATCH 22/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index bc258fe4..a4ad3767 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -71,7 +71,7 @@ "metadata": {}, "outputs": [], "source": [ - "def = split_data(df):", + "def = split_data(df):\n", "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", "\n", From 3f6a416dd2a53ad0b8c4ed853464c59247409414 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:56:52 +0100 Subject: [PATCH 23/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index a4ad3767..7fbce6ee 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -53,7 +53,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Split the dataframe into test and train data" + "## Split Data into Training and Validation Sets" ] }, { @@ -65,6 +65,13 @@ "def = split_data(df):" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Split the dataframe into test and train data" + ] + }, { "cell_type": "code", "execution_count": 10, From 4c872408fc611d3f9b07c2bf8e157aa0915256bf Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 04:02:17 +0100 Subject: [PATCH 24/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 7fbce6ee..f365c477 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -85,7 +85,8 @@ "X_train, X_test, y_train, y_test = train_test_split(\n", " X, y, test_size=0.2, random_state=0)\n", "data = {\"train\": {\"X\": X_train, \"y\": y_train},\n", - " \"test\": {\"X\": X_test, \"y\": y_test}}" + " \"test\": {\"X\": X_test, \"y\": y_test}}\n", + " return data" ] }, { From f1a60763d394f98d9627d09f2c3e43a0907993f1 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 04:14:30 +0100 Subject: [PATCH 25/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index f365c477..d100ad3d 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -89,6 +89,23 @@ " return data" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Train the model, return the model" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "def train_model(data, args):\n", + "reg_model = Ridge(**args)\n", + "reg_model.fit(data["train"]["X"], data["train"]["y"])\n", + " return reg_model" { "cell_type": "markdown", "metadata": {}, From 97b419b0d0102cf650f836453473911c60bc2001 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 04:34:52 +0100 Subject: [PATCH 26/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index d100ad3d..3938e0a5 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -104,7 +104,7 @@ "source": [ "def train_model(data, args):\n", "reg_model = Ridge(**args)\n", - "reg_model.fit(data["train"]["X"], data["train"]["y"])\n", + "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])\n", " return reg_model" { "cell_type": "markdown", From 028831b057b5a20a144071a097a8375f7513573e Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 04:37:23 +0100 Subject: [PATCH 27/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 3938e0a5..52d9e487 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -106,6 +106,8 @@ "reg_model = Ridge(**args)\n", "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])\n", " return reg_model" + ] + }, { "cell_type": "markdown", "metadata": {}, From 6c05f9cd6dbe90191bdce770dcda992a7588de79 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 04:57:20 +0100 Subject: [PATCH 28/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 52d9e487..866b9d39 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -149,6 +149,21 @@ "## Validate Model on Validation Set" ] }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [], + "source": [ + "def = get_model_metrics(reg_model, data):" + ] + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Evaluate the metrics for the model" + ] + }, { "cell_type": "code", "execution_count": 18, @@ -163,10 +178,11 @@ } ], "source": [ + "def = get_model_metrics(reg_model, data):\n" "preds = reg_model.predict(data[\"test\"][\"X\"])\n", "mse = mean_squared_error(preds, y_test)\n", "metrics = {\"mse\": mse}\n", - "print(metrics)" + " return metrics" ] }, { From 74958ed26a1fc6dbdf9319dcd7a95547c51b4614 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:12:10 +0100 Subject: [PATCH 29/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 866b9d39..661bfde1 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -157,6 +157,7 @@ "source": [ "def = get_model_metrics(reg_model, data):" ] + }, { "cell_type": "markdown", "metadata": {}, From e04c7a372c9d57ee6030cfb6bdabc252e4222823 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:16:14 +0100 Subject: [PATCH 30/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 661bfde1..7d40ec37 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -164,7 +164,7 @@ "source": [ "## Evaluate the metrics for the model" ] - }, + } { "cell_type": "code", "execution_count": 18, From 777bb9e294d255c36906aac9411167f33bc0e241 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:20:06 +0100 Subject: [PATCH 31/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 7d40ec37..05554a8a 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -151,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ From e2f21cae12eeba19fb195c1b3a1ced7a16285773 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:21:51 +0100 Subject: [PATCH 32/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 05554a8a..d9c2cf64 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -151,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -179,7 +179,7 @@ } ], "source": [ - "def = get_model_metrics(reg_model, data):\n" + "def = get_model_metrics(reg_model, data):\n", "preds = reg_model.predict(data[\"test\"][\"X\"])\n", "mse = mean_squared_error(preds, y_test)\n", "metrics = {\"mse\": mse}\n", From 88275f315b1e5e03b901c660a39e9bb9cf6eb081 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:24:46 +0100 Subject: [PATCH 33/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index d9c2cf64..e1bf6f6e 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -164,7 +164,7 @@ "source": [ "## Evaluate the metrics for the model" ] - } + }, { "cell_type": "code", "execution_count": 18, From 96722295d68de13189a1f5acff324faed2f2cd4c Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:26:33 +0100 Subject: [PATCH 34/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index e1bf6f6e..7e73647e 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -58,7 +58,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ From c2f5ed1a78a17c7f365a97dcbd43457c33e2b476 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:34:01 +0100 Subject: [PATCH 35/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 7e73647e..95409974 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -28,6 +28,23 @@ "import pandas as pd" ] }, + + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Main Program" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "def = main():" + ] + }, { "cell_type": "markdown", "metadata": {}, From 10854e6c5391d3ac83d7f47c5c48d51860e38345 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:40:40 +0100 Subject: [PATCH 36/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 95409974..a151ed97 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -42,7 +42,13 @@ "metadata": {}, "outputs": [], "source": [ - "def = main():" + "def = main():", + "sample_data = load_diabetes()\n", + "\n", + "df = pd.DataFrame(\n", + " data=sample_data.data,\n", + " columns=sample_data.feature_names)\n", + "df['Y'] = sample_data.target" ] }, { From 50926f0d8328dfccd33953b37eef041eea25986f Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:43:23 +0100 Subject: [PATCH 37/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index a151ed97..c18d9c6e 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -51,28 +51,7 @@ "df['Y'] = sample_data.target" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Load Data" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, - "outputs": [], - "source": [ - "sample_data = load_diabetes()\n", - "\n", - "df = pd.DataFrame(\n", - " data=sample_data.data,\n", - " columns=sample_data.feature_names)\n", - "df['Y'] = sample_data.target" - ] - }, - { + { "cell_type": "markdown", "metadata": {}, "source": [ From 97fdfeb6fc0a84edcd8f928b649eef0d74563da1 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:46:18 +0100 Subject: [PATCH 38/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index c18d9c6e..e36f86ce 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -43,6 +43,7 @@ "outputs": [], "source": [ "def = main():", + "# Load data\n", "sample_data = load_diabetes()\n", "\n", "df = pd.DataFrame(\n", From baa6f589976d5ce4c2be25679930b3d3b04c6e9a Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 05:58:43 +0100 Subject: [PATCH 39/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index e36f86ce..c9fe5ce3 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -42,14 +42,17 @@ "metadata": {}, "outputs": [], "source": [ - "def = main():", + "def = main():\n", "# Load data\n", "sample_data = load_diabetes()\n", "\n", "df = pd.DataFrame(\n", " data=sample_data.data,\n", " columns=sample_data.feature_names)\n", - "df['Y'] = sample_data.target" + "df['Y'] = sample_data.target\n" + "\n" + "## Split Data into Training and Validation Sets\n" + " def = split_data(df):" ] }, { From 79755585a0f0769fd779ac52f0e4b04cdb78ba43 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:01:13 +0100 Subject: [PATCH 40/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index c9fe5ce3..412d34cc 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -49,9 +49,9 @@ "df = pd.DataFrame(\n", " data=sample_data.data,\n", " columns=sample_data.feature_names)\n", - "df['Y'] = sample_data.target\n" - "\n" - "## Split Data into Training and Validation Sets\n" + "df['Y'] = sample_data.target\n", + "\n", + "## Split Data into Training and Validation Sets\n", " def = split_data(df):" ] }, From dfc0313866a4fab444ebbb18e64aa1604b57e141 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:07:01 +0100 Subject: [PATCH 41/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 412d34cc..54133237 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -52,7 +52,14 @@ "df['Y'] = sample_data.target\n", "\n", "## Split Data into Training and Validation Sets\n", - " def = split_data(df):" + " def = split_data(df):\n" + "\n" + "# experiment parameters\n", + "args = {\n", + " \"alpha\": 0.5\n", + "}\n", + "\n", + "reg_model = Ridge(**args)", ] }, { From f373bfad9f4e001c595fb160d3e71e5bdf8b73e0 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:11:51 +0100 Subject: [PATCH 42/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 54133237..e4a15cea 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -51,10 +51,10 @@ " columns=sample_data.feature_names)\n", "df['Y'] = sample_data.target\n", "\n", - "## Split Data into Training and Validation Sets\n", - " def = split_data(df):\n" - "\n" - "# experiment parameters\n", + "# Split Data into Training and Validation Sets\n", + " def = split_data(df):\n", + "\n", + "# Train Model on Training Set\n", "args = {\n", " \"alpha\": 0.5\n", "}\n", From 18fe5d16c5302f80f1f28bab61d9d80d30553787 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:14:23 +0100 Subject: [PATCH 43/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index e4a15cea..3a6f3e8b 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -59,7 +59,7 @@ " \"alpha\": 0.5\n", "}\n", "\n", - "reg_model = Ridge(**args)", + "reg_model = Ridge(**args)" ] }, { From 9f7b864e191967f92481b807e10b5e96af526746 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:31:03 +0100 Subject: [PATCH 44/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 3a6f3e8b..12fbc6c1 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -65,22 +65,6 @@ { "cell_type": "markdown", "metadata": {}, - "source": [ - "## Split Data into Training and Validation Sets" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [], - "source": [ - "def = split_data(df):" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, "source": [ "## Split the dataframe into test and train data" ] From 171860aa51d42aceef737cf790c51e53ae464144 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:34:14 +0100 Subject: [PATCH 45/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 12fbc6c1..23dae9d1 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -62,19 +62,13 @@ "reg_model = Ridge(**args)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Split the dataframe into test and train data" - ] - }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ + "# Split the dataframe into test and train data\n", "def = split_data(df):\n", "X = df.drop('Y', axis=1).values\n", "y = df['Y'].values\n", From f9c5ea1b9ade3ffa9c56be8a3d78b580c83d4189 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:43:25 +0100 Subject: [PATCH 46/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 23dae9d1..117e5442 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -209,7 +209,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python ", "language": "python", "name": "python3" }, From cb8860b11223d427566cb6efa95a49d98b0ee697 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:46:41 +0100 Subject: [PATCH 47/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 117e5442..a80cb5a4 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -28,7 +28,24 @@ "import pandas as pd" ] }, - + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# Split the dataframe into test and train data\n", + "def = split_data(df):\n", + "X = df.drop('Y', axis=1).values\n", + "y = df['Y'].values\n", + "\n", + "X_train, X_test, y_train, y_test = train_test_split(\n", + " X, y, test_size=0.2, random_state=0)\n", + "data = {\"train\": {\"X\": X_train, \"y\": y_train},\n", + " \"test\": {\"X\": X_test, \"y\": y_test}}\n", + " return data" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -62,24 +79,6 @@ "reg_model = Ridge(**args)" ] }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "# Split the dataframe into test and train data\n", - "def = split_data(df):\n", - "X = df.drop('Y', axis=1).values\n", - "y = df['Y'].values\n", - "\n", - "X_train, X_test, y_train, y_test = train_test_split(\n", - " X, y, test_size=0.2, random_state=0)\n", - "data = {\"train\": {\"X\": X_train, \"y\": y_train},\n", - " \"test\": {\"X\": X_test, \"y\": y_test}}\n", - " return data" - ] - }, { "cell_type": "markdown", "metadata": {}, From dcb630ecadbeb88b256ad8a9b77bc553b04d33e8 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 06:54:06 +0100 Subject: [PATCH 48/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index a80cb5a4..447f7105 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -46,6 +46,19 @@ " return data" ] }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# Train the model, return the model\n", + "def train_model(data, args):\n", + "reg_model = Ridge(**args)\n", + "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])\n", + " return reg_model" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -55,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -88,10 +101,11 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ + "# Train the model, return the model\n", "def train_model(data, args):\n", "reg_model = Ridge(**args)\n", "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])\n", From fbcdef013ee26273924706c7d52aafd3095ae37e Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 07:01:35 +0100 Subject: [PATCH 49/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 447f7105..14a4e0ae 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -92,26 +92,6 @@ "reg_model = Ridge(**args)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Train the model, return the model" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "# Train the model, return the model\n", - "def train_model(data, args):\n", - "reg_model = Ridge(**args)\n", - "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])\n", - " return reg_model" - ] - }, { "cell_type": "markdown", "metadata": {}, From 1d765fbdb91dfad9ab5c0b2ad51ed440e55a7d30 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 07:09:36 +0100 Subject: [PATCH 50/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 14a4e0ae..21073e41 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -59,13 +59,6 @@ " return reg_model" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Main Program" - ] - }, { "cell_type": "code", "execution_count": 4, @@ -89,7 +82,10 @@ " \"alpha\": 0.5\n", "}\n", "\n", - "reg_model = Ridge(**args)" + "reg_model = Ridge(**args)\n", + "\n", + "# Validate Model on Validation Set\n", + "metrics = get_model_metrics(reg, data)\n" ] }, { From fe808a26b31c7d92283d4db1efd35c37d64a94cb Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 07:23:11 +0100 Subject: [PATCH 51/53] Update Diabetes Ridge Regression Training.ipynb --- .../Diabetes Ridge Regression Training.ipynb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 21073e41..5b6671b7 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -59,6 +59,18 @@ " return reg_model" ] }, + { + "cell_type": "code", + "metadata": {}, + "source": [ + "# Evaluate the metrics for the model\n", + "def = get_model_metrics(reg_model, data):\n", + "preds = reg_model.predict(data[\"test\"][\"X\"])\n", + "mse = mean_squared_error(preds, y_test)\n", + "metrics = {\"mse\": mse}\n", + " return metrics" + ] + }, { "cell_type": "code", "execution_count": 4, @@ -139,7 +151,7 @@ ] }, { - "cell_type": "markdown", + "cell_type": "code", "metadata": {}, "source": [ "## Evaluate the metrics for the model" From 230efc56cccc150b727bd5f7e399beb4fb9f4ec1 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 07:30:03 +0100 Subject: [PATCH 52/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index 5b6671b7..da39f904 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -59,7 +59,7 @@ " return reg_model" ] }, - { + { "cell_type": "code", "metadata": {}, "source": [ From 6d20a43b9a141347d752967250b5568c808067b1 Mon Sep 17 00:00:00 2001 From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com> Date: Sat, 5 Aug 2023 07:36:09 +0100 Subject: [PATCH 53/53] Update Diabetes Ridge Regression Training.ipynb --- experimentation/Diabetes Ridge Regression Training.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb index da39f904..4b9f6687 100644 --- a/experimentation/Diabetes Ridge Regression Training.ipynb +++ b/experimentation/Diabetes Ridge Regression Training.ipynb @@ -61,7 +61,9 @@ }, { "cell_type": "code", + "execution_count": 4, "metadata": {}, + "outputs": [], "source": [ "# Evaluate the metrics for the model\n", "def = get_model_metrics(reg_model, data):\n", @@ -73,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [