无法在R中找到功能“预测”的继承方法

时间:2019-02-09 18:05:58

标签: r machine-learning r-caret

上下文
我正在尝试对房价进行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)

0 个答案:

没有答案