Skip to main content

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likelyprobably need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means converedconverged by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters between runs the results will naturally be quite different, hence common labels will likely not contain useful information again.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using ause an automatic matching of clusters of 2two converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amountthe number of your clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters between runs the results will naturally be quite different, hence common labels will likely not contain useful information again.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using a automatic matching of clusters of 2 converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amount of clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you probably need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means converged by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters between runs the results will naturally be quite different, hence common labels will likely not contain useful information again.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also use an automatic matching of clusters of two converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on the number of your clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

Update to reflect the content of the comments from @whuber and @ttnphns.
Source Link
geekoverdose
  • 3.9k
  • 2
  • 17
  • 28

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters between runs the mightresults will naturally be veryquite different, hence common labels might againwill likely not comprise semantic sensecontain useful information again.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using a automatic matching of clusters of 2 converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amount of clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters the might naturally be very different, hence common labels might again not comprise semantic sense.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using a automatic matching of clusters of 2 converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amount of clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters between runs the results will naturally be quite different, hence common labels will likely not contain useful information again.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using a automatic matching of clusters of 2 converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amount of clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

Update to reflect the content of the comments from @whuber and @ttnphns.
Source Link
geekoverdose
  • 3.9k
  • 2
  • 17
  • 28

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters the might naturally be very different, hence common labels might again not comprise semantic sense.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using a automatic matching of clusters of 2 converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amount of clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky.

In short: no, you cannot simply instruct most K-Means implementations to use the same names for their clusters each time (at least I am not aware of any such) - so you likely need to do this on your own.

The simple reason is that K-Means intentionally distributes cluster centers randomly at the start, so there would not be any semantic meaning in assigning names to clusters at this point. As the clusters are still the same when K-Means converges (only their centers and associated samples changed) this does not change from a semantic point of view either.

What you can do is e.g. automatically order cluster centers after K-Means convered by some metric you define (e.g. their distance to some origin). But be aware that a) K-Means will very likely converge differently on different runs ("local optima" if you would want to call them such) which might change your naming completely, and b) even if you converge very closely each time, small changes might still cause your metric to order cluster centers differently, which in turn would cause e.g. 2 clusters to have their names "switched", or one cluster being ordered far earlier/later than on previous runs, thereby also changing names of many other clusters if you are unlucky. And keep in mind that in case you change e.g. the amount of clusters the might naturally be very different, hence common labels might again not comprise semantic sense.

Update:

As pointed out by @whuber and @ttnphns in the comments, you can of course also using a automatic matching of clusters of 2 converged runs of K-Means, using some cluster similarity measure. The general idea is to obtain a pairwise matching of clusters over run A and B, where the distance of all clusters of run A to their counterparts in run B is minimized. This will likely give you better results than individually ordering clusters in most cases. Depending on your amount of clusters, a wide range from exhaustive (brute-force) approaches to search strategies might be appropriate.

Source Link
geekoverdose
  • 3.9k
  • 2
  • 17
  • 28
Loading