Assignment 4: Introduction To Machine Learning Prof. B. Ravindran
Assignment 4: Introduction To Machine Learning Prof. B. Ravindran
Assignment 4: Introduction To Machine Learning Prof. B. Ravindran
For Q3,4: Kindly download the synthetic dataset from the following link
https://bit.ly/2yXJJDA
The dataset contains 1000 points and each input point contains 3 features.
3. (2 marks) Train a linear regression model (without regularization) on the above dataset. Re-
port the coefficients of the best fit model. Report the coefficients in the following format:
β0 , β1 , β2 , β3
(a) -1.2, 2.1, 2.2, 1
(b) 1, 1.2, 2.1, 2.2
(c) -1, 1.2, 2.1, 2.2
(d) 1, -1.2, 2.1, 2.2
(e) 1, 1.2, -2.1, -2.2
Sol. (d)
1
4. (2 marks) Train a l2 regularized linear regression model on the above dataset. Vary the
regularization parameter from 1 to 10. As you increase the regularization parameter, absolute
value of the coefficients (excluding the intercept) of the model:
(a) increase
(b) first increase then decrease
(c) decrease
(d) first decrease then increase
(e) does not change
Sol. (c)
For Q5,6: Kindly download the modified version of Iris dataset from this link.
Available at: (https://goo.gl/vchhsd)
The dataset contains 150 points and each input point contains 4 features and belongs to one
among three classes. Use the first 100 points as the training data and the remaining 50 as test
data. (Note: Do not change the order of data points.)
5. (2 marks) Train a l2 regularized logistic regression classifier on the modified iris dataset. We
recommend using sklearn. Use only the first two features for your model. We encourage you
to explore the impact of varying different hyperparameters of the model. Kindly note that the
C parameter mentioned below is the inverse of the regularization parameter λ. As part of the
assignment train a model with the following hyperparameters:
Model: logistic regression with one-vs-rest classifier, C = 1e4
For the above set of hyperparameters, report the best classification accuracy
(a) 0.88
(b) 0.86
(c) 0.92
(d) 0.68
Sol. (b)
6. (2 marks) Train an SVM classifier on the modified iris dataset. We recommend using sklearn.
Use only the first two features for your model. We encourage you to explore the impact
of varying different hyperparameters of the model. Specifically try different kernels and the
associated hyperparameters. As part of the assignment train models with the following set of
hyperparameters
RBF-kernel, gamma = 0.5, one-vs-rest classifier, no-feature-normalization.
Try C = 0.01, 1, 10. For the above set of hyperparameters, report the best classification
accuracy along with total number of support vectors on the test data.
(a) 0.88, 69
(b) 0.44, 69
(c) 0.68, 44
(d) 0.34, 44
Sol. (a)