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

Centering issue sPCA #11

Open
cicadawing opened this issue Apr 5, 2024 · 0 comments
Open

Centering issue sPCA #11

cicadawing opened this issue Apr 5, 2024 · 0 comments

Comments

@cicadawing
Copy link

Hi there,

I get this warning I get when I apply SPC. I ran SPC.cv with centering=TRUE, and did not get this warning. But when I run SPC with centering=TRUE, I get the warning below.

I just wanted to confirm whether SPC applies centering in SPC and SPC.cv, or whether users have to center the data prior to input? In which case I would just be a bit concerned about data leakage for SPC.cv in particular (ie. following the iterative deflation method in particular).


> regularisation_values <- seq(1, sqrt(ncol(x)), len=30)

> PC1_regularisation_cv <- SPC.cv(as.matrix(x), sumabsvs=regularisation_values, nfolds=10, trace=TRUE, center=TRUE, niter=100, orth=TRUE)

 Fold  1  out of  10

 Fold  2  out of  10

 Fold  3  out of  10

 Fold  4  out of  10

 Fold  5  out of  10

 Fold  6  out of  10

 Fold  7  out of  10

 Fold  8  out of  10

 Fold  9  out of  10

 Fold  10  out of  10

 

> PC1_regularisation_cv$nfolds

[1] 10

> best_reg <- PC1_regularisation_cv$bestsumabsv1se

> PC_regularisation_cv_applied <- SPC(as.matrix(x), sumabsv=best_reg, K=25, center=TRUE, orth=TRUE, cnames=colnames(x))

1234567

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

1234567891011121314151617181920

Warning message:

In PMDL1L1(x, sumabsu = sqrt(nrow(x)), sumabsv = sumabsv, niter = niter,  :

  PMDL1L1 was run without first subtracting out the mean of x.

Best wishes

T

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

1 participant