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.
# S3 method for cat_tune
plot(x, digit = 2, legend_pos = "topright", text_pos = 3, ...)
A plot with the specified y-values plotted against tau_seq
,
including a highlighted optimal tau
point.
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
.
An integer specifying the number of decimal places to round the displayed values (default is 2).
A character string specifying the position of the legend on
the plot (default is "topright"
).
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.
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.