Assignment 1: Perceptron for Binary Classification
Loyola Marymount University
Professor Alex Wong
CSMI-533: Data Science and Machine Learning
Given the UCI Breast Cancer dataset, classify whether a tumor is benign or malignant
Results using the scikit-learn implementation of a Perceptron model is provided.
You will implement the PerceptronBinaryclass using the Perceptron Learning Algorithm.
A skeleton of the class is provided in assignment1.py
Here is the sample output:
Results using scikit-learn Perceptron modelꢀ
Training set mean accuracy: 0.9199ꢀ
Testing set mean accuracy: 0.9298ꢀ
Results using our Perceptron modelꢀ
Training set mean accuracy: 0.0000ꢀ
Testing set mean accuracy: 0.0000ꢀ
You will complete the following functions for the assignment:
) __update :Update the weight vector during each training iteration
) fit :Fits the model to x and y by calling the calls __updatefunction, which updates
the weight vector based on mis-classified examples for t iterations until convergence
) predict :Predicts the label for each feature vector x
) score :Predicts labels based on feature vector x by calling predictfunction and
computes the mean accuracy of the predictions
You will submit the following to Bright Space
I will be executing the assignment using the following command:
Your code must run for me to assign points!
Your assignment will be graded on:
1) the correctness of your implementation of the PerceptronBinary
2) results of your PerceptronBinarymodel on the UCI Breast Cancer dataset
For each day the assignment is late, 50% of its worth will be deducted, e.g. 100% on time, 50%
day late, 25% 2 days late, etc.
本网站支持 Alipay WeChatPay PayPal等支付方式
E-mail: email@example.com 微信号:vipnxx