Skip to content
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

Understanding PCA using Stack Overflow data | Julia Silge #74

Open
utterances-bot opened this issue Aug 8, 2022 · 4 comments
Open

Understanding PCA using Stack Overflow data | Julia Silge #74

utterances-bot opened this issue Aug 8, 2022 · 4 comments

Comments

@utterances-bot
Copy link

Understanding PCA using Stack Overflow data | Julia Silge

A data science blog

https://juliasilge.com/blog/stack-overflow-pca/

Copy link

Hi Julia!
Since Tidy.numeric is deprecated, how do you replace "tidy" downhere?

library(broom)

tidied_pca <- bind_cols(Tag = colnames(tags_scaled),
tidy(tags_pca$rotation)) %>%
gather(PC, Contribution, PC1:PC64)

tidied_pca

Thanks again for your help and btw are you coming someday to Europe? :-)

@juliasilge
Copy link
Owner

@PatoLocos Can you use the broom tidiers, like tidy(tags_pca, matrix = "rotation")?

library(broom)

x  <- matrix(rnorm(200), nrow = 20)
pc <- irlba::prcomp_irlba(x, n = 3)
tidy(pc, matrix = "rotation")
#> # A tibble: 30 × 3
#>    column    PC   value
#>     <int> <dbl>   <dbl>
#>  1      1     1 -0.575 
#>  2      1     2 -0.176 
#>  3      1     3 -0.175 
#>  4      2     1  0.126 
#>  5      2     2  0.146 
#>  6      2     3 -0.319 
#>  7      3     1 -0.349 
#>  8      3     2 -0.110 
#>  9      3     3 -0.0494
#> 10      4     1 -0.0242
#> # … with 20 more rows
#> # ℹ Use `print(n = ...)` to see more rows

Created on 2022-08-08 by the reprex package (v2.0.1)

Copy link

Hi,
It worked fine. I guess no conferences then in Europe? here (Norway) we have the OsloUseR group, it will be such a privilige if you could come Julia! but usually the big conferences are in Sweden or Denmark. :-(

@juliasilge
Copy link
Owner

@PatoLocos I haven't traveled outside the US since before the pandemic but I am starting to maybe feel ready. We'll see!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants