find_best_lambda_index: Select the "best" lambda index given the training (and...

View source: R/functions.R

find_best_lambda_indexR Documentation

Select the "best" lambda index given the training (and validation) set metrics

Description

If the "lambda_idx" attribute in the given object is already available, simply return that value. Otherwise, we look at the performance metric and decide the "best" lambda index. If there is no validation set metric available, we simply return the last lambda index in the training set metric. When we have access to validation set metrics, we identify the lambda index that maximizes the (weighted) average of validation set metrics.

Usage

find_best_lambda_index(
  multiSnpnetResults,
  metric_name = NULL,
  use_weight = TRUE,
  traits = NULL,
  force = FALSE
)

Arguments

multiSnpnetResults

a list containing the results of the multiSnpnet fit

metric_name

the name of the metric (metric_val or AUC_val)

use_weight

whether we should use trait weights when evaluating weighted average of the metric

traits

(optional) subset of traits

force

if TRUE, we recompute the best lambda index

Value

An integer denoting the best lambda index. If the validation set is available (by running check_if_metric_exists()), we return the lambda index that maximizes the validation set metric. If the AUC_val is availale, we use AUC_val instead of metric_val. We take the weighted average of the metric.


junyangq/multiSnpnet documentation built on Oct. 19, 2023, 8:22 p.m.