nicodv / kmodes

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

ValueError: All arrays must be of the same length #179

Open tathianabarreto opened 2 years ago

tathianabarreto commented 2 years ago

Hi! I've been trying to apply KPrototype in my PhD. After I get the optimal K (cluster initiation), I type to convert the results into a dataframe and plot the Elbow Method, but I keep getting the same error 'ValueError: All arrays must be of the same length'. I've checked for missing values, there are none (I've replaced them for "Not answered". I don't know what else to do. Thank you very much for yor attention, Tathiana

davins90 commented 2 years ago

Hi, can you provide an example of code and a sample of data? The Elbow method you plot on the x-axis should have a range of k values

tathianabarreto commented 2 years ago

Hi!! I’m new at Python and still getting a lot of basic errors. I figured what I was doing wrong out already, but thank you so much for answering. I’m very excited with k-prototypes possibilities, I believe I finally found the methodology I needed.

davins90 commented 2 years ago

No problem, I'm happy to help you! K-prototypes it's very useful with mixed data! Congrats for using it!