'DataFrame' object has no attribute 'to_delayed'?

496 Views Asked by At

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

Error: enter image description here

1

There are 1 best solutions below

2
SultanOrazbayev On BEST ANSWER

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.