Gower Distance
Gower Distance Metric · Also known as: Gower similarity, Gower coefficient
Gower distance is a versatile metric for comparing observations with mixed variable types (continuous, ordinal, categorical, and binary). Introduced by John C. Gower in 1971, this similarity coefficient computes a general measure that ranges from 0 (completely dissimilar) to 1 (identical). It automatically scales variables to a common unit and handles missing values gracefully, making it ideal for clustering and classification on heterogeneous datasets.
Read the full method
Sign in with a free account to read this section.
When to use it
Gower distance excels when comparing observations with mixed variable types: customer profiles with income (continuous), education level (ordinal), location (categorical), and subscription status (binary). Use it in clustering, classification, and nearest-neighbor algorithms on heterogeneous datasets. It is particularly valuable when you cannot or do not want to convert all variables to a single type, and when missing values are present.
Strengths & limitations
- Handles mixed variable types natively: continuous, ordinal, categorical, and binary without preprocessing
- Scales all variables to [0,1], making distances comparable across different measurement units
- Missing values are handled gracefully: excluded from the distance calculation without bias
- Robust and intuitive for real-world datasets with heterogeneous attributes
- Computationally more expensive than single-type metrics due to per-variable type handling
- Assumes equal importance of all variables; no built-in weighting by relevance
- Requires specification of variable types; misclassification can degrade results
- May underperform on very high-dimensional data or datasets with many categorical variables
Frequently asked
How does Gower handle categorical variables with many levels?
Gower treats categorical variables as exact-match (0 or 1 partial similarity). If a variable has many levels, two observations are either in the same category (similarity 1) or different (similarity 0). Consider collapsing rare categories or using weights to reduce their impact.
Can I weight different variables in Gower distance?
Yes. Weighted Gower distance multiplies each partial similarity by a weight before averaging. This allows you to emphasize variables that are more relevant or important for your application. The weights should sum to 1 for interpretability.
How does Gower deal with missing values?
Gower distance ignores missing value comparisons entirely: if either observation has a missing value for a variable, that variable is excluded from the distance calculation for that pair. This approach is fair and avoids bias, though it assumes data are missing at random.
Is Gower distance suitable for high-dimensional data?
Gower can handle high dimensions but may become computationally expensive. If most variables are categorical or ordinal, Gower performs well. If mostly continuous, simpler metrics (Euclidean) may suffice. Test Gower's practical performance on your specific dataset.
Sources
- Gower, J. C. (1971). A general coefficient of similarity and some of its properties. Biometrics, 27(4), 857-874. DOI: 10.2307/2528823 ↗
- Gower, J. C. (1985). Properties of Euclidean and non-Euclidean distance matrices. Linear Algebra and its Applications, 67, 81-97. DOI: 10.1016/0024-3795(85)90187-9 ↗
How to cite this page
ScholarGate. (2026, June 3). Gower Distance Metric. ScholarGate. https://scholargate.app/en/decision-making/gower-distance