Cart - error - something is wrong - all ROC metric values ​​are missing:

I use caret package. In certain cases, for example, but not only in the example below, the carriage will cause the following error:

Something is wrong; all the ROC metric values are missing:
Error in train.default(x, y, weights = w, ...) : Stopping

The strange thing is that the carriage can do this with almost the same calls. For example. - the first call for the following works, the second call causes an error. I had a similar problem when I turned on, for example. Verbose argument keeping all things equal or when I run certain packages in a carriage (e.g. SVM).

I read that the problem may be the definition of a class variable, but my main variable is a standard factor with 2 levels, for example. (Coefficient w / 2 of the level "NP", "P": 1 1 1 1 1 1 1 1 1 1 1 ...).

Does anyone have any tips?

(apologies for the exclusion of the reproducible example)

Call 1
gbmFit1 <- train(class ~., data = dt_fulltrain,method = "gbm",metric="ROC",trControl = fitControl)

Call2
gbmFit1 <- train(class ~., data = dt_fulltrain,method = "gbm",metric="ROC",trControl = fitControl, strata = dt_fulltrain$class, sampsize = rep(nmin, 2))
-1
source share
2 answers

I had a similar problem and found that I was loading the library pROC( https://cran.r-project.org/web/packages/pROC/index.html ) before learning to solve the problem.

+2
source

I had a similar problem. Without your reproducible version, I cannot be sure that this will solve it.

However, for future readers, you can try checking your details for NA, NaN, and Inf. In my case, I had some cells containing Inf. Having deleted these lines, I solved the problem.

0
source

Source: https://habr.com/ru/post/1607181/


All Articles