- OBJECT OF THE ASSIGNMENT:
To solve and understand linear regression problems by using gradient descent algorithm. - PROBLEM:
Implement linear regression with one or multiple independent variables to predict a dependent (target) variable. - INPUT OF THE PROBLEM:
Training dataset / testing examples - OUTPUT OF THE PROBLEM:
(a) Display the coefficients of the hyperplane, i.e., w = (w0, w1, …, wM).
(b) Predict values of the dependent variable for testing examples. - TESTING CASES:
-
The file
data1.txt
contains a training set of Auto Insurance (汽車保險) in Sweden. The first column (= x) is the number of claims (索賠) and the second column (= y) is the total payment for all the claims in thousands of Swedish Kronor (瑞典克朗).
(a) Find the regression line ŷ = w0 + w1x. Thus, use the gradient descent algorithm to find the weight w = (w0, w1).
(b) Once you have found the regression equation, you can use the model to make predictions.
(i) What is the predicted value of y when x = 45?
(ii) What is the predicted value of y when x = 25? -
The file
data2.txt
contains a training set of Basketball. Columns 1 – 4 are the feature variables x1, x2, x3, x4, and column 5 is the target variable y. The following data (x1, x2, x3, x4, y) are for each player:
x1 = height in feet
x2 = weight in pounds
x3 = percent of successful field goals (out of 100 attempted)
x4 = percent of successful free throws (out of 100 attempted)
y = average points scored per game
(a) Find the hyperplane ŷ = w0 + w1x1+ w2x2+ w3x3+ w4x4. Thus, use the gradient descent algorithm to find the weight w = (w0, w1, w2, w3, w4).
(b) Once you have found the hyperplane, you can use the model to make predictions.
(i) What is the predicted value of y when (x1, x2, x3, x4) = (6.8, 210, 0.402, 0.739)?
(ii) What is the predicted value of y when (x1, x2, x3, x4) = (6.1, 180, 0.415, 0.713)?
-
- APPENDIX:
- REMARKS:
Stopping criteria of the Gradient descent algorithm usually includes:
(a) Stop when a maximum number of iterations has been exceeded.
(b) Stop when some error measure on the training set is small enough.
For example:
Machine Learning Lab Assignment 1
最新推荐文章于 2022-07-13 11:01:01 发布