Try to search your question here, if you can't find : Ask Any Question Now ?

Exploratory analysis/ K Fold Cross Validation in R

HomeCategory: stackoverflowExploratory analysis/ K Fold Cross Validation in R
Avatarrupesh asked 5 months ago

I am having trouble with a K Fold Cross Validation in R , please see attached

    sample <- = nrow(data), size = floor(.50*nrow(data)), replace = F)
train <- data[sample, ]
test  <- data[-sample, ]
### Define train control for k fold cross validation
train_control <- trainControl(method="cv", number=10)
# Fit Naive Bayes Model
model <- train(SIGNAL_FLAG~., data=data, trControl=train_control, method="nb")
 Summarise Results

I am getting multiple errors like

Error in = c(1L, 2L, 1L, 2L, 1L, 2L, : missing values in object


Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels

I have never touched or even seen r before this and do not have a background in stat… I could really use some help… I am leaving a link to the entire script and the data set below.



1 Answers
Best Answer
AvatarJyoti answered 5 months ago
Your Answer

9 + 9 =

Popular Tags

WP Facebook Auto Publish Powered By :