上下文
我正在尝试对房价进行R回归分析。
问题
每次运行模型时,都会出现以下错误:
predictions failed for Fold5.Rep1: parameter=none Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘predict’ for signature ‘"glm"’
我认为错误不是来自数据或模型,而是内部R问题。
代码
train_control_config <- trainControl(method = "repeatedcv",
number = 5,
repeats = 1,
returnResamp = "all")
this.model <- train(SalePrice ~ .,
data = train,
method = 'glm',
metric = "RMSE",
preProc = c("center", "scale"),
trControl=train_control_config)