Sheet 4, Spring 2011 [pdf format]
Exercise 1 Generalized Linear Models and Neural Networks.
irisdata set gives the measurements in centimeters of the variables petal length and width, respectively, for 50 flowers from each of 2 species of iris. The species are “Iris setosa”, and “versicolor” and “virginica”. [sheet4_1b.R]
Use a multiple logistic model (i.e., multinomial) to
predict the test using generalized linear models to fit the
parameters. Given the multivariate nature of multinomial variables we
cannot use the
glm function in R. An alternative function is
multinom from the package
nnetfrom the package
nnetprovides an implementation to fit single-hidden-layer neural networks, possibly with skip-layer connections (i.e., a link from the input node directly to the output nodes). Check the example of this function. Compare its results with the GLM at the previous point and comment.
Exercise 2 Perceptron. This exercise asks you to implement the perceptron algorithm and plot its result. As data set we use a simplified case with binary classification from the
Exercise 3 Neural Networks. In the derivation of the backward propagation procedure we used the fact that the partial derivation of the error for the output units is given by
For a single output: