get.ideal.penalty {logicDT} | R Documentation |
Tuning the LASSO regularization parameter
Description
This function takes a fitted linear.logic
model and independent
validation data as input for finding the ideal LASSO complexity penalty
s
.
Usage
get.ideal.penalty(
model,
X,
y,
Z = NULL,
scoring_rule = "deviance",
choose = "min"
)
Arguments
model |
A fitted |
X |
Matrix or data frame of binary input data. This object should correspond to the binary matrix for fitting the model. |
y |
Response vector. 0-1 coding for binary outcomes. |
Z |
Optional quantitative covariables supplied as a matrix or data frame. Only used (and required) if the model was fitted using them. |
scoring_rule |
The scoring rule for evaluating the validation
error and its standard error. For classification tasks, |
choose |
Model selection scheme. If the model that minimizes the
validation error should be chosen, |
Value
A list containing
val.res |
A data frame containing the penalties, the validation scores and the corresponding standard errors |
best.s |
The ideal penalty value |