1

I'm doing an exercise with SVM. I'm using PMIndianDiabetes from mlbench.

library(caret) 
library(mlbench)
data(PimaIndiansDiabetes)
x=PimaIndiansDiabetes[,1:8]
y=PimaIndiansDiabetes[,9]
control=trainControl(
      method = "repeatedcv", number = 5,
      repeats = ,classProbs=TRUE,summaryFunction=twoClassSummary)
      set.seed(998) 
      svm.tune<- train(x,y, 
               method = "svmRadial", # Radial kernel 
               preProc = c("center","scale"), # Center and scale data 
               trControl=control,metric="ROC")

And i'm receiving the message:

Something is wrong; all the ROC metric values are missing:
      ROC           Sens             Spec       
  Min.   : NA   Min.   :0.8650   Min.   :0.5537  
  1st Qu.: NA   1st Qu.:0.8695   1st Qu.:0.5621  
  Median : NA   Median :0.8740   Median :0.5704  
  Mean   :NaN   Mean   :0.8717   Mean   :0.5705  
  3rd Qu.: NA   3rd Qu.:0.8750   3rd Qu.:0.5789  
  Max.   : NA   Max.   :0.8760   Max.   :0.5873  
  NA's   :3                                      
  Error in train.default(x, y, method = "svmRadial", preProc = c("center",           : 
  Stopping
 In addition: Warning message:
 In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo,  :
 There were missing values in resampled performance measures.

I've checked the columns, they have valid R names, checked there are two factors, no NA in data,what else?????

milos.ai
  • 3,882
  • 7
  • 31
  • 33

0 Answers0