O'Reilly logo

R Deep Learning Cookbook by Achyutuni Sri Krishna Rao, Dr. PKS Prakash

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required