...
 
Commits (2)
......@@ -5,4 +5,3 @@
^cran-comments\.md$
^appveyor\.yml$
^\.Rhistory$
^CRAN-RELEASE$
This package was submitted to CRAN on 2020-06-08.
Once it is accepted, delete this file and tag the release (commit 79c29efcbc).
Package: starnet
Version: 0.0.2
Version: 0.0.3
Title: Stacked Elastic Net
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)
......
......@@ -84,14 +84,14 @@
#'
#' @examples
#' set.seed(1)
#' n <- 40; p <- 50
#' n <- 50; p <- 100
#' y <- rnorm(n=n)
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' object <- starnet(y=y,X=X,family="gaussian")
#'
starnet <- function(y,X,family="gaussian",nalpha=21,alpha=NULL,nfolds=10,foldid=NULL,type.measure="deviance",alpha.meta=1,penalty.factor=NULL,intercept=NULL,upper.limit=NULL,unit.sum=NULL,...){
if(is.na(alpha.meta) & (!"CVXR" %in% .packages(all.available=TRUE))){
if(is.na(alpha.meta) && (!"CVXR" %in% .packages(all.available=TRUE))){
stop("Install CVXR from CRAN for alpha.meta=NA.",call.=FALSE)
}
......@@ -317,7 +317,7 @@ starnet <- function(y,X,family="gaussian",nalpha=21,alpha=NULL,nfolds=10,foldid=
#'
#' @examples
#' set.seed(1)
#' n <- 40; p <- 50
#' n <- 50; p <- 100
#' y <- rnorm(n=n)
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' object <- starnet(y=y,X=X)
......@@ -385,7 +385,7 @@ predict.starnet <- function(object,newx,type="response",nzero=NULL,...){
#'
#' @examples
#' set.seed(1)
#' n <- 40; p <- 50
#' n <- 50; p <- 100
#' y <- rnorm(n=n)
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' object <- starnet(y=y,X=X)
......@@ -447,7 +447,7 @@ coef.starnet <- function(object,nzero=NULL,...){
#'
#' @examples
#' set.seed(1)
#' n <- 40; p <- 50
#' n <- 50; p <- 100
#' y <- rnorm(n=n)
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' object <- starnet(y=y,X=X)
......@@ -481,7 +481,7 @@ weights.starnet <- function(object,...){
#'
#' @examples
#' set.seed(1)
#' n <- 40; p <- 50
#' n <- 50; p <- 100
#' y <- rnorm(n=n)
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' object <- starnet(y=y,X=X)
......
Reason for resubmission: error on r-patched-solaris-x86.
\ No newline at end of file
Reason for resubmission: error on r-patched-solaris-x86.
(I actually think there is an issue with the R package glmnet.)
\ No newline at end of file
......@@ -89,7 +89,6 @@
<p>The <code>starnet</code> manuscript is in preparation. Click <a href="https://CRAN.R-project.org/package=starnet">here</a> for the R package.</p>
<p>Click <a href="https://academic.oup.com/bioinformatics/advance-article-pdf/doi/10.1093/bioinformatics/btaa535/33263777/btaa535.pdf">here</a> to download article.</p>
<div>
<object data="https://academic.oup.com/bioinformatics/advance-article-pdf/doi/10.1093/bioinformatics/btaa535/33263777/btaa535.pdf" type="application/pdf" width="100%" height="500px">
......
......@@ -82,7 +82,7 @@
<h1 data-toc-skip>Stacked Elastic Net</h1>
<h4 class="author">Armin Rauschenberger</h4>
<h4 class="date">08 June 2020</h4>
<h4 class="date">10 June 2020</h4>
<small class="dont-index">Source: <a href="https://github.com/rauschenberger/starnet/blob/master/vignettes/script.Rmd"><code>vignettes/script.Rmd</code></a></small>
<div class="hidden name"><code>script.Rmd</code></div>
......
......@@ -5,5 +5,5 @@ articles:
article: article.html
script: script.html
starnet: starnet.html
last_built: 2020-06-08T06:25Z
last_built: 2020-06-10T10:11Z
......@@ -160,7 +160,7 @@ respectively.</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>)
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>40</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</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='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'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='starnet.html'>starnet</a></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>)
......
......@@ -173,7 +173,7 @@ and <code>none</code> (intercept-only model).</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>)
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>40</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</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='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'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='starnet.html'>starnet</a></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>)
......
......@@ -151,7 +151,7 @@
<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>)
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>40</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</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='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'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='starnet.html'>starnet</a></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>)
......
docs/reference/starnet-package-1.png

8.47 KB | W: | H:

docs/reference/starnet-package-1.png

8.87 KB | W: | H:

docs/reference/starnet-package-1.png
docs/reference/starnet-package-1.png
docs/reference/starnet-package-1.png
docs/reference/starnet-package-1.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -241,7 +241,7 @@ doi: <a href='https://doi.org/10.1093/bioinformatics/btaa535'>10.1093/bioinforma
<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>)
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>40</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</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='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'>object</span> <span class='kw'>&lt;-</span> <span class='fu'>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'>family</span><span class='kw'>=</span><span class='st'>"gaussian"</span>)</div></pre>
......
......@@ -153,18 +153,18 @@ i.e. the weights for the base learners.</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>)
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>40</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>
<span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>50</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>100</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='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'>object</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='starnet.html'>starnet</a></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='fu'><a href='https://rdrr.io/r/stats/weights.html'>weights</a></span>(<span class='no'>object</span>)</div><div class='output co'>#&gt; (Intercept) V1 V2 V3 V4 V5
#&gt; 0.06032819 0.00000000 0.23525906 0.15396683 0.00000000 0.00000000
#&gt; 0.1004483 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
#&gt; V6 V7 V8 V9 V10 V11
#&gt; 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
#&gt; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
#&gt; V12 V13 V14 V15 V16 V17
#&gt; 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
#&gt; 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
#&gt; V18 V19 V20 V21
#&gt; 0.00000000 0.00000000 0.00000000 0.00000000 </div><div class='input'>
#&gt; 0.0000000 0.0000000 0.0000000 0.0000000 </div><div class='input'>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
......
......@@ -25,7 +25,7 @@ Extracts pooled coefficients.
}
\examples{
set.seed(1)
n <- 40; p <- 50
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X)
......
......@@ -35,7 +35,7 @@ Predicts outcome from features with stacked model.
}
\examples{
set.seed(1)
n <- 40; p <- 50
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X)
......
......@@ -19,7 +19,7 @@ Prints object of class \link[starnet]{starnet}.
}
\examples{
set.seed(1)
n <- 40; p <- 50
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X)
......
......@@ -82,7 +82,7 @@ argument \code{nzero} in functions
}
\examples{
set.seed(1)
n <- 40; p <- 50
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X,family="gaussian")
......
......@@ -20,7 +20,7 @@ i.e. the weights for the base learners.
}
\examples{
set.seed(1)
n <- 40; p <- 50
n <- 50; p <- 100
y <- rnorm(n=n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
object <- starnet(y=y,X=X)
......
for(family in c("gaussian","binomial","poisson")){
n <- 30; p <- 50
n <- 50; p <- 100 # was 30 and 50
if(family=="cox"){
list <- list()
list$y <- survival::Surv(time=abs(rnorm(n)),
......