Unsupervised learning
PRINCIPAL COMPONENTS ANALYSIS
apply(): allows us to apply a function (here mean() function)
1 = mean of the rows, 2 = mean of the columns
prcomp(): performs principal components analysis
By default, prcomp() will center the variables to have mean zero
pr.out$rotation: provides principal component loadings
prcomp(): no need to multiply data by principal component loading vectors in order
to obtain the principal component score vectors => x has its columns principal
component score vectors(kth column is kth principal component score vector)
plot first two principal components
Scale = 0 : ensures that arrows are scaled to represent the loadings
PRINCIPAL COMPONENTS ANALYSIS
apply(): allows us to apply a function (here mean() function)
1 = mean of the rows, 2 = mean of the columns
prcomp(): performs principal components analysis
By default, prcomp() will center the variables to have mean zero
pr.out$rotation: provides principal component loadings
prcomp(): no need to multiply data by principal component loading vectors in order
to obtain the principal component score vectors => x has its columns principal
component score vectors(kth column is kth principal component score vector)
plot first two principal components
Scale = 0 : ensures that arrows are scaled to represent the loadings