dask / dask-ml

Scalable Machine Learning with Dask
http://ml.dask.org
BSD 3-Clause "New" or "Revised" License
885 stars 254 forks source link

LogisticRegression.score returns an empty dask array #971

Open sj-ucsd opened 1 year ago

sj-ucsd commented 1 year ago

Describe the issue: Unable to print logistic regression score as a float instead get an empty array:

ArrayChunkBytes8 B8 BShape()()Dask graph1 chunks in 32 graph layersData typefloat64 numpy.ndarray | Array | Chunk | Bytes | 8 B | 8 B | Shape | () | () | Dask graph | 1 chunks in 32 graph layers | Data type | float64 numpy.ndarray

8 B | 8 B () | () 1 chunks in 32 graph layers float64 numpy.ndarray


Minimal Complete Verifiable Example:


# Put your MCVE code here
```from dask_ml.linear_model import LogisticRegression
from dask_glm.datasets import make_classification
X, y = make_classification()
lr = LogisticRegression()
lr.fit(X, y)
lr.score(X, y)

**Anything else we need to know?**:

**Environment**:

- Dask version:'2023.4.1'
- Python version:3.9
- Operating System:Mac OS
- Install method (conda, pip, source): Conda