DM825 - Introduction to Machine Learning
Sheet 1, Spring 2013 [pdf format]



Exercise 1

Consider the application of Linear Models in classification. For example, consider the application in medical diagnosis of diabetes. The features are blood sugar measurement and amount of fluid intake per day of different patients. These features are used to classify the symptoms sets into two different diagnosis categories, that is, presence or not of diabetes.

Table 1 reproduces some past measurements with the relative category. Here +1 means that the person had diabetes, while -1 that he/she did not. (data.txt)

Implement in R the Batch and Stochastic Gradient Algorithms to learn the weights of x1,x2 and the bias in the linear model such that it outputs outputs −1,+1. Report the final regression coefficients and plot the points together with the linear separator.


x1x2Diabetes
1.01.01
9.46.4-1
2.52.11
8.07.7-1
0.52.21
7.98.4-1
7.07.0-1
2.80.81
1.23.01
7.86.1-1
Table 1: The data for Exercise 1.