from sklearn.datasets import fetch_lfw_people
lfw = fetch_lfw_people(data_home='./scikit_learn_data/',color=True , min_faces_per_person=100)
lfw.keys()
lfw.data.shape
lfw.images.shape
lfw.images.dtype
lfw.target
lfw.target_names
from matplotlib import pyplot as plt
plt.subplots_adjust(wspace=0.2, hspace=0.6)
for i in range(3):
subplt = plt.subplot(1,3, i+1)
subplt.imshow(lfw.images[i]/255) # RGBデータ表示の場合、floatは[0 - 1]でclipされるので、[0 - 1]に正規化して表示する
subplt.set_title(lfw.target_names[lfw.target[i]])
plt.savefig('.\lfw_color.jpg')
plt.show()