Demo post. The numbers, code, formulas, and figures only show typesetting. They are not experimental results and do not represent an institution.

机器学习English

Demo: A toy note on one PCA step

This page is demo content, so the math typesetting can be checked. Nothing here is a finding, a benchmark, or a paper. There is no data matrix behind the symbols.

A direction, not a result

Suppose XX has one row per sample and one column per feature, and each column is already centered. A unit vector ww gives the scores XwXw. One textbook way to write the first principal-component direction is

w1=arg⁡max⁡∥w∥=1Var(Xw).w_1 = \arg\max_{\|w\| = 1} \mathrm{Var}(Xw).

For centered columns that variance is proportional to w⊤X⊤Xww^{\top} X^{\top} X w. With the usual 1/(n−1)1/(n-1) scaling, the same direction is a leading eigenvector of

Σ=1n−1X⊤X,Σw1=λ1w1.\Sigma = \frac{1}{n-1} X^{\top} X, \qquad \Sigma w_1 = \lambda_1 w_1.

Here λ1\lambda_1 is the variance along that axis. A metabolomics matrix would also need a decision about how to scale columns before this step, for example Pareto scaling. This note does not make that decision, and it does not use any measured concentrations.

What is missing on purpose

There is no scree plot, no percentage of variance, and no rule for how many components to keep. Those belong in a real analysis, with a real matrix and a sentence about what the samples were. When you replace this file, cite a textbook you actually use, or derive the step in your own words.