Wrapped version of the pamr package implementation. Note that this function uses internal cross-validation for determining the value of the shrinkage threshold.
fit_pamr(x, y, error_fun, cv, nfold, threshold = NULL, ...,
thres_fun = function(thr, err) median(thr[err == min(err)]), slim = FALSE)
Dataset, numerical matrix with observations as rows.
Class labels, factor.
Error function for tuning.
Cross-validation scheme for shrinkage tuning. It should be supplied on one of the following forms:
Resampling scheme produced with resample
or resample_holdout
.
List with elements named nrepeat
and nfold
NA
, NULL
or FALSE
to suppress shrinkage tuning.
Sent to pamr.cv
. Only used if cv
is missing.
Shrinkage thresholds to try (referred to as 'lambda' in the
literature). Chosen and tuned automatically by default, but must be given
by the user if not tuned (see the cv
argument) if you wish to use
it with evaluate
.
Sent to pamr.train
.
Threshold selection function. Note that it is not uncommon that several thresholds will result in the same tuning error.
Set to TRUE
if you want to return the fitted
classifier but discard pamr's cv.objects
, which can be large.
memory efficient. This means that the element cv$cv.objects
containing the cross-validated fits will be dropped from the returned
classifier.
Fitted pamr classifier.