@@ -43,6 +43,30 @@ import SparseArrays
4343 @test reconstruct (M, Y[:,1 ]) ≈ P * Y[:,1 ]
4444 @test reconstruct (M, Y) ≈ P * Y
4545
46+ @test repr (" text/plain" , M) == """
47+ PCA(indim = 5, outdim = 3, principalratio = 0.8)
48+
49+ Pattern matrix (unstandardized loadings):
50+ ─────────────────────────────────
51+ PC1 PC2 PC3
52+ ─────────────────────────────────
53+ 1 -0.236399 0.706558 1.21106
54+ 2 1.27426 0.047799 0.212282
55+ 3 0.990598 -1.22718 0.882179
56+ 4 -1.51861 -0.725771 0.631665
57+ 5 0.181386 1.21069 0.557706
58+ ─────────────────────────────────
59+
60+ Importance of components:
61+ ───────────────────────────────────────────────────
62+ PC1 PC2 PC3
63+ ───────────────────────────────────────────────────
64+ SS Loadings (Eigenvalues) 5.0 4.0 3.0
65+ Variance explained 0.333333 0.266667 0.2
66+ Cumulative variance 0.333333 0.6 0.8
67+ Proportion explained 0.416667 0.333333 0.25
68+ Cumulative proportion 0.416667 0.75 1.0
69+ ───────────────────────────────────────────────────"""
4670
4771 # # PCA with non-zero mean
4872
0 commit comments