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

Fix reg() #29

Merged
merged 4 commits into from
Mar 1, 2024
Merged

Fix reg() #29

merged 4 commits into from
Mar 1, 2024

Conversation

wleoncio
Copy link
Member

@wleoncio wleoncio commented Mar 1, 2024

This should close issue #28.

The translation of the original R definition of reg() was done in commit d4e3ef1, but that version incorrectly assigns the slope of new1 instead of the intercept to beta01(e). This is fixed here.

wleoncio added 2 commits March 1, 2024 13:52
The translation of the original R definition of `reg()` was done in
d4e3ef1, but that version incorrectly
assigns the slope of `new1` instead of the intercept to `beta01(e)`.
This is fixed here
@wleoncio wleoncio requested a review from Theo-qua March 1, 2024 13:22
wleoncio added 2 commits March 1, 2024 14:25
The usage is discouraged and problematic when `r` has one column. Thankfully caught by CodeFactor.
@wleoncio
Copy link
Member Author

wleoncio commented Mar 1, 2024

BTW, even without #17 being implemented on main, it seems like the C++ version is much faster than the R one. For legacy = FALSE I got an elapsed time of 34 s versus 111 s on the legacy code. Do you also get that?

@Theo-qua Theo-qua merged commit a4dbea8 into main Mar 1, 2024
7 checks passed
@wleoncio wleoncio deleted the fix-reg branch March 1, 2024 13:51
@Theo-qua
Copy link
Collaborator

Theo-qua commented Mar 4, 2024

I agree with you that the c++ seems faster than the original R now. However, when I try with the huge X matrix, it seems to be slower. I checked with this

system.time( fit<-MADMMplasso(X,Z,y,alpha=alpha,my_lambda=NULL,lambda_min=0.01,max_it=5000,e.abs=e.abs,e.rel=e.rel,maxgrid=50,nlambda = nlambda, rho=5,tree = TT,my_print = F,alph=1,parallel =F,pal=1,gg=gg1,tol=tol,cl=6) )

instead of

system.time( fit<-MADMMplasso(X=X[,c(1:100)],Z,y,alpha=alpha,my_lambda=NULL,lambda_min=0.01,max_it=5000,e.abs=e.abs,e.rel=e.rel,maxgrid=50,nlambda = nlambda, rho=5,tree = TT,my_print = F,alph=1,parallel =F,pal=1,gg=gg1,tol=tol,cl=6) )

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

Successfully merging this pull request may close these issues.

2 participants