cornet | R Documentation |
Implements lasso and ridge regression for dichotomised outcomes. Such outcomes are not naturally but artificially binary. They indicate whether an underlying measurement is greater than a threshold.
cornet( y, cutoff, X, alpha = 1, npi = 101, pi = NULL, nsigma = 99, sigma = NULL, nfolds = 10, foldid = NULL, type.measure = "deviance", ... )
y |
continuous outcome: vector of length n |
cutoff |
cut-off point for dichotomising outcome into classes:
meaningful value between |
X |
features: numeric matrix with n rows (samples) and p columns (variables) |
alpha |
elastic net mixing parameter: numeric between 0 (ridge) and 1 (lasso) |
npi |
number of |
pi |
pi sequence:
vector of increasing values in the unit interval;
or |
nsigma |
number of |
sigma |
sigma sequence:
vector of increasing positive values;
or |
nfolds |
number of folds: integer between 3 and n |
foldid |
fold identifiers:
vector with entries between 1 and |
type.measure |
loss function for binary classification:
character |
... |
further arguments passed to |
The argument family
is unavailable, because
this function fits a gaussian model for the numeric response,
and a binomial model for the binary response.
Linear regression uses the loss function "deviance"
(or "mse"
),
but the loss is incomparable between linear and logistic regression.
The loss function "auc"
is unavailable for internal cross-validation.
If at all, use "auc"
for external cross-validation only.
Returns an object of class cornet
, a list with multiple slots:
gaussian
: fitted linear model, class glmnet
binomial
: fitted logistic model, class glmnet
sigma
: scaling parameters sigma
,
vector of length nsigma
pi
: weighting parameters pi
,
vector of length npi
cvm
: evaluation loss,
matrix with nsigma
rows and npi
columns
sigma.min
: optimal scaling parameter,
positive scalar
pi.min
: optimal weighting parameter,
scalar in unit interval
cutoff
: threshold for dichotomisation
Armin Rauschenberger and Enrico Glaab (2022). "Predicting artificial binary outcomes from high-dimensional data". Manuscript in preparation.
Methods for objects of class cornet
include
coef
and
predict
.
n <- 100; p <- 200 y <- rnorm(n) X <- matrix(rnorm(n*p),nrow=n,ncol=p) net <- cornet(y=y,cutoff=0,X=X) net
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.