# Create Data for restaurant reviews
training <- matrix(rexp(600,1), ncol=2)
test <- matrix(rexp(200,1), ncol=2)
# Label "Good", "Bad", "Average"
labelsExample <- c(rep("Good",100), rep("Bad",100), rep("Average",100))
# Distance Matrix
distanceExample<-Distance_for_KNN_test(test, training)
# KNN
knn_test_function(training, test, distanceExample,labelsExample, k = 3)
Run the code above in your browser using DataLab