Skip to contents

Function interface for the return value of multitune()

Usage

multitune_output_prototype(x, y, val_error_fun, ...)

Arguments

x

Named numeric matrix. Predictor matrix without NAs. Samples correspond to rows. Discrete features are encoded as binary dummy variables.

y

Named list with the response in thee formats:

  • "bin", a named numeric one-column matrix, binary response,

  • "cox", a named numeric two-column matrix, with columns "time_to_event" and "event" (0 = censoring, 1 = event), the response in the Cox format,

  • "true", a named numeric one-column matrix, true binary response.

The rownames of y[["bin"]] and y[["true"]] are a subset of the rownames of x and, in general, do not coincide. Use intersect_by_names() to get equal rownames.

val_error_fun

Function to calculate the error of validated predictions. For its interface, see val_error_fun_prototype()

...

atomic vectors. Every vector corresponds to a hyperparameter and holds candidate values for it. For every combination of hyperparameters, fit a model by calling the fitter parameter of multitune().

Value

A multitune_obj S3 object with underlying class list. It fulfills the requirements of fitter_prototype() and, in addition, it has the following elements:

  • val_predict_list: a list of row-named one-column matrices, the validated predictions of the fitted models.

  • lambda: a character vector, the hyperparameter combinations as a string.

  • lambda_min_index: an integer, the index of the hyperparameter combination of the model with the lowest validation error.

  • lambda_min: a character, the hyperparameter combination of the model with the lowest validation error.

  • val_error: a numeric vector, the validation errors of the fitted models.

  • min_error: a numeric scalar, the validation error of the model with the lowest validation error.

  • fit_obj_list: a list of fit_objs of the fitted models. If select = TRUE in multitune(), all but the model with the lowest validation error are NA.