I'm trying to reproduce the example on the dask-ml documentation: https://dask-ml.readthedocs.io/en/latest/modules/api.html that for some reason is made with sklearn:
from sklearn.preprocessing import StandardScaler
data = [[0, 0], [0, 0], [1, 1], [1, 1]]
scaler = StandardScaler()
print(scaler.fit(data))
StandardScaler(copy=True, with_mean=True, with_std=True)
print(scaler.mean_)
This is the code I'm using for dask:
from dask_ml.preprocessing import StandardScaler
data = [[0, 0], [0, 0], [1, 1], [1, 1]]
scaler = StandardScaler()
print(scaler.fit(data))
StandardScaler(copy=True, with_mean=True, with_std=True)
Which raises the following error:
AttributeError: 'list' object has no attribute 'mean'
Then I tried with an example from this medium post: https://towardsdatascience.com/speeding-up-your-algorithms-part-4-dask-7c6ed79994ef
df = dd.read_csv("test.csv",assume_missing=True)
sc = StandardScaler()
df["MSSubClass"] = sc.fit_transform(df["MSSubClass"])
Which raises this error:
AttributeError: 'Scalar' object has no attribute 'copy'