Make _labels_cost public
Closed this issue · 3 comments
I would like to expose the functions to calculate label cost, I was using 0.10.2 and using _label_cost to get the distance from the cluster centers (similar to what "distortions" member does with scikit KMeans). This is to automate setting the number of cluster by using something similar to the elbow method. This change broke my code, and I think being able to use the same distance metric that was used for the computation is helpful. My proposal would be to make this method public so we can expose the distance metric with the same gamma.
Not sure I get what you're requesting, @larroy . You can freely import and call the function using from kmodes.kprototypes import _label_cost
. What change that broke your code are you referring to?
I think from 0.10 to 0.11 there was a change in how categorical and continous were stored as nested arrays in the cluster centers. _label_cost is a "protected" function in terms of pep8 would be good to have it renamed to label_cost so it's safe to export.