cornet {cornet} | R Documentation |
Combined regression
Description
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.
Usage
cornet(
y,
cutoff,
X,
alpha = 1,
npi = 101,
pi = NULL,
nsigma = 99,
sigma = NULL,
nfolds = 10,
foldid = NULL,
type.measure = "deviance",
...
)
Arguments
y |
continuous outcome:
vector of length |
cutoff |
cut-off point for dichotomising outcome into classes:
meaningful value between |
X |
features:
numeric matrix with |
alpha |
elastic net mixing parameter:
numeric between |
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 |
foldid |
fold identifiers:
vector with entries between |
type.measure |
loss function for binary classification:
character |
... |
further arguments passed to |
Details
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.
Value
Returns an object of class cornet
, a list with multiple slots:
-
gaussian
: fitted linear model, classglmnet
-
binomial
: fitted logistic model, classglmnet
-
sigma
: scaling parameterssigma
, vector of lengthnsigma
-
pi
: weighting parameterspi
, vector of lengthnpi
-
cvm
: evaluation loss, matrix withnsigma
rows andnpi
columns -
sigma.min
: optimal scaling parameter, positive scalar -
pi.min
: optimal weighting parameter, scalar in unit interval -
cutoff
: threshold for dichotomisation
References
Armin Rauschenberger and Enrico Glaab (2023). "Predicting artificial binary outcomes from high-dimensional data in biomedicine". Journal of Applied Statistics. In press. doi:10.1080/02664763.2023.2233057
See Also
Methods for objects of class cornet
include
coef
and
predict
.
Examples
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