Skip to content
Glacius
StatisticsConcept reference

Component scores

Principal-component scores are dot products of centered observations with the chosen unit principal directions.

On this page 9 sections
  1. Overview
  2. A PCA direction specifies an axis
  3. Include every feature in every dot product
  4. For raw row (5,6) and training means (2,2), first center to (3,4)
  5. A closer look
  6. Key takeaway
  7. Further questions
  8. Sources & further reading
  9. Concept connections

01A PCA direction specifies an axis#

A PCA direction specifies an axis. A score says where one observation lies along that axis. Transforming many observations with the same directions gives new features that can be plotted or passed to another model. Scores can be positive, negative, or zero.

The axes pass through the training mean. First subtract that mean from a raw observation. Then dot the centered vector with each chosen unit direction. A dot product includes every original feature, even when only one new score is requested.

A principal-component score is a coordinate, not a direction vector. For a centered observation, take one dot product with each chosen unit principal direction, in order.

zj=xcvjz_j=x_c\cdot v_j

For xc=(3,4)x_c=(3,4) and directions (0.6,0.8);(0.8,0.6)(0.6,0.8);(-0.8,0.6), the first score is 1.8+3.2=51.8+3.2=5. The second is 2.4+2.4=0-2.4+2.4=0.

Centered observation x=(3,4) equals 5v1 for unit v1=(.6,.8). Perpendicular v2=(−.8,.6) has zero dot product with x. Thus PCA scores are (5,0), the coordinates along the orthonormal directions.Centered observation x=(3,4) equals 5v1 for unit v1=(.6,.8). Perpendicular v2=(−.8,.6) has zero dot product with x. Thus PCA scores are (5,0), the coordinates along the orthonormal directions.
Figure 1Centered observation x=(3,4) equals 5v1 for unit v1=(.6,.8). Perpendicular v2=(−.8,.6) has zero dot product with x. Thus PCA scores are (5,0), the coordinates along the orthonormal directions.
Link to this figure ↗Download SVGDownload PNG

For centered xc=(3,4)x_c=(3,4), the first direction (0.6,0.8)(0.6,0.8) gives 3(0.6)+4(0.8)=1.8+3.2=53(0.6)+4(0.8)=1.8+3.2=5. The second direction (0.8,0.6)(-0.8,0.6) gives 2.4+2.4=0-2.4+2.4=0. The observation lies entirely along the first axis, even though both original feature values are nonzero.

Check your reasoning

Centered row (2,3)(2,3). Ordered PCs: (0.6,0.8)(0.6,0.8); (0.8,0.6)(-0.8,0.6). Scores?

  1. A(1.2,1.6)(1.2,-1.6)
  2. B(3.6,0.2)(3.6,0.2)
  3. C(2,3)(2,3)
Show answer and explanation
(3.6,0.2)(3.6,0.2)

Dots: (3.6,0.2)(3.6,0.2).

02Include every feature in every dot product#

Include every feature in every dot product. A zero score can mean the observation is perpendicular to that component; it does not mean the observation is the zero vector. Scores differ from the original feature values.

Check your reasoning

Centered row (4,1)(4,1). Ordered PCs: (0.6,0.8)(0.6,0.8); (0.8,0.6)(-0.8,0.6). Claim: (2.4,3.2)(2.4,-3.2) uses only feature 1. Repair.

  1. A(3.2,2.6)(3.2,-2.6)
  2. B(2.4,3.2)(2.4,-3.2)
  3. C(4,1)(4,1)
Show answer and explanation
(3.2,2.6)(3.2,-2.6)

Dots: (3.2,2.6)(3.2,-2.6).

03For raw row (5,6) and training means (2,2), first center to (3,4)#

For raw row (5,6)(5,6) and training means (2,2)(2,2), first center to (3,4)(3,4). With directions (0.6,0.8);(0.8,0.6)(0.6,0.8);(-0.8,0.6), the scores are (5,0)(5,0). Projecting the raw row would measure from the wrong origin.

Check your reasoning

Raw row (6,4)(6,4); training means (1,2)(1,2). Ordered PCs: (0.6,0.8)(0.6,0.8); (0.8,0.6)(-0.8,0.6). Scores?

  1. A(6.8,2.4)(6.8,-2.4)
  2. B(4.6,2.8)(-4.6,2.8)
  3. C(4.6,2.8)(4.6,-2.8)
Show answer and explanation
(4.6,2.8)(4.6,-2.8)

Dots: (4.6,2.8)(4.6,-2.8).

04A closer look#

A new sensor reading must use the training means and training directions in the same order as earlier readings. Otherwise its scores would use a different coordinate system. Keeping just the first score reduces this example from two features to one; keeping both preserves its centered coordinates.

Key takeaway

Center with training means if needed. Dot the centered observation with each chosen principal direction, in order.

  • Project centered observations into a chosen principal-component basis.

Further questions

Are scores the same as a reconstructed observation?
No. Scores are coordinates in the chosen component basis. Reconstruction combines those coordinates with the basis vectors; that is a separate operation.

Sources & further reading

  1. [1]
  2. [2]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Component scores.” Math behind ML. /learn/s-pca-scores