Gower's Distance for Mixed-Data Clustering

Description

Measures similarity between users described by a mix of numbers and categories, so they can be clustered properly.

Persona and segment data mixes types: age and session counts are numeric, role and plan are categorical, some answers are yes or no. Standard k-means needs numeric data, and one-hot encoding distorts distances. Gower's distance scales each variable to 0 to 1 by its own type (range-normalised difference for numbers, match or mismatch for categories) and averages them. It pairs with hierarchical clustering or PAM (k-medoids). Bruce and Bruce also warn about dominant variables and scaling issues that silently shape clusters.

Attributes

Loss type
Unmigrated
Stage
Definition
Effort
Hours

Steps

  1. Assemble mixed variables per user and decide which to include.
  2. Compute the Gower distance matrix, optionally weighting variables.
  3. Cluster with hierarchical clustering or PAM.
  4. Choose the number of clusters with silhouette widths and interpretability.
  5. Profile and name clusters, then validate with qualitative follow-up.

Sources

  • Practical Statistics for Data Scientists (Bruce & Bruce)

Also known as

  • Gower distance
  • Mixed-type clustering

Categories

  • Analytics & Behaviour
  • Computational & Machine Learning