Highlights
Supervised Learning
Using the provided dataset, implement 3 different classification algorithms (knearest neighbor, perceptron, and decision tree) to determine whether a candidate gets the majority of votes. For this assignment, you will use python3 and (optionally) the numpy library for vector/matrix-based scientific computation in python. The assignment file you will submit is assignment3.py. Please complete the methods within the class definitions provided. You are free to add additional helper methods and classes. All the code will be run using the run_assignment3.py file. You can modify this file for your own testing, but you can only upload the assignment3.py file to Brightspace, so make sure all your code is in that file. You can expect that any variable in the “run” file could be changed during evaluation though its data type will remain the same. For example, the shape of the data could change (i.e. there may be a different number of points or features).
K-Nearest Neighbor
Use Euclidean distance between the features. Choose a k value and use majority voting to determine the class. The k value is provided to the knn class. Please implement the methods train (which simply stores the data) and predict (which runs the KNN algorithm). The distance function is provided for you, and you can assume that all data is continuous. Ties can be broken arbitrarily by picking either class.
Perceptron
For the perceptron, multiply the inputs by a weight matrix and then pass the output through a single heaviside function (a.k.a. step function) to get the output. Don’t forget the bias. Train the perceptron using the perceptron learning algorithm. The weight matrix and bias are initialized in the run file to facilitate grading. You must update the weights, but don’t change the shape or type of the numpy array. The number of steps is defined in the run file. For each step, update the model on a single datapoint. Decision Tree Use the ID3 algorithm as defined in the slides. Since all the data is continuous, they have to be broken down into bins. This has been done for you in the preprocess method. You can preprocess the data in the train and predict methods (which you will implement) before evaluating. The preprocess functions break the data into bins of equal width along each feature dimension.
This IT Assignment has been solved by our IT Experts at My Uni Papers. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.