Starting from:

$29.99

Single-layer Linear Neural Networks

C S 487/519 Applied Machine Learning
Single-layer Linear Neural Networks
1 Objective
In this individual homework, you are required to get familiar with several single-layer linear neural networks.
2 Requirements
2.1 Tasks
(1) (20 points) Design and implement a Perceptron binary classifier.
(2) (20 points) Design and implement an Adaline binary classifier.
(3) (20 points) Design and implement a Stochastic Gradient Descent (SGD) binary classifier.
(4) (20 points) Write program to test the different classifiers.
(a) (3 points) Your program should have places to set two arguments: (i) classifier name, which can
be perceptron, adaline, and sgd, and (ii) data file (including path information). You can have
other arguments depending on the design of your program.
(b) (2 points) It should have proper error checking functions (e.g., make sure the classifier name is a
valid one).
(c) (15 points) It calls the different classifiers to train models, make predictions, and report prediction
errors.
(5) (18 points) Write a report report.pdf to analyze the predictive power and the running time of different
classifiers.
(a) (2 points) For each classifier, you should report the accuracy of the prediction, where accuracy is
the percentage of the correctly classified instances. The accuracy needs to be reported for each
iteration (or epoch). Note that you do not need to separate the dataset to training and testing.
The accuracy can be reported for different iterations.
(b) (3 points) For each classifier, please report the errors or costs in each iteration and plot figures
for the errors/costs for all the iterations.
(c) (5 points) Each classifier needs to be tested using two datasets: (1) Iris (by treating one class as
positive class and the other two classes as negative class) and (2) another dataset. You need to
find your second dataset from UCI machine learning repository. This dataset needs to be bigger
than the Iris dataset (more samples and more features).
(d) (5 points) Properly analyze the classifiers behavior. For example, how do your classifiers converge?
what is the effect of feature scaling to your classifiers.
(e) (3 points) Analysis on any other aspects that are not mentioned above and that you think important. For example, the effect of different learning rates on model convergence.
(6) (2 points) Write a readme file readme.txt with detailed instructions to run your program.
(7) (20 points) (CS 519 only) Implement a multiclass classifier using One-vs-Rest strategy and the SGD
binary classifier. Properly test the classifier using Iris data set and another dataset with more than two
class labels. Your second dataset should be from UCI machine learning repository. Include a proper
analysis for this multiclass classifier in the report. Include the commands to run this classifier in the
readme file.
References:
UCI machine learning repository (https://archive.ics.uci.edu/ml/index.php).
The Iris dataset (iris.data) and its description (iris.names.txt) can be downloaded from this page.
1
2.2 Other requirements
• You are NOT allowed to use functions provided in scikit-learn library.
• Your Python code should be written for Python version 3.5.2 or higher.
• Please write proper comments in your code to help the instructor and teaching assistants to understand it.
• Please properly organize your Python code (e.g., create proper classes, modules).
• You can put your code to Jupyter Notebook or a .py file.
3 Submission instructions
Put all your files (Python code, readme file, report, etc.) to a zip file named hw.zip and upload it to Canvas.
4 Grading criteria
(1) CS 519 students need to answer all the questions. CS 487 students do not need to answer questions
marked with (CS 519 only) although you have the freedom to work on them. Your scores will be
scaled to 100. If CS 487 students answer the questions marked with (CS 519 only), you will not have
any points deducted if your answers are wrong; you will not get any extra points either if your answers
are correct.
(2) The score allocation has been put beside the questions.
(3) FIVE points will be deducted if files are not submitted in the required format.
(4) If the total points are more than 100. Your grades will be scaled to the range of [0,100].
(5) Please make sure that you test your code thoroughly by considering all possible test cases. Your code
may be tested using more datasets.
2

More products