r ..中的回归。预测函数返回比测试数据集更多的行

发布于 2025-01-27 01:21:42 字数 394 浏览 3 评论 0原文

我的测试数据集只有大约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))

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

卷耳 2025-02-03 01:21:42

问题已解决

使用正确的语法来预测函数:

预测(模型, newdata = test_data)

Question has been solved

use the correct syntax for predict function:

predict(model, newdata = test_data)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文