...
 
Commits (5)
Package: starnet
Version: 0.0.1
Title: Stacked Elastic Net
Description: Implements stacked elastic net regression (Rauschenberger 2020). The elastic net generalises ridge and lasso regularisation (Zou 2005, <doi:10.1111/j.1467-9868.2005.00503.x>). Instead of fixing or tuning the mixing parameter alpha, we combine multiple alpha by stacked generalisation (Wolpert 1992 <doi:10.1016/S0893-6080(05)80023-1>).
Description: Implements stacked elastic net regression (Rauschenberger 2020, <doi:10.1093/bioinformatics/btaa535>). The elastic net generalises ridge and lasso regularisation (Zou 2005, <doi:10.1111/j.1467-9868.2005.00503.x>). Instead of fixing or tuning the mixing parameter alpha, we combine multiple alpha by stacked generalisation (Wolpert 1992 <doi:10.1016/S0893-6080(05)80023-1>).
Depends: R (>= 3.0.0)
Imports: glmnet, survival, cornet, joinet, Matrix
Suggests: knitr, testthat, rmarkdown
......
## starnet 0.0.1 (2019-11-14)
## starnet 0.0.1 (2020-05-26)
* first submission
\ No newline at end of file
* submission to CRAN
\ No newline at end of file
......@@ -68,9 +68,11 @@
#' A Rauschenberger, E Glaab, and MA van de Wiel (2020).
#' "Predictive and interpretable models via the stacked elastic net".
#' \emph{Bioinformatics}. In press.
#' \doi{10.1093/bioinformatics/btaa535}.
#' \email{armin.rauschenberger@uni.lu}
#'
#' @details
#' Posthoc feature selection\strong{:} consider
#' Post hoc feature selection\strong{:} consider
#' argument \code{nzero} in functions
#' \code{\link{coef}} and \code{\link{predict}}.
#'
......@@ -409,7 +411,7 @@ coef.starnet <- function(object,nzero=NULL,...){
pool$alpha <- meta$alpha + sum(meta$beta * base$alpha)
pool$beta <- base$beta %*% meta$beta
# posthoc selection
# post hoc selection
if(!is.null(nzero)){
eta <- as.numeric(pool$alpha + object$info$X %*% pool$beta)
if(stats::sd(eta)==0){return(list(alpha=pool$alpha,beta=0*pool$beta))}
......@@ -503,7 +505,7 @@ print.starnet <- function(x,...){
#' @param nzero
#' number of non-zero coefficients\strong{:}
#' scalar/vector including positive integer(s) or \code{NA};
#' or \code{NULL} (no posthoc feature selection)
#' or \code{NULL} (no post hoc feature selection)
#'
#' @param nfolds.ext,nfolds.int,foldid.ext,foldid.int
#' number of folds (\code{nfolds})\strong{:}
......@@ -537,8 +539,7 @@ print.starnet <- function(x,...){
#' y <- rnorm(n=n,mean=rowSums(X[,1:20]))
#' \dontshow{
#' loss <- cv.starnet(y=y,X=X,nfolds.ext=2,nfolds.int=3)}
#' \donttest{
#' loss <- cv.starnet(y=y,X=X)}
#' #loss <- cv.starnet(y=y,X=X)
#'
cv.starnet <- function(y,X,family="gaussian",nalpha=21,alpha=NULL,nfolds.ext=10,nfolds.int=10,foldid.ext=NULL,foldid.int=NULL,type.measure="deviance",alpha.meta=1,nzero=NULL,intercept=NULL,upper.limit=NULL,unit.sum=NULL,...){
......
......@@ -23,9 +23,9 @@
#'
#' @references
#' A Rauschenberger, E Glaab, and MA van de Wiel (2020).
#' Predictive and interpretable models via the stacked elastic net".
#' "Predictive and interpretable models via the stacked elastic net".
#' \emph{Bioinformatics}. In press.
#'
#' \doi{10.1093/bioinformatics/btaa535}.
#' \email{armin.rauschenberger@uni.lu}
#'
#' @examples
......
......@@ -40,4 +40,4 @@ devtools::install_github("rauschenberger/starnet")
## Reference
A Rauschenberger, E Glaab, MA van de Wiel (2020). "Predictive and interpretable models via the stacked elastic net". *Manuscript in preparation.*
A Rauschenberger, E Glaab, MA van de Wiel (2020). "Predictive and interpretable models via the stacked elastic net". *Bioinformatics*, btaa535. [doi: 10.1093/bioinformatics/btaa535](https://doi.org/10.1093/bioinformatics/btaa535).
......@@ -33,5 +33,6 @@ devtools::install_github("rauschenberger/starnet")
## Reference
A Rauschenberger, E Glaab, MA van de Wiel (2020). “Predictive and
interpretable models via the stacked elastic net”. *Manuscript in
preparation.*
interpretable models via the stacked elastic net”. *Bioinformatics*,
btaa535.
[doi: 10.1093/bioinformatics/btaa535](https://doi.org/10.1093/bioinformatics/btaa535).
# Notes
Thanks for checking the package.
- doi will be added after publication
\ No newline at end of file
- removed dontrun
- added value tags
\ No newline at end of file
......@@ -12,7 +12,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="Stacked Elastic Net">
<meta property="og:description" content="Implements stacked elastic net regression (Rauschenberger 2020). The elastic net generalises ridge and lasso regularisation (Zou 2005, &lt;doi:10.1111/j.1467-9868.2005.00503.x&gt;). Instead of fixing or tuning the mixing parameter alpha, we combine multiple alpha by stacked generalisation (Wolpert 1992 &lt;doi:10.1016/S0893-6080(05)80023-1&gt;).">
<meta property="og:description" content="Implements stacked elastic net regression (Rauschenberger 2020, &lt;doi:10.1093/bioinformatics/btaa535&gt;). The elastic net generalises ridge and lasso regularisation (Zou 2005, &lt;doi:10.1111/j.1467-9868.2005.00503.x&gt;). Instead of fixing or tuning the mixing parameter alpha, we combine multiple alpha by stacked generalisation (Wolpert 1992 &lt;doi:10.1016/S0893-6080(05)80023-1&gt;).">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
......@@ -97,7 +97,7 @@
<div id="reference" class="section level2">
<h2 class="hasAnchor">
<a href="#reference" class="anchor"></a>Reference</h2>
<p>A Rauschenberger, E Glaab, MA van de Wiel (2020). “Predictive and interpretable models via the stacked elastic net”. <em>Manuscript in preparation.</em></p>
<p>A Rauschenberger, E Glaab, MA van de Wiel (2020). “Predictive and interpretable models via the stacked elastic net”. <em>Bioinformatics</em>, btaa535. <a href="https://doi.org/10.1093/bioinformatics/btaa535">doi: 10.1093/bioinformatics/btaa535</a>.</p>
</div>
</div>
......
......@@ -123,11 +123,11 @@
<small>Source: <a href='https://github.com/rauschenberger/starnet/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="starnet-001-2019-11-14" class="section level2">
<div id="starnet-001-2020-05-26" class="section level2">
<h2 class="hasAnchor">
<a href="#starnet-001-2019-11-14" class="anchor"></a>starnet 0.0.1 (2019-11-14)</h2>
<a href="#starnet-001-2020-05-26" class="anchor"></a>starnet 0.0.1 (2020-05-26)</h2>
<ul>
<li>first submission</li>
<li>submission to CRAN</li>
</ul>
</div>
</div>
......
......@@ -5,5 +5,5 @@ articles:
article: article.html
script: script.html
starnet: starnet.html
last_built: 2020-05-26T11:47Z
last_built: 2020-05-26T12:41Z
......@@ -204,7 +204,7 @@ for elastic net regularisation;
<th>nzero</th>
<td><p>number of non-zero coefficients<strong>:</strong>
scalar/vector including positive integer(s) or <code>NA</code>;
or <code>NULL</code> (no posthoc feature selection)</p></td>
or <code>NULL</code> (no post hoc feature selection)</p></td>
</tr>
<tr>
<th>intercept</th>
......@@ -256,8 +256,8 @@ with the maximum number of non-zero coefficients shown in the column name.</p>
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/matrix.html'>matrix</a></span>(<span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/stats/Normal.html'>rnorm</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>mean</span><span class='kw'>=</span><span class='fu'><a href='https://rdrr.io/r/base/colSums.html'>rowSums</a></span>(<span class='no'>X</span>[,<span class='fl'>1</span>:<span class='fl'>20</span>]))
<span class='co'># \dontshow{</span>
<span class='no'>loss</span> <span class='kw'>&lt;-</span> <span class='fu'>cv.starnet</span>(<span class='kw'>y</span><span class='kw'>=</span><span class='no'>y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>,<span class='kw'>nfolds.ext</span><span class='kw'>=</span><span class='fl'>2</span>,<span class='kw'>nfolds.int</span><span class='kw'>=</span><span class='fl'>3</span>)<span class='co'># }</span></div><div class='img'><img src='cv.starnet-1.png' alt='' width='700' height='433' /></div><div class='input'><span class='co'># \donttest{</span>
<span class='no'>loss</span> <span class='kw'>&lt;-</span> <span class='fu'>cv.starnet</span>(<span class='kw'>y</span><span class='kw'>=</span><span class='no'>y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)<span class='co'># }</span></div><div class='img'><img src='cv.starnet-2.png' alt='' width='700' height='433' /></div><div class='input'>
<span class='no'>loss</span> <span class='kw'>&lt;-</span> <span class='fu'>cv.starnet</span>(<span class='kw'>y</span><span class='kw'>=</span><span class='no'>y</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>,<span class='kw'>nfolds.ext</span><span class='kw'>=</span><span class='fl'>2</span>,<span class='kw'>nfolds.int</span><span class='kw'>=</span><span class='fl'>3</span>)<span class='co'># }</span></div><div class='img'><img src='cv.starnet-1.png' alt='' width='700' height='433' /></div><div class='input'>#loss &lt;- cv.starnet(y=y,X=X)
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
......
......@@ -148,9 +148,11 @@ to open the vignette.</p>
<h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>
<p>A Rauschenberger, E Glaab, and MA van de Wiel (2020).
Predictive and interpretable models via the stacked elastic net".
<em>Bioinformatics</em>. In press.</p>
<p><a href='mailto:armin.rauschenberger@uni.lu'>armin.rauschenberger@uni.lu</a></p>
"Predictive and interpretable models via the stacked elastic net".
<em>Bioinformatics</em>. In press.
doi: <a href='https://doi.org/10.1093/bioinformatics/btaa535'>10.1093/bioinformatics/btaa535</a>
.
<a href='mailto:armin.rauschenberger@uni.lu'>armin.rauschenberger@uni.lu</a></p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'>#--- data simulation ---</span>
......
......@@ -227,14 +227,17 @@ contain <code><a href='https://rdrr.io/pkg/glmnet/man/cv.glmnet.html'>cv.glmnet<
for the base and meta learners, respectively.</p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Posthoc feature selection<strong>:</strong> consider
<p>Post hoc feature selection<strong>:</strong> consider
argument <code>nzero</code> in functions
<code><a href='https://rdrr.io/r/stats/coef.html'>coef</a></code> and <code><a href='https://rdrr.io/r/stats/predict.html'>predict</a></code>.</p>
<h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>
<p>A Rauschenberger, E Glaab, and MA van de Wiel (2020).
"Predictive and interpretable models via the stacked elastic net".
<em>Bioinformatics</em>. In press.</p>
<em>Bioinformatics</em>. In press.
doi: <a href='https://doi.org/10.1093/bioinformatics/btaa535'>10.1093/bioinformatics/btaa535</a>
.
<a href='mailto:armin.rauschenberger@uni.lu'>armin.rauschenberger@uni.lu</a></p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/Random.html'>set.seed</a></span>(<span class='fl'>1</span>)
......
......@@ -59,7 +59,7 @@ for elastic net regularisation;
\item{nzero}{number of non-zero coefficients\strong{:}
scalar/vector including positive integer(s) or \code{NA};
or \code{NULL} (no posthoc feature selection)}
or \code{NULL} (no post hoc feature selection)}
\item{intercept}{settings for meta-learner\strong{:} logical,
or \code{NULL}
......@@ -104,7 +104,6 @@ X <- matrix(rnorm(n*p),nrow=n,ncol=p)
y <- rnorm(n=n,mean=rowSums(X[,1:20]))
\dontshow{
loss <- cv.starnet(y=y,X=X,nfolds.ext=2,nfolds.int=3)}
\donttest{
loss <- cv.starnet(y=y,X=X)}
#loss <- cv.starnet(y=y,X=X)
}
......@@ -50,9 +50,9 @@ loss <- cv.starnet(y=y,X=X)}
}
\references{
A Rauschenberger, E Glaab, and MA van de Wiel (2020).
Predictive and interpretable models via the stacked elastic net".
"Predictive and interpretable models via the stacked elastic net".
\emph{Bioinformatics}. In press.
\doi{10.1093/bioinformatics/btaa535}.
\email{armin.rauschenberger@uni.lu}
}
\keyword{documentation}
......@@ -76,7 +76,7 @@ for the base and meta learners, respectively.
Implements stacked elastic net regression.
}
\details{
Posthoc feature selection\strong{:} consider
Post hoc feature selection\strong{:} consider
argument \code{nzero} in functions
\code{\link{coef}} and \code{\link{predict}}.
}
......@@ -92,4 +92,6 @@ object <- starnet(y=y,X=X,family="gaussian")
A Rauschenberger, E Glaab, and MA van de Wiel (2020).
"Predictive and interpretable models via the stacked elastic net".
\emph{Bioinformatics}. In press.
\doi{10.1093/bioinformatics/btaa535}.
\email{armin.rauschenberger@uni.lu}
}