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/82] 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/82] 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",
- " age | \n",
- " sex | \n",
- " bmi | \n",
- " bp | \n",
- " s1 | \n",
- " s2 | \n",
- " s3 | \n",
- " s4 | \n",
- " s5 | \n",
- " s6 | \n",
- " Y | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " count | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 442.000000 | \n",
- "
\n",
- " \n",
- " mean | \n",
- " -3.634285e-16 | \n",
- " 1.308343e-16 | \n",
- " -8.045349e-16 | \n",
- " 1.281655e-16 | \n",
- " -8.835316e-17 | \n",
- " 1.327024e-16 | \n",
- " -4.574646e-16 | \n",
- " 3.777301e-16 | \n",
- " -3.830854e-16 | \n",
- " -3.412882e-16 | \n",
- " 152.133484 | \n",
- "
\n",
- " \n",
- " std | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 77.093005 | \n",
- "
\n",
- " \n",
- " min | \n",
- " -1.072256e-01 | \n",
- " -4.464164e-02 | \n",
- " -9.027530e-02 | \n",
- " -1.123996e-01 | \n",
- " -1.267807e-01 | \n",
- " -1.156131e-01 | \n",
- " -1.023071e-01 | \n",
- " -7.639450e-02 | \n",
- " -1.260974e-01 | \n",
- " -1.377672e-01 | \n",
- " 25.000000 | \n",
- "
\n",
- " \n",
- " 25% | \n",
- " -3.729927e-02 | \n",
- " -4.464164e-02 | \n",
- " -3.422907e-02 | \n",
- " -3.665645e-02 | \n",
- " -3.424784e-02 | \n",
- " -3.035840e-02 | \n",
- " -3.511716e-02 | \n",
- " -3.949338e-02 | \n",
- " -3.324879e-02 | \n",
- " -3.317903e-02 | \n",
- " 87.000000 | \n",
- "
\n",
- " \n",
- " 50% | \n",
- " 5.383060e-03 | \n",
- " -4.464164e-02 | \n",
- " -7.283766e-03 | \n",
- " -5.670611e-03 | \n",
- " -4.320866e-03 | \n",
- " -3.819065e-03 | \n",
- " -6.584468e-03 | \n",
- " -2.592262e-03 | \n",
- " -1.947634e-03 | \n",
- " -1.077698e-03 | \n",
- " 140.500000 | \n",
- "
\n",
- " \n",
- " 75% | \n",
- " 3.807591e-02 | \n",
- " 5.068012e-02 | \n",
- " 3.124802e-02 | \n",
- " 3.564384e-02 | \n",
- " 2.835801e-02 | \n",
- " 2.984439e-02 | \n",
- " 2.931150e-02 | \n",
- " 3.430886e-02 | \n",
- " 3.243323e-02 | \n",
- " 2.791705e-02 | \n",
- " 211.500000 | \n",
- "
\n",
- " \n",
- " max | \n",
- " 1.107267e-01 | \n",
- " 5.068012e-02 | \n",
- " 1.705552e-01 | \n",
- " 1.320442e-01 | \n",
- " 1.539137e-01 | \n",
- " 1.987880e-01 | \n",
- " 1.811791e-01 | \n",
- " 1.852344e-01 | \n",
- " 1.335990e-01 | \n",
- " 1.356118e-01 | \n",
- " 346.000000 | \n",
- "
\n",
- " \n",
- "
\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/82] 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/82] 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/82] 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/82] 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",
+ " age | \n",
+ " sex | \n",
+ " bmi | \n",
+ " bp | \n",
+ " s1 | \n",
+ " s2 | \n",
+ " s3 | \n",
+ " s4 | \n",
+ " s5 | \n",
+ " s6 | \n",
+ " Y | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " count | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 4.420000e+02 | \n",
+ " 442.000000 | \n",
+ "
\n",
+ " \n",
+ " mean | \n",
+ " -3.634285e-16 | \n",
+ " 1.308343e-16 | \n",
+ " -8.045349e-16 | \n",
+ " 1.281655e-16 | \n",
+ " -8.835316e-17 | \n",
+ " 1.327024e-16 | \n",
+ " -4.574646e-16 | \n",
+ " 3.777301e-16 | \n",
+ " -3.830854e-16 | \n",
+ " -3.412882e-16 | \n",
+ " 152.133484 | \n",
+ "
\n",
+ " \n",
+ " std | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 4.761905e-02 | \n",
+ " 77.093005 | \n",
+ "
\n",
+ " \n",
+ " min | \n",
+ " -1.072256e-01 | \n",
+ " -4.464164e-02 | \n",
+ " -9.027530e-02 | \n",
+ " -1.123996e-01 | \n",
+ " -1.267807e-01 | \n",
+ " -1.156131e-01 | \n",
+ " -1.023071e-01 | \n",
+ " -7.639450e-02 | \n",
+ " -1.260974e-01 | \n",
+ " -1.377672e-01 | \n",
+ " 25.000000 | \n",
+ "
\n",
+ " \n",
+ " 25% | \n",
+ " -3.729927e-02 | \n",
+ " -4.464164e-02 | \n",
+ " -3.422907e-02 | \n",
+ " -3.665645e-02 | \n",
+ " -3.424784e-02 | \n",
+ " -3.035840e-02 | \n",
+ " -3.511716e-02 | \n",
+ " -3.949338e-02 | \n",
+ " -3.324879e-02 | \n",
+ " -3.317903e-02 | \n",
+ " 87.000000 | \n",
+ "
\n",
+ " \n",
+ " 50% | \n",
+ " 5.383060e-03 | \n",
+ " -4.464164e-02 | \n",
+ " -7.283766e-03 | \n",
+ " -5.670611e-03 | \n",
+ " -4.320866e-03 | \n",
+ " -3.819065e-03 | \n",
+ " -6.584468e-03 | \n",
+ " -2.592262e-03 | \n",
+ " -1.947634e-03 | \n",
+ " -1.077698e-03 | \n",
+ " 140.500000 | \n",
+ "
\n",
+ " \n",
+ " 75% | \n",
+ " 3.807591e-02 | \n",
+ " 5.068012e-02 | \n",
+ " 3.124802e-02 | \n",
+ " 3.564384e-02 | \n",
+ " 2.835801e-02 | \n",
+ " 2.984439e-02 | \n",
+ " 2.931150e-02 | \n",
+ " 3.430886e-02 | \n",
+ " 3.243323e-02 | \n",
+ " 2.791705e-02 | \n",
+ " 211.500000 | \n",
+ "
\n",
+ " \n",
+ " max | \n",
+ " 1.107267e-01 | \n",
+ " 5.068012e-02 | \n",
+ " 1.705552e-01 | \n",
+ " 1.320442e-01 | \n",
+ " 1.539137e-01 | \n",
+ " 1.987880e-01 | \n",
+ " 1.811791e-01 | \n",
+ " 1.852344e-01 | \n",
+ " 1.335990e-01 | \n",
+ " 1.356118e-01 | \n",
+ " 346.000000 | \n",
+ "
\n",
+ " \n",
+ "
\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/82] 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/82] 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",
- " age | \n",
- " sex | \n",
- " bmi | \n",
- " bp | \n",
- " s1 | \n",
- " s2 | \n",
- " s3 | \n",
- " s4 | \n",
- " s5 | \n",
- " s6 | \n",
- " Y | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " count | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 4.420000e+02 | \n",
- " 442.000000 | \n",
- "
\n",
- " \n",
- " mean | \n",
- " -3.634285e-16 | \n",
- " 1.308343e-16 | \n",
- " -8.045349e-16 | \n",
- " 1.281655e-16 | \n",
- " -8.835316e-17 | \n",
- " 1.327024e-16 | \n",
- " -4.574646e-16 | \n",
- " 3.777301e-16 | \n",
- " -3.830854e-16 | \n",
- " -3.412882e-16 | \n",
- " 152.133484 | \n",
- "
\n",
- " \n",
- " std | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 4.761905e-02 | \n",
- " 77.093005 | \n",
- "
\n",
- " \n",
- " min | \n",
- " -1.072256e-01 | \n",
- " -4.464164e-02 | \n",
- " -9.027530e-02 | \n",
- " -1.123996e-01 | \n",
- " -1.267807e-01 | \n",
- " -1.156131e-01 | \n",
- " -1.023071e-01 | \n",
- " -7.639450e-02 | \n",
- " -1.260974e-01 | \n",
- " -1.377672e-01 | \n",
- " 25.000000 | \n",
- "
\n",
- " \n",
- " 25% | \n",
- " -3.729927e-02 | \n",
- " -4.464164e-02 | \n",
- " -3.422907e-02 | \n",
- " -3.665645e-02 | \n",
- " -3.424784e-02 | \n",
- " -3.035840e-02 | \n",
- " -3.511716e-02 | \n",
- " -3.949338e-02 | \n",
- " -3.324879e-02 | \n",
- " -3.317903e-02 | \n",
- " 87.000000 | \n",
- "
\n",
- " \n",
- " 50% | \n",
- " 5.383060e-03 | \n",
- " -4.464164e-02 | \n",
- " -7.283766e-03 | \n",
- " -5.670611e-03 | \n",
- " -4.320866e-03 | \n",
- " -3.819065e-03 | \n",
- " -6.584468e-03 | \n",
- " -2.592262e-03 | \n",
- " -1.947634e-03 | \n",
- " -1.077698e-03 | \n",
- " 140.500000 | \n",
- "
\n",
- " \n",
- " 75% | \n",
- " 3.807591e-02 | \n",
- " 5.068012e-02 | \n",
- " 3.124802e-02 | \n",
- " 3.564384e-02 | \n",
- " 2.835801e-02 | \n",
- " 2.984439e-02 | \n",
- " 2.931150e-02 | \n",
- " 3.430886e-02 | \n",
- " 3.243323e-02 | \n",
- " 2.791705e-02 | \n",
- " 211.500000 | \n",
- "
\n",
- " \n",
- " max | \n",
- " 1.107267e-01 | \n",
- " 5.068012e-02 | \n",
- " 1.705552e-01 | \n",
- " 1.320442e-01 | \n",
- " 1.539137e-01 | \n",
- " 1.987880e-01 | \n",
- " 1.811791e-01 | \n",
- " 1.852344e-01 | \n",
- " 1.335990e-01 | \n",
- " 1.356118e-01 | \n",
- " 346.000000 | \n",
- "
\n",
- " \n",
- "
\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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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/82] 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 3032b8421a7d86467a9833fc58e8b985b7342eb9 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 07:39:32 +0100
Subject: [PATCH 53/82] 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": [
From 243488b629e044b94f8105a3a928be2b3e9ccea7 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 07:49:23 +0100
Subject: [PATCH 54/82] 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 4b9f6687..759e309d 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -136,22 +136,6 @@
"reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Validate Model on Validation Set"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 19,
- "metadata": {},
- "outputs": [],
- "source": [
- "def = get_model_metrics(reg_model, data):"
- ]
- },
{
"cell_type": "code",
"metadata": {},
From 09251ac76aac5dbbf662c6e9c5010dee98d1f014 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 07:58:18 +0100
Subject: [PATCH 55/82] 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 759e309d..984bf050 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -66,7 +66,7 @@
"outputs": [],
"source": [
"# Evaluate the metrics for the model\n",
- "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",
@@ -79,7 +79,7 @@
"metadata": {},
"outputs": [],
"source": [
- "def = main():\n",
+ "def main():\n",
"# Load data\n",
"sample_data = load_diabetes()\n",
"\n",
@@ -89,7 +89,7 @@
"df['Y'] = sample_data.target\n",
"\n",
"# Split Data into Training and Validation Sets\n",
- " def = split_data(df):\n",
+ " data = split_data(df):\n",
"\n",
"# Train Model on Training Set\n",
"args = {\n",
From 38e1fd1b5e4c448fe870c20092603e9e8cbbfb90 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:08:34 +0100
Subject: [PATCH 56/82] 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 984bf050..2b2208e0 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -137,7 +137,7 @@
]
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"metadata": {},
"source": [
"## Evaluate the metrics for the model"
From 0279fba57c8df9173f1373f7ec100204fcaa383d Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:15:25 +0100
Subject: [PATCH 57/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 34 -------------------
1 file changed, 34 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 2b2208e0..29d9f483 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -102,40 +102,6 @@
"metrics = get_model_metrics(reg, data)\n"
]
},
- {
- "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"
- }
- ],
- "source": [
- "# experiment parameters\n",
- "args = {\n",
- " \"alpha\": 0.5\n",
- "}\n",
- "\n",
- "reg_model = Ridge(**args)\n",
- "reg_model.fit(data[\"train\"][\"X\"], data[\"train\"][\"y\"])"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
From 9d11d60cc5e377d7c2ab14321ba3cf8bceb2a351 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:19:33 +0100
Subject: [PATCH 58/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 28 -------------------
1 file changed, 28 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 29d9f483..a0d62e1a 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -102,34 +102,6 @@
"metrics = get_model_metrics(reg, data)\n"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Evaluate the metrics for the model"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 18,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "{'mse': 3298.9096058070622}\n"
- ]
- }
- ],
- "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",
- " return metrics"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
From 01552b894843063bb852bf0435ee6d6103e74e90 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:26:38 +0100
Subject: [PATCH 59/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index a0d62e1a..d5a8c6e4 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -99,17 +99,15 @@
"reg_model = Ridge(**args)\n",
"\n",
"# Validate Model on Validation Set\n",
- "metrics = get_model_metrics(reg, data)\n"
+ "metrics = get_model_metrics(reg, data)\n",
+ "\n",
+ "# Save Model\n",
+ "model_name = \"sklearn_regression_model.pkl\"\n",
+ "\n",
+ "joblib.dump(value=reg, filename=model_name)"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Save Model"
- ]
- },
- {
+ {
"cell_type": "code",
"execution_count": 7,
"metadata": {},
From 02258b76c115f138ca83a6a20a38e4b39c060bfb Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:29:33 +0100
Subject: [PATCH 60/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 46 +------------------
1 file changed, 1 insertion(+), 45 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index d5a8c6e4..b72240bf 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,48 +107,4 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
- {
- "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 ",
- "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 709eb1dff86ac27d467644ec10358981b0bf7bd7 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:30:46 +0100
Subject: [PATCH 61/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index b72240bf..35920ee9 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,4 +107,50 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
+ {
+ "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 ",
+ "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 dd605e76b03ce587cf36e62b0741c4d85dba14ef Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:41:02 +0100
Subject: [PATCH 62/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 22 -------------------
1 file changed, 22 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 35920ee9..ecfd38f4 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,28 +107,6 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
- {
- "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": {
From d046ad81fafc727c2cddbfd8849a37f0ad5a2f1a Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:42:27 +0100
Subject: [PATCH 63/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index ecfd38f4..35920ee9 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,6 +107,28 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
+ {
+ "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": {
From cb3dd948f0fb5b47d9e13f53b275a27128d9b027 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:55:32 +0100
Subject: [PATCH 64/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 22 -------------------
1 file changed, 22 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 35920ee9..ecfd38f4 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,28 +107,6 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
- {
- "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": {
From 7e9a67bb859e35c52ae28863ef2beeb9de56502c Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 08:57:29 +0100
Subject: [PATCH 65/82] 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 ecfd38f4..e1e31b6c 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,7 +107,7 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
- ],
+ {
"metadata": {
"kernelspec": {
"display_name": "Python ",
From 49bab6c851f6a6c7978c6885ebf58dd9dbf92912 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:04:56 +0100
Subject: [PATCH 66/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index e1e31b6c..11a8da6e 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -108,6 +108,28 @@
]
},
{
+ "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 ",
From 1a3f407d6794791b487d7d415d16062d68fed4dc Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:06:49 +0100
Subject: [PATCH 67/82] 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 11a8da6e..c303d13e 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -128,8 +128,8 @@
"\n",
"joblib.dump(value=reg, filename=model_name)"
]
- },
-{
+ }
+ ],
"metadata": {
"kernelspec": {
"display_name": "Python ",
From a2de07d8301a6c89e8a1f817654334d07237b69a Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:11:27 +0100
Subject: [PATCH 68/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index c303d13e..8961ee57 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -111,18 +111,7 @@
"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 b0aad2c6df34d996ad60ada90e53cec070f2b746 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:14:25 +0100
Subject: [PATCH 69/82] Update Diabetes Ridge Regression Training.ipynb
---
experimentation/Diabetes Ridge Regression Training.ipynb | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 8961ee57..6c588de6 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -112,12 +112,8 @@
"execution_count": 7,
"metadata": {},
"outputs": [],
- "source": [
- "model_name = \"sklearn_regression_model.pkl\"\n",
- "\n",
- "joblib.dump(value=reg, filename=model_name)"
- ]
- }
+ "source": []
+ },
],
"metadata": {
"kernelspec": {
From ca2ed1d5b6d7157e6cb2b148f36c5ce31da440e4 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:15:41 +0100
Subject: [PATCH 70/82] 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 6c588de6..e1e31b6c 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -108,13 +108,6 @@
]
},
{
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- ],
"metadata": {
"kernelspec": {
"display_name": "Python ",
From 091eb4a57639f2d0c776c5a4dd869d2160c54c24 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:17:43 +0100
Subject: [PATCH 71/82] 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 e1e31b6c..4d651348 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -108,6 +108,16 @@
]
},
{
+ "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 ",
From 84bf91fe2189ce62743b4d0bbeaac00b3813aea2 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:21:27 +0100
Subject: [PATCH 72/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 4d651348..06a4dd75 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -106,18 +106,8 @@
"\n",
"joblib.dump(value=reg, filename=model_name)"
]
- },
+ },
{
- "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 ",
From ee97beb24eac4348c9c04c08c67fd10e01996e63 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:27:27 +0100
Subject: [PATCH 73/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 22 ++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 06a4dd75..4524d742 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -107,7 +107,27 @@
"joblib.dump(value=reg, filename=model_name)"
]
},
- {
+{
+"cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [],
+ "source": ["model_name = \"sklearn_regression_model.pkl\"\n",
+ "\n",
+ "joblib.dump(value=reg, filename=model_name)"
+ ]
+ }
+{
+"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 ",
From 89103e0227c65ec0079b62295056b525a79747d1 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:29:18 +0100
Subject: [PATCH 74/82] 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 4524d742..975a6d69 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -116,7 +116,7 @@
"\n",
"joblib.dump(value=reg, filename=model_name)"
]
- }
+ },
{
"cell_type": "code",
"execution_count": 7,
From 09e5624b71a517609ad81be42acf8803b7ad38ec Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:32:15 +0100
Subject: [PATCH 75/82] Update Diabetes Ridge Regression Training.ipynb
---
.../Diabetes Ridge Regression Training.ipynb | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Training.ipynb b/experimentation/Diabetes Ridge Regression Training.ipynb
index 975a6d69..a3c53332 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -116,17 +116,6 @@
"\n",
"joblib.dump(value=reg, filename=model_name)"
]
- },
-{
-"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": {
From e59c2a5ce8334c6ec1a78923bbbb24b3d2acce06 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:34:33 +0100
Subject: [PATCH 76/82] 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 a3c53332..1ee2165a 100644
--- a/experimentation/Diabetes Ridge Regression Training.ipynb
+++ b/experimentation/Diabetes Ridge Regression Training.ipynb
@@ -116,6 +116,7 @@
"\n",
"joblib.dump(value=reg, filename=model_name)"
]
+ }
],
"metadata": {
"kernelspec": {
From 94e6626fce8ba323e9a4df56e6639da6eb459701 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 09:58:41 +0100
Subject: [PATCH 77/82] Update Diabetes Ridge Regression Scoring.ipynb
---
.../Diabetes Ridge Regression Scoring.ipynb | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Scoring.ipynb b/experimentation/Diabetes Ridge Regression Scoring.ipynb
index 9ac340ed..499d880c 100644
--- a/experimentation/Diabetes Ridge Regression Scoring.ipynb
+++ b/experimentation/Diabetes Ridge Regression Scoring.ipynb
@@ -1,25 +1,11 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Score Data with a Ridge Regression Model Trained on the Diabetes Dataset"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "This notebook loads the model trained in the Diabetes Ridge Regression Training notebook, prepares the data, and scores the data."
- ]
- },
+
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
+ "def init()\n",
"import json\n",
"import numpy\n",
"from azureml.core.model import Model\n",
From 63a7ffc2d7468d3f35816854887e5a6fdcb814a8 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 10:01:01 +0100
Subject: [PATCH 78/82] Update Diabetes Ridge Regression Scoring.ipynb
---
experimentation/Diabetes Ridge Regression Scoring.ipynb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/experimentation/Diabetes Ridge Regression Scoring.ipynb b/experimentation/Diabetes Ridge Regression Scoring.ipynb
index 499d880c..7aeffadb 100644
--- a/experimentation/Diabetes Ridge Regression Scoring.ipynb
+++ b/experimentation/Diabetes Ridge Regression Scoring.ipynb
@@ -5,7 +5,6 @@
"metadata": {},
"outputs": [],
"source": [
- "def init()\n",
"import json\n",
"import numpy\n",
"from azureml.core.model import Model\n",
@@ -25,6 +24,7 @@
"metadata": {},
"outputs": [],
"source": [
+ "def init()\n",
"model_path = Model.get_model_path(model_name=\"sklearn_regression_model.pkl\")\n",
"model = joblib.load(model_path)"
]
From ceaddfe518f97cd80d95b19f8d6922e34954885b Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 10:03:36 +0100
Subject: [PATCH 79/82] Update Diabetes Ridge Regression Scoring.ipynb
---
experimentation/Diabetes Ridge Regression Scoring.ipynb | 1 -
1 file changed, 1 deletion(-)
diff --git a/experimentation/Diabetes Ridge Regression Scoring.ipynb b/experimentation/Diabetes Ridge Regression Scoring.ipynb
index 7aeffadb..eb062ab6 100644
--- a/experimentation/Diabetes Ridge Regression Scoring.ipynb
+++ b/experimentation/Diabetes Ridge Regression Scoring.ipynb
@@ -1,4 +1,3 @@
-
{
"cell_type": "code",
"execution_count": 1,
From 877bc38af4181e60d142ae69ba08ece4089993b1 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 10:06:11 +0100
Subject: [PATCH 80/82] Update Diabetes Ridge Regression Scoring.ipynb
---
experimentation/Diabetes Ridge Regression Scoring.ipynb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/experimentation/Diabetes Ridge Regression Scoring.ipynb b/experimentation/Diabetes Ridge Regression Scoring.ipynb
index eb062ab6..384ae246 100644
--- a/experimentation/Diabetes Ridge Regression Scoring.ipynb
+++ b/experimentation/Diabetes Ridge Regression Scoring.ipynb
@@ -23,7 +23,7 @@
"metadata": {},
"outputs": [],
"source": [
- "def init()\n",
+ "def init():\n",
"model_path = Model.get_model_path(model_name=\"sklearn_regression_model.pkl\")\n",
"model = joblib.load(model_path)"
]
From ab5ee463cac0c937ac340baa3848675e65fe864b Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 10:20:23 +0100
Subject: [PATCH 81/82] Update Diabetes Ridge Regression Scoring.ipynb
---
.../Diabetes Ridge Regression Scoring.ipynb | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/experimentation/Diabetes Ridge Regression Scoring.ipynb b/experimentation/Diabetes Ridge Regression Scoring.ipynb
index 384ae246..848cbc96 100644
--- a/experimentation/Diabetes Ridge Regression Scoring.ipynb
+++ b/experimentation/Diabetes Ridge Regression Scoring.ipynb
@@ -1,3 +1,19 @@
+ {
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Score Data with a Ridge Regression Model Trained on the Diabetes Dataset"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "This notebook loads the model trained in the Diabetes Ridge Regression Training notebook, prepares the data, and scores the data."
+ ]
+ },
{
"cell_type": "code",
"execution_count": 1,
From 99f838bbee7211ae85a542c0f628da4f2a2b5f27 Mon Sep 17 00:00:00 2001
From: Ugwu Gabby <107874044+GabbyHills@users.noreply.github.com>
Date: Sat, 5 Aug 2023 10:52:56 +0100
Subject: [PATCH 82/82] Update Diabetes Ridge Regression Scoring.ipynb
---
.../Diabetes Ridge Regression Scoring.ipynb | 24 +++++++++++++++----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/experimentation/Diabetes Ridge Regression Scoring.ipynb b/experimentation/Diabetes Ridge Regression Scoring.ipynb
index 848cbc96..a33432fe 100644
--- a/experimentation/Diabetes Ridge Regression Scoring.ipynb
+++ b/experimentation/Diabetes Ridge Regression Scoring.ipynb
@@ -57,10 +57,12 @@
"metadata": {},
"outputs": [],
"source": [
- "raw_data = '{\"data\":[[1,2,3,4,5,6,7,8,9,10],[10,9,8,7,6,5,4,3,2,1]]}'\n",
+ "def run(raw_data, request_headers):\n",
+ "data = json.loads(raw_data)["data"]\n",
+ "data = numpy.array(data)\n",
+ "result = model.predict(data)\n",
"\n",
- "data = json.loads(raw_data)[\"data\"]\n",
- "data = numpy.array(data)"
+ "return {\"result\": result.tolist()}\n"
]
},
{
@@ -71,9 +73,22 @@
]
},
{
- "cell_type": "code",
+ "cell_type": "code",
"execution_count": 4,
"metadata": {},
+ "outputs": [],
+ "source": [
+ "test row = '{\"data\":[[1,2,3,4,5,6,7,8,9,10],[10,9,8,7,6,5,4,3,2,1]]}'\n",
+ "\n",
+ "request_headers = {}\n",
+ "prediction = run(test_row, {})\n",
+ "print("Test result: ", prediction)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
"outputs": [
{
"name": "stdout",
@@ -84,7 +99,6 @@
}
],
"source": [
- "request_headers = {}\n",
"\n",
"result = model.predict(data)\n",
"print(\"Test result: \", {\"result\": result.tolist()})"