






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







In this set of notes, we will develop a method, Principal Components Analysis (PCA), that tries to identify the subspace in which the data approximately lies. PCA is computationally efficient: it will require only an eigenvector calculation (easily done with the eig function in Matlab). Suppose we are given a dataset {x(i); i = 1,... , n} of attributes of n dif- ferent types of automobiles, such as their maximum speed, turn radius, and so on. Let x(i)^ ∈ Rd^ for each i (d n). But unknown to us, two different attributes—some xi and xj —respectively give a car’s maximum speed mea- sured in miles per hour, and the maximum speed measured in kilometers per hour. These two attributes are therefore almost linearly dependent, up to only small differences introduced by rounding off to the nearest mph or kph. Thus, the data really lies approximately on an n − 1 dimensional subspace. How can we automatically detect, and perhaps remove, this redundancy? For a less contrived example, consider a dataset resulting from a survey of pilots for radio-controlled helicopters, where x( 1 i )is a measure of the piloting
skill of pilot i, and x( 2 i )captures how much he/she enjoys flying. Because RC helicopters are very difficult to fly, only the most committed students, ones that truly enjoy flying, become good pilots. So, the two attributes x 1 and x 2 are strongly correlated. Indeed, we might posit that the data actually lies along some diagonal axis (the u 1 direction) capturing the intrinsic piloting “karma” of a person, with only a small amount of noise lying off this axis. (See figure.) How can we automatically compute this u 1 direction?
x 1
x^2
(enjoyment)
(skill)
1
u
u
2
We will shortly develop the PCA algorithm. But prior to running PCA per se, typically we first preprocess the data by normalizing each feature to have mean 0 and variance 1. We do this by subtracting the mean and dividing by the empirical standard deviation:
x( ji )←
x( ji )− μj σj
where μj = (^1) n
∑n i=1 x
(i) j and^ σ
2 j =^
1 n
∑n i=1(x
(i) j −^ μj^ )
(^2) are the mean variance of
feature j, respectively. Subtracting μj zeros out the mean and may be omitted for data known to have zero mean (for instance, time series corresponding to speech or other acoustic signals). Dividing by the standard deviation σj rescales each coor- dinate to have unit variance, which ensures that different attributes are all treated on the same “scale.” For instance, if x 1 was cars’ maximum speed in mph (taking values in the high tens or low hundreds) and x 2 were the num- ber of seats (taking values around 2-4), then this renormalization rescales the different attributes to make them more comparable. This rescaling may be omitted if we had a priori knowledge that the different attributes are all on the same scale. One example of this is if each data point represented a grayscale image, and each x( ji )took a value in { 0 , 1 ,... , 255 } corresponding to the intensity value of pixel j in image i. Now, having normalized our data, how do we compute the “major axis of variation” u—that is, the direction on which the data approximately lies? One way is to pose this problem as finding the unit vector u so that when