Skip to content

module 'dask' has no attribute 'sharedict' #454

@akter-pi

Description

@akter-pi

Hi I am trying to use incremental from dask. My code is simple and following the existing example. My code is below. But I got error when it calls inc.fit and the error is "AttributeError: module 'dask' has no attribute 'sharedict'". I am using dask 1.1.1 and dask_ml 0.11.0

``

from dask.distributed import Client
client = Client()

import dask

import dask.dataframe as dd
import dask.array as da

df = dd.read_csv('BreastCancer.csv')
X = df.drop(['Id','Class','Bare.nuclei'],axis=1)
y = df['Class']=='benign'

from dask_ml.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X.to_dask_array(True), y.to_dask_array(True))

X_train, X_test, y_train, y_test = dask.persist(X_train, X_test, y_train, y_test)
classes = da.unique(y_train).compute()

from sklearn.linear_model import SGDClassifier
est = SGDClassifier(loss='log', penalty='l2', tol=1e-3)

from dask_ml.wrappers import Incremental
inc = Incremental(est, scoring='accuracy')

inc.fit(X_train, y_train, classes=classes)
``

The error is
`AttributeError Traceback (most recent call last)
in
25 inc = Incremental(est, scoring='accuracy')
26
---> 27 inc.fit(X_train, y_train, classes=classes)

/mnt/d/PI.X/py3.5_venv/lib/python3.5/site-packages/dask_ml/wrappers.py in fit(self, X, y, **
fit_kwargs)
462 def fit(self, X, y=None, **fit_kwargs):
463 estimator = sklearn.base.clone(self.estimator)
--> 464 self._fit_for_estimator(estimator, X, y, **fit_kwargs)
465 return self
466

/mnt/d/PI.X/py3.5_venv/lib/python3.5/site-packages/dask_ml/wrappers.py in _fit_f(self, estim
ator, X, y, **fit_kwargs)
453 random_state=self.random_state,
454 shuffle_blocks=self.shuffle_blocks,
--> 455 **fit_kwargs
456 )
457

/mnt/d/PI.X/py3.5_venv/lib/python3.5/site-packages/dask_ml/_partial.py in fit(model, x, y, c
ompute, shuffle_blocks, random_state, **kwargs)
195 )
196
--> 197 new_dsk = dask.sharedict.merge((name, dsk), x.dask, getattr(y, "dask", {}))
198 value = Delayed((name, nblocks - 1), new_dsk)
199

AttributeError: module 'dask' has no attribute 'sharedict'
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions