January 2018
Beginner to intermediate
316 pages
7h 14m
English
We have 1,288 rows by 1,850 columns. To do some brief exploratory analysis, we can plot one of the images by using this code:
# plot one of the faces plt.imshow(X[0].reshape((h, w)), cmap=plt.cm.gray) lfw_people.target_names[y[0]]
This will give us the following label:
'Hugo Chavez'
The image is as follows:

Now, let's plot the same image after applying a scaling module, as follows:
plt.imshow(StandardScaler().fit_transform(X)[0].reshape((h, w)), cmap=plt.cm.gray) lfw_people.target_names[y[0]]
Which gives us this output:
Here, you can see that the image ...
Read now
Unlock full access