Skip to content

Commit

Permalink
Support glmnet >= 3 (fixes CABSEL#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
omsai committed Nov 4, 2024
1 parent 60abc24 commit 15e2db7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protina_R/protina_v1.0_R/R/protina.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protina <- function(lfc,slope=NULL,pgn,grplist,kfold=10,par=FALSE,numCores=4){
}

cvfit <- cv.glmnet(Xin, y, alpha = 0, intercept = FALSE, nfolds = kfold)
coef.cvfit <- coef.cv.glmnet(cvfit,s='lambda.min')
coef.cvfit <- coef(cvfit,s='lambda.min')
Aj <- vector(mode = "integer",length = dim(Xin)[2])
Aj[coef.cvfit@i] <- coef.cvfit@x

Expand Down Expand Up @@ -101,7 +101,7 @@ protina <- function(lfc,slope=NULL,pgn,grplist,kfold=10,par=FALSE,numCores=4){
}

cvfit <- cv.glmnet(Xin, y, family='gaussian',alpha = 0, intercept = FALSE, nfolds = kfold)
coef.cvfit <- coef.cv.glmnet(cvfit,s='lambda.min')
coef.cvfit <- coef(cvfit,s='lambda.min')
Aj <- vector(mode = "integer",length = dim(Xin)[2])
Aj[coef.cvfit@i] <- coef.cvfit@x
A[j,ppar] <- Aj[1:(length(Aj)-m)]
Expand Down

0 comments on commit 15e2db7

Please sign in to comment.