반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- html
- 데이터전문기관
- java역사
- tensorflow
- 웹 용어
- postorder
- vscode
- mglearn
- broscoding
- paragraph
- KNeighborsClassifier
- web
- Keras
- discrete_scatter
- pycharm
- web 사진
- inorder
- CES 2O21 참가
- classification
- cudnn
- C언어
- 머신러닝
- bccard
- 재귀함수
- web 용어
- web 개발
- CES 2O21 참여
- 대이터
- 결합전문기관
- 자료구조
Archives
- Today
- Total
bro's coding
sklearn.decomposition.PCA.picture.recover 본문
반응형
https://broscoding.tistory.com/175
from sklearn.decomposition import PCA
pca=PCA(100)
pca.fit(X_people)
X_pca=pca.transform(X_people)
pca_com=pca.components_[0]
plt.figure(figsize=[15,15])
for i in range(25):
pca_com=pca.components_[i]
plt.subplot(5,5,i+1)
plt.imshow(pca_com.reshape(87,-1),cmap='gray')
# 얼굴 재구성
X_recover=X_pca@pca.components_ # 변환한 값 @
X_recover
fig=plt.figure(figsize=[10,4])
for i in range(5):
plt.subplot(2,5,i+1)
plt.imshow(X_people[i].reshape(87,65),cmap='gray')
plt.axis('off')
plt.subplot(2,5,i+6)
plt.imshow(X_recover[i].reshape(87,-1),cmap='gray')
plt.axis('off')
반응형
'[AI] > python.sklearn' 카테고리의 다른 글
sklearn.manifold. TSNE (0) | 2020.04.23 |
---|---|
sklearn.neighbors.KNeighborsClassifier.mnist (0) | 2020.04.23 |
sklearn.PCA(2)를 이용한 digit data visualization (0) | 2020.04.23 |
sklearn.datasets.load_digits (0) | 2020.04.23 |
sklearn.datasets.fetch_lfw_people (0) | 2020.04.22 |
sklearn.naive_bayes.BernoulliNB (0) | 2020.04.21 |
sklearn.ensemble .GradientBoostingClassifier (0) | 2020.04.21 |
sklearn.decomposition.PCA.dimension(30->2) (0) | 2020.04.21 |
Comments