Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Principal components analysis (PCA) is a standard technique for dimensionality reduction. PCA provides a way to find a lower-dimensional representation of a dataset which preserves

image text in transcribedimage text in transcribed

Principal components analysis (PCA) is a standard technique for dimensionality reduction. PCA provides a way to find a lower-dimensional representation of a dataset which preserves as much of the variance of the original data as possible. This approach is often applied to representing sets of images. In this problem we will apply it to representing faces. When applied to face images, the resulting principal components are often called "eigenfaces." The datafile faces.npy contains a single array, faces . Each row in the array corresponds to an image of a face. Each column in the array corresponds to a pixel ID. The entries in the array correspond to pixel intensities. The provided function plot_face automatically reshapes a 361-dimensional row vector of pixel intensities back into a 19 x 19 image and plots it. The code below loads the data and plots 25 random faces : # Load in the face data and plot some random faces facesnp.load ("data/faces.npy") fig, axesplt.subplots (5, 5) ix np.random.randint(e, faces.shape[e], 25) for i in range (25): plot face (axes.flat[i], faces[ix[i]]) We also can plot the "average face" for the dataset. This is the "face" that is produced when we average across each of the faces (rows) in the faces array. # Plot average face fig, axis -plt.subplots () plot_face(axis, np mean(faces, axis*e))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What does it mean if a bond is callable?

Answered: 1 week ago

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

How was your life influenced by those events?

Answered: 1 week ago

Question

Which of these influenced your life most dramatically?

Answered: 1 week ago