Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lesson_4_Training/HW_4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"id": "QhSnTaNuzOd4"
},
"source": [
"Create create Y, X, and Z samples from problem 1 with 100,000,000 observations (100 million). Measure how long does it take to estimate linear regression of Y on X and Z using: Stochastic Gradient Descent, Batch Gradient Descent, Linear Regression from sklearn, and Linear regression estimated using matrix multiplication $$\\hat{\\theta} = (\\pmb{X}^T \\cdot \\pmb{X})^{-1} \\cdot \\pmb{X}^T \\cdot \\pmb{y}$$, and Linear regression estimated preudo-inverse. For Batch Gradient Descent use 1000 iterations and eta = 0.01. For Stochastic Gradient Descent use 5 iterations and eta = 0.01. Use SGDRegressior imported from sklearn.model.\n",
"Create Y, X, and Z samples from problem 1 with 100,000,000 observations (100 million). Measure how long does it take to estimate linear regression of Y on X and Z using: Stochastic Gradient Descent, Batch Gradient Descent, Linear Regression from sklearn, and Linear regression estimated using matrix multiplication $$\\hat{\\theta} = (\\pmb{X}^T \\cdot \\pmb{X})^{-1} \\cdot \\pmb{X}^T \\cdot \\pmb{y}$$, and Linear regression estimated preudo-inverse. For Batch Gradient Descent use 1000 iterations and eta = 0.01. For Stochastic Gradient Descent use 5 iterations and eta = 0.01. Use SGDRegressior imported from sklearn.model.\n",
"\n",
"For each estimation import **MSE** and **time**"
]
Expand Down Expand Up @@ -288,7 +288,7 @@
},
"source": [
"# Problem 6\n",
"Recreate a X,Y data from problem 1 using 500 observations. Create a 25-degree polynomial for X and scale the data using standard scaler. Estimate the regression model predicting Y via Ridge regression. Calculate MSE (average 'neg_mean_squared_error') using cross-validation with cv = 3. Find optimal alpha by looping from 0.0001 to 1 using step size 0.0001."
"Recreate the X,Y and Z data from problem 1 using 500 observations. Create a 25-degree polynomial for X and scale the data using standard scaler. Estimate the regression model predicting Y via Ridge regression. Calculate MSE (average 'neg_mean_squared_error') using cross-validation with cv = 3. Find optimal alpha by looping from 0.0001 to 1 using step size 0.0001."
]
},
{
Expand Down