Skip to content
Snippets Groups Projects
Commit 20eedc46 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

[fix] Specify the chunk size of arrays for k_init.

The "auto" chunk size somehow breaks k_init for large numpy arrays.
parent b4027905
No related branches found
No related tags found
1 merge request!71[fix] Specify the chunk size of arrays for k_init.
Pipeline #66665 passed
......@@ -308,6 +308,7 @@ class KMeansMachine(BaseEstimator):
# k_init requires da.Array as input.
logger.debug("Transform k-means data to dask array")
data = da.array(data)
data.rechunk(1, data.shape[-1]) # Prevents issue with large arrays.
logger.debug("Get k-means centroids")
self.centroids_ = k_init(
X=data,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment