LoslegenKostenlos loslegen

PCA - rotation

Principal Component Analysis allows you to reduce the number of dimensions in a dataset, which speeds up calculation time without significant loss of informational value.

You may expect questions on PCA during the interview if your future role involves handling vast amounts of data.

Recall that in PCA the variables are transformed into principal components. The first principal component has the largest possible variance.

You will perform PCA using the cats dataset that you have already encountered in the previous exercises.

In this exercise, use prcomp() to perform the principal component analysis. The returned object can be used to predict the rotated variables.

Diese Übung ist Teil des Kurses

Practicing Statistics Interview Questions in R

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Plot the unrotated data
___(___ ~ Hwt, data = ___)

# Perform PCA
pca_cats <- ___(~ ___ + Hwt, data = ___)

# Compute the summary
___(___)
Code bearbeiten und ausführen