AI CS 289 Machine Learning Labs Machine Learning
AI – CS 289 Machine Learning - Labs Machine Learning – Lab 5 09 th November 2006 Dr Bogdan L. Vrusias b. vrusias@surrey. ac. uk 09 th November 2006 Bogdan L. Vrusias © 2006
AI – CS 289 Machine Learning - Labs Instructions • The following slides demonstrate the capabilities of Machine Learning for building typical day-to-day applications. • The examples are taken from: – Negnevitsky, M. , "Artificial Intelligence: A Guide to Intelligent Systems", 2 nd edn. Addison Wesley, Harlow, England, 2005. • If you have not yet done so from the previous lab, then download and unzip the following file, that contains all examples: http: //www. booksites. net/download/negnevitsky 2/student_files/matlab/0321204662_matlab. zip • or alternately: http: //www. cs. surrey. ac. uk/teaching/cs 289/lecturenotes/0321204662_matlab. zip • To run the examples, use Matlab (left hand side window called current directory) to navigate to the directory where you have downloaded and unzipped the files, and then simply type (case sensitive) the name of the file without the “. m” extension. – E. g. to run the digit_recognition. m you type digit_recognition on Matlab’s command window. 09 th November 2006 Bogdan L. Vrusias © 2006 2
AI – CS 289 Machine Learning - Labs Character recognition neural networks • • • Filename: digit_recognition. m Matlab command: digit_recognition Problem: A multilayer feedforward network is used for the recognition of digits from 0 to 9. Each digit is represented by a 5 x 9 bit map. • Run the file, follow the instructions, READ THE COMMENTS on each step, and observe the following: – – – The training inputs (0 -9) are represented in 45 -dimensional vectors together with the target outputs (10 -dimensional). We then set the training parameters (number of neurons on the hidden and output layers, epochs, etc) We test the network with a sample number. Observe how the network recognise test inputs. To improve the recognition we train the network with noisy examples. The recognition accuracy has improved dramatically (see final graph)!!! 09 th November 2006 Bogdan L. Vrusias © 2006 3
AI – CS 289 Machine Learning - Labs Iris plant classification: back-propagation algorithm • • • Filename: Iris_bp. m Matlab command: Iris_bp Problem: The Iris plant data set contains 3 classes, and each class is represented by 50 plants. A plant is characterised by its sepal length, sepal width, petal length and petal width. A three-layer back-propagation network is required to classify Iris plants. • Run the file, follow the instructions, READ THE COMMENTS on each step, and observe the following: – The system is trained with 102 examples and then tested on 48 examples. The system has 5 hidden neurons and 3 output neurons (one for each category) – After 1000 epochs the system can recognise the type of each input with 95. 83% accuracy! 09 th November 2006 Bogdan L. Vrusias © 2006 4
AI – CS 289 Machine Learning - Labs Iris plant classification: back-propagation algorithm • • • Filename: Iris_bp. m Matlab command: Iris_bp Problem: The Iris plant data set contains 3 classes, and each class is represented by 50 plants. A plant is characterised by its sepal length, sepal width, petal length and petal width. A single-layer competitive network is required to classify Iris plants. • Run the file, follow the instructions, READ THE COMMENTS on each step, and observe the following: – The system is trained with 106 examples and then tested on 44 examples. The system has 4 input neurons and 3 output neurons (one for each category) – After the training, the system can recognise the type of each input with 84. 09% accuracy! – What is the difference between supervised and unsupervised learning? 09 th November 2006 Bogdan L. Vrusias © 2006 5
- Slides: 5