Chapter8 Regression Exercises v2 20230112
Chapter8 Regression Exercises v2 20230112
Exercise
Exercise 1
Linear Regression
x 1 2 6 4 5
y 1 2 4 3 3
Calculate the parameters of the linear regression using the normal equations
given in the lecture.
1 2 6 4 5 18
1 2 4 3 3 13
1 4 36 16 25 82
1 4 24 12 15 56
Calculate the parameters of the linear regression using the normal equations
given in the lecture.
56 − 82 𝑏
5 𝑎 +18 𝑏=13 𝑎=
18
18 𝑎 +82 𝑏=56
18 𝑎 +82 𝑏=56
46
86 𝑏=46 𝑏=
86
=0.5349
Calculate the parameters of the linear regression using the normal equations
given in the lecture.
Regression line
29 23
𝑦= + 𝑥=0.6744+ 0.5349 𝑥
43 43
Use the regression line to predict (or calculate) the values of the function for all .
Prediction at and
Predict the price of an house in Ames (Iowa, USA) given a number of features
(size, neighborhood, heating...) using Linear Regression.
Predict the price of an house in Ames (Iowa, USA) given a number of features
(size, neighborhood, heating...) using Linear Regression.
Train a Logistic Regression model that predicts whether a wine is red or white.
4. Train a logistic regression model on the training set, and apply the
model to the test set
5. Use the Scorer node to evaluate the accuracy of the model
Train a Logistic Regression model that predicts whether a wine is red or white.