Here is my code:
train_points <- read.table(\"kaggle_train_points.txt\", sep=\"\\t\") train_labels <- read.table(\"kaggle_train_labels.txt\", sep=\"\\t
Without access to the data, it's really hard to help. However, I suspect that train_labels should be a vector. So try
train_labels
cl = train_labels[,1] knn(train_points, test_points, cl, k = 5)
Also double check:
dim(train_points) dim(test_points) length(cl)