Error in auc3_(actual, predicted, ranks) : Not compatible with requested type: [type=character; target=double]

Hi

I have problem with error:
Error in auc3_(actual, predicted, ranks) : Not compatible with requested type: [type=character; target=double].

nba1718$salaryBinary <- factor(nba1718$salaryBinary) 
set.seed(998) 
inTraining <- createDataPartition(nba1718$salaryBinary, p = 0.7, list = FALSE, times = 1) 
training <- nba1718[inTraining,] 
testing <- nba1718[-inTraining,] 
fitControl <- trainControl( method = "cv", number = 10, savePredictions = TRUE ) 
logreg <-
  train(
    salaryBinary ~ Tm + G + MP + PER + TS. + X3PAr + FTr + ORB. + DRB. + TRB. +
      AST. + STL. + BLK. + TOV. + USG. + OWS + DWS + WS + WS.48 + OBPM + DBPM +
      BPM + VORP,
    data = training,
    method = "glm",
    family = binomial(),
    trControl = fitControl,
    tuneGrid = expand.grid(parameter = c(0.001, 0.01, 0.1, 1, 10, 100, 1000))
  )
print(logreg) 
varImp(logreg) 
#Decision tree
dectree <-
  train(
    salaryBinary ~ Tm + G + MP + PER + TS. + X3PAr + FTr + ORB. + DRB. + TRB. +
      AST. + STL. + BLK. + TOV. + USG. + OWS + DWS + WS + WS.48 + OBPM + DBPM +
      BPM + VORP,
    data = training,
    method = "ctree",
    trControl = fitControl
  )
print(dectree) 
varImp(dectree)   ##this error 

Thanks.

As I mentioned before, can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.