Setting up principal component analysis

  1. Before getting into non-linear manifolds, let's analyze principal component analysis on the occupancy data:
# Setting-up principal component analysis pca_obj <- prcomp(occupancy_train$data,                 center = TRUE,                 scale. = TRUE)                 scale. = TRUE)
  1. The preceding function will transform the data into six orthogonal directions specified as linear combinations of features. The variance explained by each dimension can be viewed using the following script:
plot(pca_obj, type = "l")
  1. The preceding command will plot the variance across principal components, as shown in the following figure:
  1. For the occupancy dataset, ...

Get R Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.