dask / dask/dask-ml

Dask ml LogisticRegression NotImplementedError: Could not find signature for add_intercept: <csr_matrix>

Open
#827 5 comments 0 reactions 0 assignees View on GitHub
Needs Info
Dominant language
Python
Stars
951
Forks
262
PR merge metrics
No merged PRs in 30d

Description

Hello, I am learning to use Dask ml to analyze data, here is part of my code:
`from dask_ml.linear_model import LogisticRegression
lr = LogisticRegression(max_iter=1000)
lr.fit(x_train_tfidf, y_train)`

When I run it, the error appears:
```python-traceback
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~\anaconda3\lib\site-packages\multipledispatch\dispatcher.py in __call__(self, *args, **kwargs)
268 try:
--> 269 func = self._cache[types]
270 except KeyError:

KeyError: (,)

During handling of the above exception, another exception occurred:

NotImplementedError Traceback (most recent call last)
in

~\anaconda3\lib\site-packages\dask_ml\linear_model\glm.py in fit(self, X, y)
181 self : objectj
182 """
--> 183 X = self._check_array(X)
184
185 solver_kwargs = self._get_solver_kwargs()

~\anaconda3\lib\site-packages\dask_ml\linear_model\glm.py in _check_array(self, X)
195 def _check_array(self, X):
196 if self.fit_intercept:
--> 197 X = add_intercept(X)
198
199 return check_array(X, accept_unknown_chunks=True)

~\anaconda3\lib\site-packages\multipledispatch\dispatcher.py in __call__(self, *args, **kwargs)
271 func = self.dispatch(*types)
272 if not func:
--> 273 raise NotImplementedError(
274 'Could not find signature for %s: <%s>' %
275 (self.name, str_signature(types)))

NotImplementedError: Could not find signature for add_intercept:
```
I would appreciate if someone can help me. Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.