daskdask-distributeddask-dataframedask-delayeddask-ml

'DataFrame' object has no attribute 'to_delayed'?


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

Error: enter image description here


Solution

  • 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.