0

次のコードがあります。

feature_array = da.concatenate(features, axis=1)#.compute()
model = KMeans(n_clusters=4)
model.fit(features, y=None)

最初に feature_array を計算すると、このコードは問題なく実行されますが、それがないと、実際には把握できない内部 TypeError が発生します。

File "/Users/(...)/lib/python3.7/site-packages/dask_ml/utils.py", line 168, in check_array
    sample = np.ones(shape=shape, dtype=array.dtype)
  File "/Users/(...)/lib/python3.7/site-packages/numpy/core/numeric.py", line 207, in ones
    a = empty(shape, dtype, order)
TypeError: 'float' object cannot be interpreted as an integer

dask_ml で dask 配列を使用することは想定されていませんか? dask_ml を使用する主な理由は、このコードをメモリ データセットよりも大きいデータセットで実行できるようにするためです。

乾杯、フロリアン

4

1 に答える 1