Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

MachineLearning.KMeans: Balanced clustering #390

Closed
jagbarcelo opened this issue Jan 19, 2017 · 5 comments
Closed

MachineLearning.KMeans: Balanced clustering #390

jagbarcelo opened this issue Jan 19, 2017 · 5 comments

Comments

@jagbarcelo
Copy link

Is there any tweak/configuration/settings/example that shows how to calculate clusters of same size using your Framework? If not, is this included in your plans for next releases?

Right now the only thing that I have managed to do is repeat the Learn method using different random seeds for the initial position of the centroid set, until (eventually) a balanced solution is found. Obviously this solution is not optimal at all. Despite the fact that the solutions found are not repeatable and the execution times vary.

Thanks.

@cesarsouza
Copy link
Member

Hi there,

Right now the framework doesn't offer any mechanism to create clusters of the same size. However, this problem seems highly interesting. I will probably be adding a method for this task in the next few days.

Regards,
Cesar

@cesarsouza
Copy link
Member

It seems in fact that a balanced k-means algorithm can be implemented using the Munkres / Hungarian algorithm for solving minimum-cost assignment problems, which would also be an excellent addition to the framework. I will be adding a possible version for this modified k-means in the next minutes!

@cesarsouza
Copy link
Member

I've just committed a Balanced K-Means implementation. You can either compile the framework from the source code right now or wait until a new pre-release NuGet package is generated.

Regards,
Cesar

@jagbarcelo
Copy link
Author

Awesome! Thanks a lot for such a quick response and even quicker solution.

@cesarsouza
Copy link
Member

Fixed in 3.5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants