测试变量重要性时出现“非数字参数”错误

时间:2019-03-05 10:20:48

标签: r machine-learning r-caret

我在数据集上运行了不同的模型,但是在测试变量重要性时仍然出现相同的错误:

Error in y - mean(y, rm.na = TRUE) : 
  non-numeric argument to binary operator
In addition: Warning message:
In mean.default(y, rm.na = TRUE) :
  argument is not numeric or logical: returning NA

例如,我正在使用以下命令运行knn模型:

fit_control <- trainControl(## 10-fold CV
  method = "repeatedcv",
  number = 10,
  repeats = 2,
  classProbs = TRUE,
  verboseIter = TRUE)

knn_noise_fit_big <- train(is_exceed ~ ., 
                       data = trainSet, 
                       method = "knn",
                       # tuneLength = 5,
                       trControl = fit_control)

谢谢

0 个答案:

没有答案