LoslegenKostenlos loslegen

PCA - dimension reduction

In the previous exercise, you worked on a dataset with two variables. During an interview, you are likely to face a bigger dataset.

PCA allows reducing the number of variables without significant loss of informational value.

PCA returns the dataset of the same size as your original dataset. It's up to you, how many variables to keep!

The following parameters of prcomp() reduce dimensions based on:

  • tol - the standard deviation as percentage of the first component's standard deviation,
  • rank - the maximal number of components.

The letters dataset contains numerical attributes of letters.

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.

# Perform PCA on letters
pca_letters <- ___(letters)

# Output spread measures of principal components
___(pca_letters)
Code bearbeiten und ausführen