cv_risk_mod | R Documentation |
Runs k-fold cross-validation on a grid of \lambda_0
values. Records
class accuracy and deviance for each \lambda_0
. Returns an object of
class "cv_risk_mod".
cv_risk_mod(
X,
y,
weights = NULL,
beta = NULL,
a = -10,
b = 10,
max_iters = 10000,
tol = 1e-05,
nlambda = 25,
lambda_min_ratio = ifelse(nrow(X) < ncol(X), 0.01, 1e-04),
lambda0 = NULL,
nfolds = 10,
foldids = NULL,
parallel = FALSE,
shuffle = TRUE,
seed = NULL,
method = "annealscore"
)
X |
Input covariate matrix with dimension |
y |
Numeric vector for the (binomial) response variable. |
weights |
Numeric vector of length |
beta |
Starting numeric vector with |
a |
Integer lower bound for coefficients (default: -10). |
b |
Integer upper bound for coefficients (default: 10). |
max_iters |
Maximum number of iterations (default: 10000). |
tol |
Tolerance for convergence (default: 1e-5). |
nlambda |
Number of lambda values to try (default: 25). |
lambda_min_ratio |
Smallest value for lambda, as a fraction of
lambda_max (the smallest value for which all coefficients are zero).
The default depends on the sample size ( |
lambda0 |
Optional sequence of lambda values. By default, the function
will derive the lambda0 sequence based on the data (see |
nfolds |
Number of folds, implied if |
foldids |
Optional vector of values between 1 and |
parallel |
If |
shuffle |
Whether order of coefficients is shuffled during coordinate descent (default: TRUE). |
seed |
An integer that is used as argument by |
method |
A string that specifies which method ("riskcd" or "annealscore") to run (default: "annealscore") |
An object of class "cv_risk_mod" with the following attributes:
results |
Dataframe containing a summary of deviance, accuracy, and auc for
each value of |
lambda_min |
Numeric value indicating the |
lambda_1se |
Numeric value indicating the largest |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.