I'm building an SVM prediction model in R and the dataset isn't supposed to lend itself to models with great accuracy/beta so I'm supposed to end with a poorly optimized model and spend time optimizing it. But it predicts at 100% accuracy with a Kappa of 1. I split it in half for training/testing and then run ksvm on it:
spor <- read.csv("spor.csv")
set.seed(12345)
idx <- sample(nrow(spor), 0.5*nrow(spor))
spor_train <- spor[idx,]
spor_test <- spor[-idx,]
spor_test_lab <- spor_test$alc
svm <- ksvm(as.factor(spor_train_lab) ~., data = spor_train, kernel = "vanilladot")
svm_pred <- predict(svm, spor_test)
confusionMatrix(svm_pred, as.factor(spor_test_lab))
I tried changing the ratio of train/test, testing on the whole dataset, whatever I do the model responds with 100% accuracy. I know there has to be a bug in here somewhere but I have no idea what it could be.