Something is wrong; all the Accuracy metric values are missing:

r

#1

Hi

This is the code snippet in R. This is for lord of the machines hackathon.
My code snippet :-

x= training[,-c(1,2,3,4,6,15)]
y = training$is_click
fit_svm <- train(x,y,method = ‘svmLinear’,
metric = “Accuracy”,
preProcess=c(“center”,“scale”),
trControl = trainControl(method = ‘repeatedcv’,number = 2))

Getting the error
Something is wrong; all the Accuracy metric values are missing:

These are the warning messages :-
Warning messages:
1: In FUN(newX[, i], …) : NAs introduced by coercion
2: In FUN(newX[, i], …) : NAs introduced by coercion
3: In FUN(newX[, i], …) : NAs introduced by coercion
4: In FUN(newX[, i], …) : NAs introduced by coercion
5: model fit failed for Fold1.Rep1: C=1 Error in if (any(co)) { : missing value where TRUE/FALSE needed

6: In FUN(newX[, i], …) : NAs introduced by coercion
7: In FUN(newX[, i], …) : NAs introduced by coercion
8: In FUN(newX[, i], …) : NAs introduced by coercion
9: In FUN(newX[, i], …) : NAs introduced by coercion
10: model fit failed for Fold2.Rep1: C=1 Error in if (any(co)) { : missing value where TRUE/FALSE needed

11: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, … :
There were missing values in resampled performance measures.

Can someone tell me what is wrong ?

Thanks
Supriyo


#2

Hi Supriyo,

Please check if there are missing values in your training dataset. The train function in caret package assumes that there are no missing values in the training data.

You have to solve this either by imputing the missing values or by removing the cases where this is happening.

Hope this helps.


#3

There are no missing values. If I use random forest in caret, same code is working. But glm and svm are creating problems. :frowning:


#4

we have to use only 3 columns from data set id , send_date, is_open from train data csv to create model …?
could you explain that


#5

I guess it may be a problem with your installation.

You could try using a different system setup or a different language altogether?


#6

Hey - you have been given campaign information separately in a file. You can use it to get more information for each record.