Exercise

Separating house prices with PCA

PCA and t-SNE are both feature extraction techniques, but PCA can only capture the linear structure of the data. In this exercise, you will create a PCA plot of the full house_sales_df so you can compare its result with the t-SNE output.

Remember that price is the target variable in house_sales_df. It is important to remove it before fitting PCA to the data.

The tidyverse and ggfortify packages have been loaded for you.

Instructions

100 XP
  • Fit a PCA to the predictors of house_sales_df.
  • Use autoplot() to plot the first two PCs and encode price in color.