ComenzarEmpieza gratis

Performing PCA

The next step in your analysis is to perform PCA on wisc.data.

You saw in the last chapter that it's important to check if the data need to be scaled before performing PCA. Recall two common reasons for scaling data:

  1. The input variables use different units of measurement.
  2. The input variables have significantly different variances.

Este ejercicio forma parte del curso

Unsupervised Learning in R

Ver curso

Instrucciones del ejercicio

The variables you created before, wisc.data and diagnosis, are still available in your workspace.

  • Check the mean and standard deviation of the features of the data to determine if the data should be scaled. Use the colMeans() and apply() functions like you've done before.
  • Execute PCA on the wisc.data, scaling if appropriate, and assign the model to wisc.pr.
  • Inspect a summary of the results with the summary() function.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Check column means and standard deviations



# Execute PCA, scaling if appropriate: wisc.pr


# Look at summary of results
Editar y ejecutar código