r ..中的回归。预测函数返回比测试数据集更多的行
我的测试数据集只有大约1200行,但预测功能赋予了超过3000行。为什么是这样?
model_5 <- lm(precip~relative_humidity + dry_bulb_temp_f + wind_speed + station_pressure, data = train_noaa3)
str(predict(model_5, new_data = test_noaa3))
My test dataset has only around 1200 rows but the predict function is giving way more than 3000 rows. Why is that so?
model_5 <- lm(precip~relative_humidity + dry_bulb_temp_f + wind_speed + station_pressure, data = train_noaa3)
str(predict(model_5, new_data = test_noaa3))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题已解决
使用正确的语法来预测函数:
预测(模型, newdata = test_data)
Question has been solved
use the correct syntax for predict function:
predict(model, newdata = test_data)