How can I get the data from dataloader so I do clustering?

The fit() methods expects a numpy array of the complete dataset, so you would need to get all samples of the DataLoader before feeding them to KMeans().fit().
You could use MiniBatchKMeans and use the partial_fit method, if you want to feed each batch to it.

1 Like