Skip to content

Commit b359f61

Browse files
authored
Merge pull request #30 from GabbyHills/GabbyHills-patch-34
Update Diabetes Ridge Regression Training.ipynb
2 parents a15a084 + cb8860b commit b359f61

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

experimentation/Diabetes Ridge Regression Training.ipynb

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,24 @@
2828
"import pandas as pd"
2929
]
3030
},
31-
31+
{
32+
"cell_type": "code",
33+
"execution_count": 2,
34+
"metadata": {},
35+
"outputs": [],
36+
"source": [
37+
"# Split the dataframe into test and train data\n",
38+
"def = split_data(df):\n",
39+
"X = df.drop('Y', axis=1).values\n",
40+
"y = df['Y'].values\n",
41+
"\n",
42+
"X_train, X_test, y_train, y_test = train_test_split(\n",
43+
" X, y, test_size=0.2, random_state=0)\n",
44+
"data = {\"train\": {\"X\": X_train, \"y\": y_train},\n",
45+
" \"test\": {\"X\": X_test, \"y\": y_test}}\n",
46+
" return data"
47+
]
48+
},
3249
{
3350
"cell_type": "markdown",
3451
"metadata": {},
@@ -62,24 +79,6 @@
6279
"reg_model = Ridge(**args)"
6380
]
6481
},
65-
{
66-
"cell_type": "code",
67-
"execution_count": 2,
68-
"metadata": {},
69-
"outputs": [],
70-
"source": [
71-
"# Split the dataframe into test and train data\n",
72-
"def = split_data(df):\n",
73-
"X = df.drop('Y', axis=1).values\n",
74-
"y = df['Y'].values\n",
75-
"\n",
76-
"X_train, X_test, y_train, y_test = train_test_split(\n",
77-
" X, y, test_size=0.2, random_state=0)\n",
78-
"data = {\"train\": {\"X\": X_train, \"y\": y_train},\n",
79-
" \"test\": {\"X\": X_test, \"y\": y_test}}\n",
80-
" return data"
81-
]
82-
},
8382
{
8483
"cell_type": "markdown",
8584
"metadata": {},

0 commit comments

Comments
 (0)