Skip to content

KMeans fit TypeError expected dtype object, got 'numpy.dtype[float64]' #802

@Maia97

Description

@Maia97

What happened:
when fit X, get error:

TypeError                                 Traceback (most recent call last)
<ipython-input-11-7d3bc4c475f7> in <module>
      1 km = dask_ml.cluster.KMeans(n_clusters=3, init_max_iter=2, oversampling_factor=10)
----> 2 km.fit(X)
 ...
 ...
 TypeError: expected dtype object, got 'numpy.dtype[float64]'

What you expected to happen:
output:
KMeans(init_max_iter=2, n_clusters=3, oversamplinh_factor=10)

Minimal Complete Verifiable Example:

import dask_ml.cluster

X, y = dask_ml.datasets.make_blobs(n_samples=1000000,
                                   chunks=100000,
                                   random_state=0,
                                   centers=3)
km = dask_ml.cluster.KMeans(n_clusters=3, init_max_iter=2, oversampling_factor=10)
km.fit(X)

Environment:

  • Dask version: dask_ml 1.8.0, dask 2021.02.0
  • Python version: 3.7
  • Operating System: MacOS Catalina 10.15.5
  • Install method (conda, pip, source): conda
  • Other packages: numpy 1.20.1, pandas 1.2.2

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