Quantum Machine Learning

  1. k-Nearest Neighbors (10 pts.) In class we created a k-nearest neighbors algorithm which will classiify a single test point. Change the code we created in class so that the algorithm will classify n test points. Test your implementation with 2, 5, and 10 randomly selected test points and report your average accuracy over three runs each. Hint: Functions and/or classes will be useful here.

  2. Classical vs. Quantum Machine Learning (40 pts.) Another famous data set in the realm of machine learning is the wine data set (which can be accessed here). This data set has two columns which could be used for classification: is_red which tells you if the wine is red (1) or not and high_quality which tells you if the wine is high_quality (1) or not. Choose one column to use as your targets and perform the following tasks. Note that this data set is over 6,000 points. You do not need to use all of the data, especially for the quantum machine learning but make sure if you truncate the data both classes of data are represented in the targets (i.e. don’t do a simple truncation with a list splice).