-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCA and UMAP with tidymodels and #TidyTuesday cocktail recipes | Julia Silge #40
Comments
Thank you so much Julia. I think this video and content is great as intuitive explanation of PCA and how to implement and visualize it well in RStudio. |
Hi Julia, this tidy workflow is very interesting and I am using it more and more. |
@portolan75 Is it this problem that you are seeing? Or something else? If it is something else, then I suggest that you create a reprex (a minimal reproducible example) for the problem you are observing, and post it on RStudio Community. The goal of a reprex is to make it easier for us to recreate your problem so that others can understand it. If you've never heard of a reprex before, you may want to start with the tidyverse.org help page. You may already have reprex installed (it comes with the tidyverse package), but if not you can install it with: install.packages("reprex") Thanks! 🙌 |
Hi @juliasilge , thanks for your answer. |
All this work is so brilliant @juliasilge. Are there are any literature, book chapters, articles, videos on PCA interpretation you can recommend? |
|
Thank you for the fantastic tutorial |
@Kasramhdz The |
I have another question, rec <- recipe( ~ ., data = USArrests) %>% prep(rec) %>% tidy(number = 2, type = "coef") %>% |
@Kasramhdz The full PCA is determined (so you can still compute the variances of each term) and library(recipes)
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#>
#> Attaching package: 'recipes'
#> The following object is masked from 'package:stats':
#>
#> step
rec <- recipe( ~ ., data = USArrests) %>%
step_normalize(all_numeric()) %>%
step_pca(all_numeric(), num_comp = 2, options = list(rank. = 2))
prep(rec) %>% tidy(number = 2, type = "coef")
#> # A tibble: 8 × 4
#> terms value component id
#> <chr> <dbl> <chr> <chr>
#> 1 Murder -0.536 PC1 pca_T11OM
#> 2 Assault -0.583 PC1 pca_T11OM
#> 3 UrbanPop -0.278 PC1 pca_T11OM
#> 4 Rape -0.543 PC1 pca_T11OM
#> 5 Murder 0.418 PC2 pca_T11OM
#> 6 Assault 0.188 PC2 pca_T11OM
#> 7 UrbanPop -0.873 PC2 pca_T11OM
#> 8 Rape -0.167 PC2 pca_T11OM Created on 2022-01-12 by the reprex package (v2.0.1) You could also control this via the |
PCA and UMAP with tidymodels and #TidyTuesday cocktail recipes | Julia Silge
Use tidymodels for unsupervised dimensionality reduction.
https://juliasilge.com/blog/cocktail-recipes-umap/
The text was updated successfully, but these errors were encountered: