# Create example data for a diagnostic model
external_eval_example_dia <- list(
sample_score = data.frame(
ID = paste0("S", 1:100),
label = sample(c(0, 1), 100, replace = TRUE),
score = runif(100, 0, 1)
),
evaluation_metrics = list(
Final_Threshold = 0.53
)
)
# Generate an ROC curve plot object
roc_plot <- figure_dia(type = "roc", data = external_eval_example_dia)
# To display the plot, simply run:
# print(roc_plot)
# Generate a PRC curve and save it to a temporary file
# tempfile() creates a safe, temporary path as required by CRAN
temp_prc_path <- tempfile(fileext = ".png")
figure_dia(type = "prc", data = external_eval_example_dia, file = temp_prc_path)
# Generate a Confusion Matrix plot
matrix_plot <- figure_dia(type = "matrix", data = external_eval_example_dia)
Run the code above in your browser using DataLab