Tutorials › Exam SRM - Statistics for Risk Modeling › Interpreting Centroids In Original Units

Exam SRM · K-Means Clustering · Tutorial 718 of 926

Interpreting Centroids In Original Units

Translate scaled k-means centroids into original measurement units and use them to describe the average profile of each cluster.

Intermediate 10 min read

What You'll Learn

  • Define a k-means centroid in the transformed feature space
  • Invert standardization and min-max scaling coordinate by coordinate
  • Check a centroid by averaging its members’ original feature values
  • Describe a cluster relative to the original-data reference values
  • Distinguish a cluster’s average profile from an actual member
  • Avoid interpreting transformed coordinates as original-unit values

Why Centroid Units Matter

A k-means solution may be calculated using standardized or otherwise scaled features, even when the final interpretation needs to be stated in familiar units. A centroid coordinate of \(1.2\), for example, might mean 1.2 standard deviations above a feature’s reference mean; it does not necessarily mean 1.2 dollars, years, or service calls. Interpretation requires undoing the transformation used before clustering.

Once coordinates are translated, the centroid gives an average profile for the observations assigned to that cluster. That profile can be compared with the reference values used in scaling and described in context. The cluster membership matters too: it tells us which observations contribute to those averages. A centroid describes the group; it does not, in general, describe an actual member.

Definition: For a cluster containing \(n_k\) observations with numeric feature vectors \(x_i\), its centroid is the coordinate-by-coordinate mean of those vectors: $$ \bar{x}_k=\frac{1}{n_k}\sum_{i\in C_k}x_i. $$ Here \(C_k\) is the set of observations assigned to cluster \(k\), and \(n_k\) is the number of observations in that set. When k-means is run on transformed features, the centroid is the mean in that transformed space. To describe it in original units, apply the inverse of the feature transformation to each centroid coordinate.

Inverting Common Scaling Rules

Suppose feature \(j\) is standardized using a reference mean \(m_j\) and a positive scale \(s_j\). For an original value \(x_{ij}\), the transformed value is \(z_{ij}=(x_{ij}-m_j)/s_j\). If \(c_{kj}\) is the centroid coordinate for that feature in the standardized space, the original-unit coordinate is:

$$ \bar{x}_{kj}=m_j+s_jc_{kj}. $$

Use the same \(m_j\) and \(s_j\) that were used to transform the data for clustering. They might be a mean and standard deviation, but the calculation also works for other positive affine scaling rules when their centers and scales are known. If the feature was min-max scaled as \(z=(x-a)/(b-a)\), where \(a\) and \(b\) are the reference minimum and maximum with \(b>a\), the inverse is \(x=a+(b-a)z\).

1
Identify the transformation.
For each feature, record how original values were mapped into the space used by k-means, including the reference center, scale, minimum, or maximum.
2
Apply the inverse coordinate by coordinate.
Use the relevant feature’s own transformation parameters. Do not use one feature’s scale for another feature.
3
Interpret alongside membership.
State how many observations belong to the cluster and describe the translated coordinates as averages for those observations.

Why the Inverse Gives the Original-Unit Mean

For affine transformations such as standardization and min-max scaling, the centroid can be translated by applying the inverse transformation to its coordinates. The reason is that averaging commutes with adding a constant and multiplying by a fixed number. In one feature, write the transformed value as \(z_i=(x_i-m)/s\), where \(m\) and \(s>0\) are fixed for all observations. The transformed centroid is:

$$ \bar{z}_k =\frac{1}{n_k}\sum_{i\in C_k}\frac{x_i-m}{s} =\frac{1}{s}\left(\frac{1}{n_k}\sum_{i\in C_k}x_i-m\right) =\frac{\bar{x}_k-m}{s}. $$

Rearranging gives \(\bar{x}_k=m+s\bar{z}_k\), exactly the inverse-standardization formula. The same reasoning applies to min-max scaling because it is also affine. This result depends on using one fixed transformation for every observation in the cluster. For a nonlinear transformation, such as taking logarithms, inverting the transformed centroid does not generally give the arithmetic mean in original units.

Worked Example: Standardized Mileage and Repair Cost

A hypothetical vehicle-service analysis clusters accounts using annual mileage, measured in thousands of kilometres, and annual repair cost, measured in dollars. The features were standardized using reference means \(m_1=12\) and \(m_2=900\), and positive scales \(s_1=3\) and \(s_2=300\). One cluster contains three accounts with original values \((12,900)\), \((15,1050)\), and \((18,1200)\). Find its standardized centroid, translate it to original units, and describe the profile. The method is to average the standardized coordinates and then apply the inverse transformation.

Step 1: Standardize each account. For mileage, the three standardized values are \((12-12)/3=0\), \((15-12)/3=1\), and \((18-12)/3=2\). Their mean is \((0+1+2)/3=1\).

For repair cost, the standardized values are \((900-900)/300=0\), \((1050-900)/300=0.5\), and \((1200-900)/300=1\). Their mean is \((0+0.5+1)/3=0.5\). The standardized centroid is therefore \((1,0.5)\).

Step 2: Convert back to original units. The mileage coordinate is \(12+3(1)=15\) thousand kilometres. The repair-cost coordinate is \(900+300(0.5)=1050\) dollars.

Step 3: Interpret and check. The cluster has three accounts and an average profile of 15 thousand kilometres and $1,050 in annual repair cost. Directly averaging the original mileage gives \((12+15+18)/3=15\); directly averaging repair costs gives \((900+1050+1200)/3=1050\). Both checks agree. The profile is 3 thousand kilometres and $150 above the respective reference means.

Common mistake avoided: Reporting the transformed centroid \((1,0.5)\) as 1 thousand kilometres and 50 cents would treat standardized coordinates as original measurements. They are standardized values, not mileage and dollars.

Worked Example: A Cluster with More Transactions and Shorter Response Times

A hypothetical service operation clusters locations using monthly transaction count and average response time in minutes. The standardization references are \(m_1=40\), \(s_1=8\) transactions, and \(m_2=6\), \(s_2=2\) minutes. A cluster contains four locations with values \((52,3)\), \((60,4)\), \((68,5)\), and \((76,8)\). Calculate the standardized centroid and then state the group’s average profile and its differences from the references.

Step 1: Calculate standardized transaction counts. The four values are \((52-40)/8=1.5\), \((60-40)/8=2.5\), \((68-40)/8=3.5\), and \((76-40)/8=4.5\). Their mean is \((1.5+2.5+3.5+4.5)/4=12/4=3\).

Step 2: Calculate standardized response times. The four values are \((3-6)/2=-1.5\), \((4-6)/2=-1\), \((5-6)/2=-0.5\), and \((8-6)/2=1\). Their mean is \((-1.5-1-0.5+1)/4=-2/4=-0.5\). The standardized centroid is \((3,-0.5)\).

Step 3: Invert each coordinate. Average transaction count is \(40+8(3)=64\). Average response time is \(6+2(-0.5)=5\) minutes. Thus the original-unit centroid is \((64,5)\).

Step 4: Describe and check. The four locations average 64 transactions per month and a 5-minute response time. These are 24 transactions above and 1 minute below the respective reference means. Direct checks give \((52+60+68+76)/4=256/4=64\) and \((3+4+5+8)/4=20/4=5\). Although the mean profile is valid, a particular location need not have both 64 transactions and a 5-minute response time.

Common mistake avoided: A negative standardized response-time centroid does not mean a negative response time. It means the group average is below the reference mean; the inverse calculation gives the actual value of 5 minutes.

Worked Example: Undoing Min-Max Scaling for Account Profiles

A hypothetical account analysis uses annual premium in dollars and the number of service calls. Before clustering, premium was min-max scaled using a reference range from $40 to $140, and service calls were scaled using a range from 0 to 10. Five accounts in one cluster have values \((80,1)\), \((100,2)\), \((110,2)\), \((120,3)\), and \((115,2)\). Find the scaled centroid, invert it, and interpret the result.

Step 1: Min-max scale the premiums. Using \(z=(x-40)/(140-40)=(x-40)/100\), the scaled values are \(0.40\), \(0.60\), \(0.70\), \(0.80\), and \(0.75\). Their mean is \((0.40+0.60+0.70+0.80+0.75)/5=3.25/5=0.65\).

Step 2: Min-max scale the service calls. The scaled values are \(1/10=0.10\), \(2/10=0.20\), \(2/10=0.20\), \(3/10=0.30\), and \(2/10=0.20\). Their mean is \((0.10+0.20+0.20+0.30+0.20)/5=1.00/5=0.20\). The scaled centroid is \((0.65,0.20)\).

Step 3: Invert the transformations. Average premium is \(40+100(0.65)=105\) dollars. Average service calls are \(0+10(0.20)=2\).

Step 4: Check against original values. Premiums average \((80+100+110+120+115)/5=525/5=105\) dollars. Service calls average \((1+2+2+3+2)/5=10/5=2\). The cluster contains five accounts with an average annual premium of $105 and two service calls.

Common mistake avoided: Multiplying the scaled premium coordinate \(0.65\) by the maximum premium of $140 would give $91, which is not the inverse min-max calculation. The correct formula adds the scaled fraction of the range to the minimum: \(40+0.65(140-40)=105\).

Interpreting a Translated Centroid Carefully

A useful interpretation names the feature, its original units, the cluster membership count, and the relevant comparison. For example, “The 14 locations in this cluster average 64 monthly transactions, 24 above the reference mean of 40” is more informative than “the centroid is 3.” If multiple features are used, interpret each coordinate separately before summarizing the overall profile.

The centroid is a coordinate-wise mean, not a guarantee that any member has exactly that profile. The vector of coordinate means can combine values from different observations. In the second worked example, the average profile is \((64,5)\), even though none of the four listed locations has that pair of values. This is expected, not a calculation error.

Also retain the meaning of each feature and its units. A centroid coordinate of 2 service calls is a count average; it need not be a whole number in every application. And if a feature was transformed nonlinearly, such as by a logarithm, do not automatically call the inverse-transformed centroid the original-unit arithmetic mean. The affine inverse formula above is justified for standardization and min-max scaling, not for arbitrary transformations.

Common Exam Trap

Suppose a feature has reference mean 40 and scale 8, and its standardized centroid coordinate is 1.25. The incorrect calculation \(1.25(8)=10\) omits the reference mean. The correct inverse is \(40+1.25(8)=50\). The group average is 10 units above the reference mean, so its original-unit value is 50.

A related mistake is to use the parameters from a different feature or from a different preprocessing fit. Always pair each centroid coordinate with that feature’s own transformation parameters, and use the same parameters that were applied before clustering. This is essential when translating a result for new observations or interpreting a stored clustering solution.

Key takeaway: A centroid calculated after affine scaling is an average in the transformed space. To report the group’s average profile in original units, invert each coordinate using the matching feature’s transformation parameters, then interpret the result alongside the cluster membership.

Check Your Understanding

For each problem, translate the centroid or calculate it from the stated members, then interpret the result in context.

  1. A feature has reference mean 25 and scale 5. A cluster’s standardized centroid is 0.8. A second feature has reference mean 12 and scale 4, and its centroid coordinate is \(-0.5\). What are the two original-unit centroid coordinates, and how do they compare with their reference means? (Answer: 29 and 10; the first is 4 above its reference mean and the second is 2 below.)
  2. A cluster has three locations with monthly travel distances of 18, 24, and 30 kilometres and monthly operating expenses of $80, $100, and $120. The standardization references are means 20 kilometres and $90, with scales 5 kilometres and $20. Find the standardized centroid and the original-unit average profile. (Answer: Standardized centroid \((0.8,0.5)\); original-unit profile 24 kilometres and $100.)
  3. A feature with reference minimum 200 and maximum 500 has a min-max-scaled centroid coordinate of 0.3. A second feature ranges from 0 to 8 and has scaled centroid coordinate 0.75. Translate both coordinates and state which feature average is at the larger fraction of its reference range. (Answer: 290 and 6; the second feature is at the larger fraction, 0.75 versus 0.30.)
  4. Three features have reference means \(10,50,2\), positive scales \(4,10,0.5\), and standardized centroid coordinates \(0.5,-1,1.2\), respectively. Find the original-unit centroid and describe each coordinate relative to its reference mean. (Answer: \((12,40,2.6)\); the coordinates are 2 above, 10 below, and 0.6 above their respective reference means.)
  5. A cluster has three members with feature pairs \((30,2)\), \((45,5)\), and \((60,8)\). The features were standardized with means 40 and 4 and scales 10 and 2. Calculate the standardized centroid, convert it to original units, and state the average differences from the reference means. (Answer: Standardized centroid \((0.5,0.5)\); original-unit centroid \((45,5)\), which is 5 above the first reference mean and 1 above the second.)
Clinical Biostats