plot_evaluation {Coxmos} | R Documentation |
plot_evaluation
Description
Generates a comprehensive evaluation of the performance of a given Coxmos evaluation
object from eval_Coxmos_models()
, offering both statistical tests and visual plots for assessment.
Usage
plot_evaluation(
eval_results,
evaluation = "AUC",
pred.attr = "mean",
y.min = NULL,
type = "both",
round_times = FALSE,
decimals = 2,
title = NULL,
title_size_text = 15,
legend_title = "Method",
legend_size_text = 12,
x_axis_size_text = 10,
y_axis_size_text = 10,
label_x_axis_size = 10,
label_y_axis_size = 10
)
Arguments
eval_results |
Coxmos evaluation object from |
evaluation |
Character. Perform the evaluation using the "AUC" or "Brier" metric (default: "AUC"). |
pred.attr |
Character. Way to evaluate the metric selected. Must be one of the following: "mean" or "median" (default: "mean"). |
y.min |
Numeric. Minimum Y value for establish the Y axis value. If y.min = NULL, automatic detection is performed (default: NULL). |
type |
Character. Plot type. Must be one of the following: "both", "line" or "mean". In other case, "both" will be selected (default: "both"). |
round_times |
Logical. Whether times x value should be rounded (default: FALSE). |
decimals |
Numeric. Number of decimals to use in round times. Must be a value greater or equal zero (default = 2). |
title |
Character. Plot title (default: NULL). |
title_size_text |
Numeric. Text size for legend title (default: 15). |
legend_title |
Character. Legend title (default: "Method"). |
legend_size_text |
Numeric. Text size for legend title (default: 12). |
x_axis_size_text |
Numeric. Text size for x axis (default: 10). |
y_axis_size_text |
Numeric. Text size for y axis (default: 10). |
label_x_axis_size |
Numeric. Text size for x label axis (default: 10). |
label_y_axis_size |
Numeric. Text size for y label axis (default: 10). |
Details
The plot_evaluation
function is designed to facilitate a rigorous evaluation of the
performance of models, specifically in the context of survival analysis. This function is tailored
to work with a Coxmos evaluation object, which encapsulates the results of survival models. The
primary objective is to provide both statistical and visual insights into the model's performance.
The function offers flexibility in the evaluation metric, allowing users to choose between the Area Under the Curve (AUC) and the Brier score. The chosen metric is then evaluated based on either its mean or median value, as specified by the "pred.attr" parameter. The resulting plots can be tailored to display continuous performance over time or aggregated mean performance, based on the "type" parameter.
A salient feature of this function is its ability to conduct statistical tests to compare the performance across different methods. Supported tests include the t-test, ANOVA, Wilcoxon rank-sum test, and Kruskal-Wallis test. These tests provide a quantitative measure of the differences in performance, aiding in the objective assessment of the models.
The visual outputs are generated using the 'ggplot2' package, ensuring high-quality and interpretable plots. The function also offers extensive customization options for the plots, including axis labels, title, and text sizes, ensuring that the outputs align with the user's preferences and the intended audience's expectations.
Value
A list of lst_eval_results length. Each element is a list of three elements.
lst_plots
: A list of two plots. The evaluation over the time, and the extension adding the
mean or median on the right.
lst_plot_comparisons
: A list of comparative boxplots by t.test, anova, wilcoxon, kruscal.
df
: Data.frame of evaluation result.
Author(s)
Pedro Salguero Garcia. Maintainer: pedsalga@upv.edu.es
Examples
data("X_proteomic")
data("Y_proteomic")
set.seed(123)
index_train <- caret::createDataPartition(Y_proteomic$event, p = .5, list = FALSE, times = 1)
X_train <- X_proteomic[index_train,1:50]
Y_train <- Y_proteomic[index_train,]
X_test <- X_proteomic[-index_train,1:50]
Y_test <- Y_proteomic[-index_train,]
coxEN.model <- coxEN(X_train, Y_train, x.center = TRUE, x.scale = TRUE)
eval_results <- eval_Coxmos_models(lst_models = list("coxEN" = coxEN.model), X_test = X_test,
Y_test = Y_test)
plot_eval_results <- plot_evaluation(eval_results)