Assignment 6: Perceptrons
CSE 415: Introduction to Artificial Intelligence
The University of Washington, Seattle, Winter 2021
Iris setosa
(from alchetron.com/Iris_setosa)
Due Monday, March 1 at 23:59 PM. (An early-bird turn-in option is available, for turn-ins of Part A by Wednesday, February 24.)
 
Overview:
The perceptron is a basic computational model for a neuron or simple neural network that served as a starting point for the development of techniques such as deep learning. By studying the perceptron, we can gain familiarity with many of the basic concepts of neural networks and ML as well as better understand how such techniques complement those of state-space approaches in AI.

This assignment is about how perceptrons are trained, and it involves training and testing two kinds of perceptrons to perform classification on multi-dimensional data.

The data we'll use is derived from the classical Fisher Iris dataset. In Part A, you'll implement a very basic binary classifier and the standard perceptron learning algorithm. In Part B, we'll consider a 3-class classification problem and you'll implement both the classifier and the learning algorithm to handle that problem.

Part A:
Begin by downloading the A6 starter files. In Part A you'll be using only the following subset of these files:
A6-Part-A-Report.docx
plot_test.py
binary_perceptron.py
run_2_class_2_feature_iris_data.py
iris-lengths-only-2-class-training.csv
iris-lengths-only-2-class-testing.csv
ring-data.csv
run_ring_data.py
remap_and_run_ring_data.py
remapper.py
Next, run the plot_test.py, and then install the matplotlib module if you don't have it already. You can typically install it by typing the following on a command line:
pip3 install matplotlib
However, depending on how your Python is already set up, that might not work and you can try substituting "pip" for the "pip3". However, on some systems, "pip" will only install it for Python 2.7. If you have trouble installing matplotlib, the staff will try to facilitate your setup through posts on ED or in office hours.

The file A6-Part-A-Report.docx is a template for your Part A report. It contains ten questions that you should answer. The binary_perceptron.py file is where you will implement your main classifier and your training algorithm. The file run_2_class_2_feature_iris_data.py will import and run your binary_perceptron code.

Implement the indicated methods in binary_perceptron.py, as well any other smaller items of programming that might be needed (including remap_and_run_ring_data.py), and use them to answer the questions in the report file. The Part A report is worth 40 points. (Each question in it is worth 4 points.) The completion of the code in binary_percepron.py (and remap_and_run_ring_data.py) is worth 30 points.

Turn-ins for Part A are the report file (either .docx or .pdf ) and the following Python files: your completed binary_perceptron.py file, your completed remap_and_run_ring_data.py file. Submit these to GradeScope. Note that your binary_perceptron.py file should not import any modules, and when it itself is imported, it should not cause anything to print. (The functions defined in it should not normally print anything, but if you have keyword parameters like reporting=False that can enable printing in your methods, that is fine.)

Part B:
In this part, you'll use the remaining files from the starter files collection:
A6-Part-B-Report.docx
ternary_perceptron.py
run_3_class_4_feature_iris_data.py
iris-all-features-3-class-training.csv
iris-all-features-3-class-testing.csv
You'll implement your Part B code in the file ternary_perceptron.py and you'll run it using run_3_class_4_feature_iris_data.py. Then answer the questions in the Part B report and submit your report and ternary_perceptron.py file. The Part B report is worth 10 points, and the Part B implementation is worth 20 points.

Turn-In Instructions Turn in your Part A files, named according to the instructions above, at our course's GradeScope website in the A6-Part-A turn-in.

Turn in your Part B files at the A6-Part-B turn-in. This Part B turn-in should involve only two files: A6-Part-B-Report.pdf, and ternary_perceptron.py.

Updates and Corrections
 
Feb. 23: Please convert your reports to .pdf so GradeScope will accept them as the report turn-ins.

Prev. edited Feb. 19 at 9:50 PM.

If needed, updates and corrections will be posted here, and/or in ED.