Hotelling's T^2 scores in python
问题 I applied pca on a data set using matplotlib in python. However, matplotlib does not provide a t-squared scores like Matlab. Is there a way to compute Hotelling's T^2 score like Matlab? Thanks. 回答1: matplotlib's PCA class doesn't include the Hotelling T 2 calculation, but it can be done with just a couple lines of code. The following code includes a function to compute the T 2 values for each point. The __main__ script applies PCA to the same example as used in Matlab's pca documentation, so