plot.cat_tune: Plot Likelihood or Risk Estimate vs. Tau for Tuning Model

View source: R/plots.R

plot.cat_tuneR Documentation

Plot Likelihood or Risk Estimate vs. Tau for Tuning Model

Description

This function generates a plot showing the relationship between the tuning parameter tau and either the likelihood score (for a cat_cox_tune model) or the risk estimate (for other models) during cross-validation or other model evaluation methods. The plot highlights the optimal tau value and provides visual cues for the best tuning parameter based on the specified method.

Usage

## S3 method for class 'cat_tune'
plot(x, digit = 2, legend_pos = "topright", text_pos = 3, ...)

Arguments

x

A fitted model object of class cat_tune that contains the results of the tuning process. This object includes the likelihood or risk estimate lists, the tuning sequence (tau_seq), and the selected optimal tau.

digit

An integer specifying the number of decimal places to round the displayed values (default is 2).

legend_pos

A character string specifying the position of the legend on the plot (default is "topright").

text_pos

An integer specifying the position of the text label on the plot (default is 3, which places the text above the point).

...

Additional parameters to pass to other functions.

Details

The function generates a line plot with tau_seq on the x-axis and either the likelihood score or risk estimate on the y-axis. If the model is of class cat_cox_tune, the plot shows the likelihood score, while for other models, it shows the risk estimates. The optimal tau is marked with a red cross, and red dashed lines are drawn to highlight the optimal point on the plot.

Value

A plot with the specified y-values plotted against tau_seq, including a highlighted optimal tau point.


catalytic documentation built on April 4, 2025, 5:51 a.m.