- train
The training set (description), as a data.frame.
- labels
Class labels of the training set (vector or factor).
- reg
The penalty applied to the coefficients, as in LINREG:
"none" (the default) fits the plain multinomial logistic regression of
multinom, while "ridge" (L2), "lasso" (L1) and
"elastic" (a mix of the two, weighted by alpha) fit a penalized one with
glmnet. Penalizing is what makes logistic regression usable when the
predictors are numerous or strongly correlated, where the unpenalized fit either fails to
converge or separates the classes perfectly with unbounded coefficients.
- lambda
The grid of penalty strengths searched by cross-validation; the retained value
is the one minimising the cross-validated deviance. NULL (the default) lets
glmnet derive the grid from the data, which is the recommended
choice: a fixed grid reaching very small penalties makes the fit fail to converge on
separable data.
- alpha
The elastic net mixing parameter, between 0 (ridge) and 1 (lasso). Used by
reg = "elastic" only.
- nfolds
The number of folds of the cross-validation used to choose lambda.
- tune
If true, the function returns parameters instead of a classification model.
- methodparameters
Present for interface consistency with performance
(which always passes it when fitting a model). Currently unused: LR does not
support reusing pre-tuned parameters.
- graph
Whether the cross-validation curve used to choose lambda is plotted.
Ignored by reg = "none", which has nothing to choose.
- seed
A specified seed for random number generation, so that two runs on the same
data give the same model. Every learning method accepts it, so that it can be set the same
way whatever the method; the deterministic ones simply have nothing to draw and give the
same model with or without it.
- ...
Other parameters.