2
$\begingroup$

I segment my customers into 5 clusters on a weekly basis via k-means. So in week_n I have customer clusters C_n1..C_n5.

I would like to identify the "same" cluster over time. What are methods to do this?

I'm currently identifying clusters across time by max(same customers in 2 clusters). That is, given C_11, I look at which C_2i has the most customers the same with C_11, and call that the winner.

Is that reasonable? Are there better identification over time approaches for clusters?

$\endgroup$
3
  • $\begingroup$ Your approach sounds reasonable to me. This search and perhaps this search yields related questions, though with few answers. $\endgroup$ Commented Jul 16, 2022 at 17:29
  • 1
    $\begingroup$ Another approach could use last week's cluster centers as the initial starting points for this week's analysis and then determine how many customers per cluster changed. $\endgroup$
    – Dave2e
    Commented Jul 16, 2022 at 18:35
  • $\begingroup$ Thanks both of you! $\endgroup$ Commented Jul 17, 2022 at 0:00

1 Answer 1

0
$\begingroup$

If I understand your approach correctly, it is greedy algorithm, i.e. it is fast, albeit not necessarily finding the optimal solution.

The point is that C_2i could have more customers in common with a cluster other than C_11, i.e. could be a better match for a different cluster C_1i.

That is why I suggest the following:
A clustering $C$ assigns two each customer $u_i, i=1,\ldots k$ one of five labels: $$ C: u \to \{1,2,\ldots,5\}. $$ And for a given clustering $C_t$ there are thus $5! = 120$ different clusterings $C_{tr}$ that are mere "label re-assignments", i.e. that lead to the same grouping, with other words such that: $$ \forall_{ij} \quad C_{tr}(u_i) = C_{tr}(u_j) \Leftrightarrow C_t(u_i) = C_t(u_j). $$

Now consider two consecutive clusterings $C_t, C_{t+1}$. Fix the label assignment of $C_t$ and run through all possible 120 cluster re-labelings $C_{(t+1)r}$ of $C_{t+1}$ and each time record the count $s_r$ of how many customers have the same cluster label in both clusterings: $$ s_r = \#\{i| C_{(t+1)r}(u_i) = C_t(u_i)\}. $$ Then choose the labeling $C_{(t+1)r_o}$ that gives the highest value $s_r$: $$ r_o = \operatorname{argmax}_r \{s_r\}. $$

Then, the $q$-th cluster of $C_{(t+1)r_o}$ represents the time evolution of the $q$-th cluster of $C_t$, $q=1,\ldots,5$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.