警告消息:“重采样性能度量中的缺失值"在插入符 train() 中使用 rpart [英] Warning message: "missing values in resampled performance measures" in caret train() using rpart
问题描述
我正在使用 caret 包来训练带有rpart"包的模型;
I am using the caret package to train a model with "rpart" package;
tr = train(y ~ ., data = trainingDATA, method = "rpart")
数据没有缺失值或 NA,但在运行命令时出现警告消息;
Data has no missing values or NA's, but when running the command a warning message comes up;
Warning message:
In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo, :
There were missing values in resampled performance measures.
有谁知道(或可以指出我在哪里可以找到答案)这个警告是什么意思?我知道它告诉我重新采样的性能度量中存在缺失值 - 但这究竟意味着什么,如何会出现这样的情况?顺便说一句,predict()
函数与拟合模型配合得很好,所以这只是我的好奇心.
Does anyone know (or could point me to where to find an answer) what does this warning mean?
I know it is telling me that there were missing values in resampled performance measures - but what does that exactly mean and how can a situation like that arise?
BTW, the predict()
function works fine with the fitted model, so it is just my curiosity.
推荐答案
在没有更多数据的情况下不确定.
Not definitively sure without more data.
如果这是回归,最可能的情况是树没有找到好的分割并使用结果的平均值作为预测变量.这很好,但您无法计算 R^2,因为预测的方差为零.
If this is regression, the most likely case is that the tree did not find a good split and used the average of the outcome as the predictor. That's fine but you cannot calculate R^2 since the variance of the predictions is zero.
如果分类的话,就不好说了.您可能有一个重采样,其中一个结果类的样本为零,因此敏感性或特异性未定义,因此 NA
.
If classification, it's hard to say. You could have a resample where one of the outcome classes has zero samples so sensitivity or specificity is undefined and thus NA
.
这篇关于警告消息:“重采样性能度量中的缺失值"在插入符 train() 中使用 rpart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!