Different Classification Algorithms & Python IT Assignment Help

Download Solution Order New Solution
Assignment Task

 

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). If you don’t hardcode values, you should be fine. During evaluation, we will let the “run” file run for up to 1 minute, but you should really aim for under 10 seconds total (assuming an average modern laptop). Using numpy arrays is not required, but it is recommended. Numpy provides many vector operations that you can run over data (often replacing costly for-loops with optimized one-line operations). These can help keep your code clean and simple while massively improving performance. 

Algorithms
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.
 

    


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.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.