plot.cat_tune {catalytic} | R 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 |
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 |
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.