Quantum Machine Learning
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.
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).
- (5 pts.) Import the data and format it for machine learning. Choose if you are going to classify based on color or quality. Here you can choose one or more of the other columns to use as your features. A correlation matrix or similar analysis may help you choose the best columns.
- (5 pts.) Classify the data using a classical k-nearest neighbors algorithm. Attempt to find the best accuracy you can. Report this accuracy as the average of three runs and the number of neighbors.
- (10 pts.) Now classify the data with a quantum k-neatest neighbors algorithm. You do not need to classify all of the data points but report the average accuracy of classifying 10 random test points three times.
- (10 pts.) Classify the data with a classical neural network using the Scikit-Learn library. Perform hyperparameter tuning to attempt to find the best architecture. Report your classification accuracy as the average of three trials.
- (10 pts.) Finally, classify at least 10 pts. with a quantum neural networks. Report your accuracy as an average of three trials.