Created
March 16, 2017 03:42
-
-
Save zunman/660e9103c7c2a688692cc015fd631d62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#10-fold | |
ctrl <- trainControl(method = "repeatedcv", repeats = 10, | |
classProbs = TRUE, | |
summaryFunction = twoClassSummary) | |
##TRAINING | |
set.seed(5627) | |
orig_fit <- train(UserClass ~ ., data = imbal_train, | |
method = "svmLinear", | |
metric = "ROC", | |
preProc = c("center", "scale"), | |
trControl = ctrl) | |
##Confusion matrix - test | |
imbal_test$pred <- predict(orig_fit, imbal_test) | |
confusionMatrix(data = imbal_test$pred, reference = imbal_test$UserClass,positive = "yes", mode = "prec_recall") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment