타깃을 모르는 비지도 학습
과일 사진 데이터 준비하기
# 데이터 불러오기
!wget <https://bit.ly/fruits_300_data> -O fruits_300.npy
# 데이터 준비
import numpy as np
import matplotlib.pyplot as plt
fruits = np.load('fruits_300.npy')
print(fruits.shape)
<aside> 💡 (300, 100, 100)
</aside>
⇒ 사진의 픽셀값 데이터

# 첫 번째 이미지의 첫 번째 행 출력
print(fruits[0,0,:])
# 첫 번째 이미지 그리기
plt.imshow(fruits[0], cmap='gray') ### 흑백 이미지
plt.show()


흑백 샘플 이미지 : 보통 바탕이 밝고, 물체가 짙은 색
→ But, 출력 이미지 : 사진의 이미지를 넘파이 배열로 변환할 때 반전시킴 !
⇒ 관심 대상이 ‘물체’이기 때문 !
데이터의 과일 사진 종류 : 사과, 파인애플, 바나나
# 사과 외에 파인애플, 바나나 이미지도 그리기
fig, axs = plt.subplots(1,3)
axs[0].imshow(fruits[0], cmap='gray_r')
axs[1].imshow(fruits[100], cmap='gray_r')
axs[2].imshow(fruits[200], cmap='gray_r')
plt.show()
