I am using randomforest model from scikit learn and BlockwisevottingRegressor from dask.
Code:
Asked
Active
Viewed 368 times
0
-
1[Please do not upload images of code/data/errors when asking a question](//meta.stackoverflow.com/q/285551). Instead please use a [formatted code block](/help/formatting) and make sure to always post all your code and a [full traceback](//realpython.com/python-traceback) when asking about errors. Thanks! – Michael Delgado Jul 06 '22 at 14:41
-
what's `type(X_train)`? Looks like it's not a dask dataframe? – Paul H Jul 18 '22 at 17:01
1 Answers
2
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.

SultanOrazbayev
- 14,900
- 3
- 16
- 46
-
But I am not even passsing X and Y. I am passing X_train and y_train. And I checked their data type. and it showing dask dataframe for X_train and dask array for y_train. – Professor Jul 06 '22 at 10:20
-
1Hmm, that's what traceback is pointing to, so something might be happening in the train_test_split. – SultanOrazbayev Jul 06 '22 at 10:37