Commit 88a0538f authored by Armin Rauschenberger's avatar Armin Rauschenberger
Browse files

automation

parent 3c3ce35e
......@@ -10,6 +10,7 @@ Authors@R: person("Armin","Rauschenberger",email="a.rauschenberger@vumc.nl",role
VignetteBuilder: knitr
License: GPL-3
LazyData: true
Language: en-GB
RoxygenNote: 6.1.1
URL: https://github.com/rauschenberger/cornet
BugReports: https://github.com/rauschenberger/cornet/issues
......@@ -15,7 +15,7 @@
#' vector of length \eqn{n}
#'
#' @param cutoff
#' cutoff point for dichotomising outcome into classes\strong{:}
#' cut-off point for dichotomising outcome into classes\strong{:}
#' \emph{meaningful} value between \code{min(y)} and \code{max(y)}
#'
#' @param X
......@@ -575,7 +575,7 @@ predict.cornet <- function(object,newx,type="probability",...){
#' Performance measurement by cross-validation
#'
#' @description
#' Compares models for a continuous response with a cutoff value.
#' Compares models for a continuous response with a cut-off value.
#'
#' @details
#' Uses k-fold cross-validation,
......@@ -647,7 +647,7 @@ predict.cornet <- function(object,newx,type="probability",...){
#' Single-split test
#'
#' @description
#' Compares models for a continuous response with a cutoff value.
#' Compares models for a continuous response with a cut-off value.
#'
#' @details
#' Splits samples into 80% for training and 20% for testing,
......
......@@ -141,7 +141,7 @@ vector of length \(n\)</p></td>
</tr>
<tr>
<th>cutoff</th>
<td><p>cutoff point for dichotomising outcome into classes<strong>:</strong>
<td><p>cut-off point for dichotomising outcome into classes<strong>:</strong>
<em>meaningful</em> value between <code><a href='https://www.rdocumentation.org/packages/base/topics/Extremes'>min(y)</a></code> and <code><a href='https://www.rdocumentation.org/packages/base/topics/Extremes'>max(y)</a></code></p></td>
</tr>
<tr>
......
......@@ -32,7 +32,7 @@
<meta property="og:title" content="Performance measurement by cross-validation — .compare" />
<meta property="og:description" content="Compares models for a continuous response with a cutoff value." />
<meta property="og:description" content="Compares models for a continuous response with a cut-off value." />
<meta name="twitter:card" content="summary" />
......@@ -121,7 +121,7 @@
<div class="ref-description">
<p>Compares models for a continuous response with a cutoff value.</p>
<p>Compares models for a continuous response with a cut-off value.</p>
</div>
......@@ -138,7 +138,7 @@ vector of length \(n\)</p></td>
</tr>
<tr>
<th>cutoff</th>
<td><p>cutoff point for dichotomising outcome into classes<strong>:</strong>
<td><p>cut-off point for dichotomising outcome into classes<strong>:</strong>
<em>meaningful</em> value between <code><a href='https://www.rdocumentation.org/packages/base/topics/Extremes'>min(y)</a></code> and <code><a href='https://www.rdocumentation.org/packages/base/topics/Extremes'>max(y)</a></code></p></td>
</tr>
<tr>
......
......@@ -32,7 +32,7 @@
<meta property="og:title" content="Single-split test — .test" />
<meta property="og:description" content="Compares models for a continuous response with a cutoff value." />
<meta property="og:description" content="Compares models for a continuous response with a cut-off value." />
<meta name="twitter:card" content="summary" />
......@@ -121,7 +121,7 @@
<div class="ref-description">
<p>Compares models for a continuous response with a cutoff value.</p>
<p>Compares models for a continuous response with a cut-off value.</p>
</div>
......@@ -137,7 +137,7 @@ vector of length \(n\)</p></td>
</tr>
<tr>
<th>cutoff</th>
<td><p>cutoff point for dichotomising outcome into classes<strong>:</strong>
<td><p>cut-off point for dichotomising outcome into classes<strong>:</strong>
<em>meaningful</em> value between <code><a href='https://www.rdocumentation.org/packages/base/topics/Extremes'>min(y)</a></code> and <code><a href='https://www.rdocumentation.org/packages/base/topics/Extremes'>max(y)</a></code></p></td>
</tr>
<tr>
......
......@@ -13,7 +13,7 @@ cornet(y, cutoff, X, alpha = 1, npi = 101, pi = NULL, nsigma = 99,
\item{y}{continuous outcome\strong{:}
vector of length \eqn{n}}
\item{cutoff}{cutoff point for dichotomising outcome into classes\strong{:}
\item{cutoff}{cut-off point for dichotomising outcome into classes\strong{:}
\emph{meaningful} value between \code{min(y)} and \code{max(y)}}
\item{X}{features\strong{:}
......
......@@ -11,7 +11,7 @@
\item{y}{continuous outcome\strong{:}
vector of length \eqn{n}}
\item{cutoff}{cutoff point for dichotomising outcome into classes\strong{:}
\item{cutoff}{cut-off point for dichotomising outcome into classes\strong{:}
\emph{meaningful} value between \code{min(y)} and \code{max(y)}}
\item{X}{features\strong{:}
......@@ -31,7 +31,7 @@ or \code{NULL} (balance)}
(linear regression uses the deviance)}
}
\description{
Compares models for a continuous response with a cutoff value.
Compares models for a continuous response with a cut-off value.
}
\details{
Uses k-fold cross-validation,
......
......@@ -10,7 +10,7 @@
\item{y}{continuous outcome\strong{:}
vector of length \eqn{n}}
\item{cutoff}{cutoff point for dichotomising outcome into classes\strong{:}
\item{cutoff}{cut-off point for dichotomising outcome into classes\strong{:}
\emph{meaningful} value between \code{min(y)} and \code{max(y)}}
\item{X}{features\strong{:}
......@@ -24,7 +24,7 @@ numeric between \eqn{0} (ridge) and \eqn{1} (lasso)}
(linear regression uses the deviance)}
}
\description{
Compares models for a continuous response with a cutoff value.
Compares models for a continuous response with a cut-off value.
}
\details{
Splits samples into 80% for training and 20% for testing,
......
......@@ -56,6 +56,14 @@ testthat::test_that("predicted probabilities",{ # important!
testthat::expect_true(all(a==b))
})
testthat::test_that("estimated coefficients",{ # important!
a <- cornet:::coef.cornet(fit)
b <- as.numeric(stats::coef(object=net$gaussian,s="lambda.min"))
c <- as.numeric(stats::coef(object=net$binomial,s="lambda.min"))
cond <- all(a[,"beta"]==b) & all(a[,"gamma"]==c)
testthat::expect_true(cond)
})
testthat::test_that("tuning parameters",{
a <- (0 <= fit$sigma.min) & is.finite(fit$sigma.min)
b <- (0 <= fit$pi.min) & (fit$pi.min <= 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment