Jan. 17, 2022, 10:58 p.m. | /u/dsivertsen54

Data Science www.reddit.com

Hey everyone,

I recently ran a PLSR in R. I was wondering, given the number of components that it produces, can the components be extracted and put into a data frame? For example, if I ran a PCA I could do:

my_pca <- prcomp(~., data = data[, c(x1:xN)], scale = TRUE)

(loadings <- my_pca$rotation)

pca_var <- predict(my_pca, newdata = data[, c(x1:xN)])

head(pca_var)

data <- cbind(data, z_pca_var)

to put the principal components into my data set (so that I can then …

datascience least regression squares

Senior Machine Learning Engineer (MLOps)

@ Promaton | Remote, Europe

Data Analyst (CPS-GfK)

@ GfK | Bucharest

Consultant Data Analytics IT Digital Impulse - H/F

@ Talan | Paris, France

Data Analyst

@ Experian | Mumbai, India

Data Scientist

@ Novo Nordisk | Princeton, NJ, US

Data Architect IV

@ Millennium Corporation | United States