View source: R/network.confusion.R
| network.confusion | R Documentation |
Computes many commonly used confusion matrix metrics
network.confusion(
base,
comparison,
metric = c("all", "sen", "spec", "ppv", "npv", "fdr", "fom", "ba", "f1", "csi", "mcc"),
full.names = FALSE
)
base |
Matrix or data frame.
Network that will be treated as the "ground truth" such that
a false positive represents an edge that is present in |
comparison |
Matrix or data frame.
Network that will be treated as the estimator such that a
false positive represents an edge that is present in this network
but not in |
metric |
Character vector.
Defaults to
|
full.names |
Boolean (length = 1).
Whether full or abbreviated names should be used.
Defaults to |
Returns a named vector of confusion matrix metrics
Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>
# Load data
wmt <- wmt2[,7:24]
# Set split
split <- sample(1:nrow(wmt), round(nrow(wmt) / 2))
# Estimate networks
split1 <- network.estimation(wmt[split,])
split2 <- network.estimation(wmt[-split,])
# Estimate metrics
network.confusion(split1, split2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.