calculate_metrics {inferCSN} | R Documentation |
Calculate Network Prediction Performance Metrics
Description
Calculates comprehensive performance metrics for evaluating predicted network structures, including classification performance, precision-recall metrics, and network topology metrics.
Usage
calculate_metrics(
network_table,
ground_truth,
metric_type = c("all", "auc", "auroc", "auprc", "precision", "recall", "f1",
"accuracy", "si", "ji"),
return_plot = FALSE,
line_color = "#1563cc",
line_width = 1
)
Arguments
network_table |
A data frame of predicted network structure containing:
|
ground_truth |
A data frame of ground truth network with the same format as |
metric_type |
The type of metric to return, default is
|
return_plot |
Logical value, default is |
line_color |
Color for plot lines, default is |
line_width |
Width for plot lines, default is |
Value
A list containing:
-
metrics
- A data frame with requested metrics -
plot
- A plot object if return_plot = TRUE (optional)
Examples
data("example_matrix")
data("example_ground_truth")
network_table <- inferCSN(example_matrix)
calculate_metrics(
network_table,
example_ground_truth,
return_plot = TRUE
)
calculate_metrics(
network_table,
example_ground_truth,
metric_type = "auroc"
)