"Scree Plot" ์ ๋ํด์ ์์๋ณด๊ณ , ์์์ PCA๋ก ๋ง๋ ๋ฐ์ดํฐ์ ์ ์ฌ์ฉํ์ฌ ๋ง๋ค์ด๋ณด์ธ์. 90%์ ๋ด์ฉ์ ์ค๋ช ํ๊ธฐ ์ํด์, ๋ช๊ฐ์ PC๋ฅผ ์ฌ์ฉํด์ผ ํ๋์?
- ์์ ์ฌ๋ฌ ๊ณผ์ ์ ์๋ตํ๊ฒ ์ต๋๋ค. :)
- ๋จผ์ ๊ฐ ์ฃผ์ฑ๋ถ์ ๋ํ ์์ด๊ฒ๋ฒจ๋ฅ๊ฐ์ ๋ชจ๋ ๋ํ๊ณ ๋๋ , ๊ฐ๊ฐ์ proportion์ ๊ณ์ฐํฉ๋๋ค.
values = values / np.sum(values)
# ์ ์ ๊ฐ์ ์๊ฐํ
plt.title('Scree plot')
plt.xlabel('numberofcomp')
plt.ylabel('proposion')
plt.plot(values);
- ๊ฐ๊ฐ์ ๊ณ ์ ๊ฐ์ ๋น์ค์ ๊ณ์ฐํด๋ด ๋๋ค.
print(values[:2].sum())
print(values[:3].sum())
0.8815679694372629 # ์ฃผ์ฑ๋ถ์ pc1, pc2 2๊ฐ๋ฅผ ๋ ๊ฒฝ์ฐ
0.9728769460402189 # ์ฃผ์ฑ๋ถ์ pc1, pc2, pc3 3๊ฐ๋ฅผ ๋ ๊ฒฝ์ฐ
์ฆ, ์ฃผ์ฑ๋ถ์ 3๊ฐ(์ถ์ 3๊ฐ)๊น์ง ์ฌ์ฉํด์ผ 90% ์ด์์ ์ ๋ณด๊ฐ ์ ์ง๋ฉ๋๋ค. :)
'๐ฟ Data > ์ด๋ชจ์ ๋ชจ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Cramer's rule(ํฌ๋ ์ด๋จธ ์๊ฑฐ๋ฒ) (0) | 2021.12.07 |
---|---|
๋ฒกํฐ ๋ด์ ๋ฐ projection (0) | 2021.12.07 |
Dendrogram์ ํตํ Clustering ์๊ฐํ ๋ฐ Elbow Method (0) | 2021.12.06 |
Clustering(๊ตฐ์งํ) (0) | 2021.12.06 |
Dimension Reduction(์ฐจ์ ์ถ์) (0) | 2021.12.04 |