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

Standardize covars matrix only once #3

Closed
AsafManela opened this issue Dec 18, 2018 · 0 comments
Closed

Standardize covars matrix only once #3

AsafManela opened this issue Dec 18, 2018 · 0 comments

Comments

@AsafManela
Copy link
Owner

dmr and hdmr calls by default standardize the covars matrix, because they call fit(GammaLassoPath,...) on each column of counts, which standardizes its X (=covars) matrix upon entry by default.
This means we are needlessly repeating this Lasso.standardizeX call multiple times. See relevant part of Lasso.jl

A better solution would:

  1. check for the keyword argument standardize in dmr/hdmr calls
  2. standardize if requested before calling fit(GammaLassoPath,...) with standardize=false, keeping track of Xnorm
  3. multiply coefs by Xnorm as in [Lasso.jl] (https://github.com/JuliaStats/Lasso.jl/blob/55718966db53679e333d8a94749e8722b082796c/src/coordinate_descent.jl#L847). Specifically,
    3.1 If returning DMRCoefs/HDMRCoefs (called with dmr/hdmr), then we only keep the coeffcients, so just multiply these in place by Xnorm
    3.2 If returning DMRPaths/HDMRPaths (called with dmrpaths/hdmrpaths), then we need to modify path.coefs for each path.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant