#load dataset
lfw_people = fetch_lfw_people(min_faces_per_person=53, resize=0.4)
# introspect the images arrays to find the shapes (for plotting)
n_samples, h, w = lfw_people.images.shape
# for machine learning we use the 2 data directly (as relative pixel
# positions info is ignored by this model)
# access the images
X = lfw_people.data
n_features = X.shape[1]
# the label to predict is the id of the person
# access the class labels
y = lfw_people.target
target_names = lfw_people.target_names
n_classes = target_names.shape[0]
print("Total dataset size:")
print("number of samples: " , n_samples)
print("number of classes: " , n_classes)
print("image dimensions: ", h, w)
print("number of features per image: ", h*w)
lfw_people.target_names
** array (['Ariel Sharon', 'Colin Powell', 'Donald Rumsfeld', 'George W. Bu sh', 'Gerhard Schroeder', 'Hu go Chavez', 'Jean Chretien ',' John Ashcroft ',' Junichiro Koizumi ',' Tony Blair '], dtype ='