' dataFrame'对象没有属性' to_delayed'?

发布于 2025-02-13 13:08:32 字数 390 浏览 0 评论 0原文

我正在使用Scikit Localforest模型从DASK学习和BlockWaseVottingRegressor。 代码:

错误:

I am using randomforest model from scikit learn and BlockwisevottingRegressor from dask.
Code:
enter image description here

Error:
enter image description here

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

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

发布评论

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

评论(1

强辩 2025-02-20 13:08:32

问题源于行:

Xs = X.to_delayed()
ys = y.to_delayed()

.to_delayed()方法是为dask DataFrames和dask数组定义的,但对于pandasnumpy objects而不是pandas 。标签xy可能与pandas dataframe关联。

在“错误追溯图像”中,attributeError建议对象是pandas dataframe(可能是另一个库的数据框架,但很可能是pandas一个)。

从发布的图像中可以得出更多的东西。

The problem stems from the lines:

Xs = X.to_delayed()
ys = y.to_delayed()

The .to_delayed() method is defined for dask DataFrames and dask Arrays, but not for pandas or numpy objects. It's likely that the labels X and y are associated with a pandas DataFrame.

In the error traceback image, the AttributeError suggests that the object is a pandas DataFrame (possibly another library's DataFrame, but most likely a pandas one).

Not much more can be derived from the image posted.

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