nicodv / kmodes

Python implementations of the k-modes and k-prototypes clustering algorithms, for clustering categorical data
MIT License
1.24k stars 417 forks source link

KPrototypes fit_predict fails with sample_weight #175

Closed FGlazov closed 2 years ago

FGlazov commented 2 years ago

Expected Behavior

It should be possible to pass a sample_weight to fit_predict in KPrototypes, and to get the cluster labels from the weighted fitting.

Actual Behavior

Passing a sample_weight to fit_predict causes an exception. This is because the predict function in KProtoypes does not have a **kwargs, nor does it take a sample_weight.

Steps to Reproduce the Problem

Pass a sample_weight to fit_predict of KPrototypes, along with some data.

Specifications

nicodv commented 2 years ago

Thanks for reporting, @FGlazov . This is fixed by https://github.com/nicodv/kmodes/pull/176

Until that's released, please use fit and predict sequentially.

nicodv commented 2 years ago

New release with this fix: https://github.com/nicodv/kmodes/releases/tag/0.12.1