mirror of
https://github.com/ArthurDanjou/ml_exercises.git
synced 2026-01-28 19:00:30 +01:00
update readme with new chapter links
This commit is contained in:
@@ -187,10 +187,10 @@
|
||||
"source": [
|
||||
"## Linear Models\n",
|
||||
"\n",
|
||||
"After reading the chapter on linear models, test them here on different datasets (by changing the number at the end of the dataset variable, e.g., `X_reg_2` -> `X_reg_3`) and experiment with their hyperparameter settings (in the comments you'll find a description of the different hyperparameters and which values you can test for them).\n",
|
||||
"After reading the chapter on linear models, test them here on different datasets (by changing the number at the end of the dataset variable, e.g., `X_reg_1` -> `X_reg_2`) and experiment with their hyperparameter settings (in the comments you'll find a description of the different hyperparameters and which values you can test for them).\n",
|
||||
"\n",
|
||||
"**Questions:**\n",
|
||||
"- Compare the linear regression and ridge regression models on the regression dataset with outliers: what do you observe?\n",
|
||||
"- Compare the linear regression and ridge regression models on the regression dataset with outliers (i.e., `X_reg_2, y_reg_2`): what do you observe?\n",
|
||||
"- What happens when you increase the value for `alpha` for the ridge regression model? (first think about it, then confirm your guess by actually changing the parameter)"
|
||||
]
|
||||
},
|
||||
@@ -210,7 +210,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Linear Regression\n",
|
||||
"X, y = X_reg_2, y_reg_2 # change the numbers here to test the model on a different dataset\n",
|
||||
"X, y = X_reg_1, y_reg_1 # change the numbers here to test the model on a different dataset\n",
|
||||
"model = LinearRegression()\n",
|
||||
"model.fit(X, y)\n",
|
||||
"plot_regression(X, y, model)\n",
|
||||
@@ -225,7 +225,7 @@
|
||||
"source": [
|
||||
"# Ridge Regression:\n",
|
||||
"# alpha (> 0): regularization (higher values = more regularization)\n",
|
||||
"X, y = X_reg_2, y_reg_2\n",
|
||||
"X, y = X_reg_1, y_reg_1\n",
|
||||
"model = Ridge(alpha=1.)\n",
|
||||
"model.fit(X, y)\n",
|
||||
"plot_regression(X, y, model)\n",
|
||||
|
||||
Reference in New Issue
Block a user