SVM应用——人脸识别 #下载数据 from sklearn.datasets import fetch_lfw_people faces = fetch_lfw_people(min_faces_per_person=60) print(faces.target_names) print(faces.images.shape) #输出结果 ['Ariel Sharon' 'Colin Powell' 'Donald Rumsfeld' 'George W Bush' 'Gerhard Schroeder' 'Hugo Chavez' 'Junichiro Koizumi' 'Tony Blair'] (1348, 62, 47) #画一些人脸,看看需要处理的数据 import matplotlib.pyplot as plt import seaborn as sns;sns.set() fig, ax = plt.subplots(3,5) fig.subplots_adjust(left=0.0625, right=1.2, wspace=1) for i, axi in enumerate(ax.flat): axi.imshow(faces.images[i], cmap=