Assignment1
Assignment1
4. Consider the following data set. Based upon the data set build a Linear regression model to
predict output (use the normal equation method as well as gradient descent method).
Consider the hypothesis is ℎ𝜃 (𝑥) = 𝜃1 𝑥.
Input(x) Output(y)
1 1
2 2
3 2
5. Define the problem related with Underfitting and Overfitting and how we handle the problem of
Underfitting and Overfitting.
6. Consider the following data set. Based upon the data set build a Linear regression model to
predict output (use the normal equation method as well as gradient descent method.
Input(x) Output(y)
𝒙𝟏 𝒙𝟐
1 1 2
1 2 3
2 2 4
2 3 5
3 3 6
7. Consider the following data set. Based upon the dataset, build a Ridge regression (L1
Regularization) model to predict output (use the normal equation method as well as gradient
descent method). Assume the value of 𝜆 = 1.
Input(x) Output(y)
𝒙𝟏 𝒙𝟐
1 1 2
1 2 3
2 2 4
2 3 5
3 3 6
8. Consider the following data set. Based upon the dataset build a Lasso regression (L2
Regularization) model to predict output. Assume the value of 𝜆 = 1.
Input(x) Output(y)
𝒙𝟏 𝒙𝟐
1 1 2
1 2 3
2 2 4
2 3 5
3 3 6
9. Consider the following data set. Based upon the dataset, build a Ridge regression (L1
Regularization) model to predict output (use the normal equation method as well as gradient
descent method). Assume the value of 𝜆 = 0.2.
Input(x) Output(y)
𝒙𝟏 𝒙𝟐
1 2 3
2 3 5
3 4 7
4 5 9
10. Consider the following data set. Based upon the dataset built a Lasso regression (L2
Regularization) model to predict output. Assume the value of 𝜆 = 0.2.
Input(x) Output(y)
𝒙𝟏 𝒙𝟐
1 2 3
2 3 5
3 4 7
4 5 9