Description
The following questions are from Understanding Machine Learning: From Theory to Algorithms by Shai Shalev-Shwartz and Shai Ben-David. It can be found here http://www.cs.huji.ac.il/ shais/UnderstandingMachineLearning/ by courtesy of the authors.
- Exercise 1
- Exercise 3
- Exercise 5
- Exercise 1
- Exercise 2
- Exercise 1
In the following two problems, you are asked to implement Perceptron algorithm and Linear Regression algortithm in Python. To set up the environment, install the following software & packages:
- python (https://www.python.org/downloads/)
- numpy (http://www.numpy.org/)
- scipy (http://www.scipy.org/)
- matplotlib (http://matplotlib.org/)
- scikit-learn (http://scikit-learn.org/stable/)
Note that, you are allowed to use other programming languages for your implementation. If so, you may need to create an csv data loader yourself and read the data from ./data/*.csv. Make sure to submit your source code to CCLE. Your answer will NOT be graded if we didn’t see your submission.
- ) Implement the Perceptron algorithm on Iris Dataset for the task of binary classification. The skeleton code is given in py.
- Run the skeleton code, report the testing error obtained by the Perceptron model implemented in scikit-learn.
- Replace skeleton code line 45-47 with your implementation.
- Report your error on the testing set. Report the number of iterations it took the algorithm to converge on the training set.
- Implement the linear regression algorithm on Boston House Dataset for the task of regression. The skeleton code is given in py.
- Run the skeleton code, report the mean squared testing error obtained by the LinearRegression model implemented in scikit-learn.
- Replace skeleton code line 47-49 with your implementation.
- Report your mean squared error on the testing set.




