Binary Classification

score_binary(estimate, true, model_name = NULL)

Arguments

estimate

Matrix. Estimated graph (adjacency matrix)

true

Matrix. True graph (adjacency matrix)

model_name

Character string. Name of the method or penalty (defaults to NULL)

Value

A data frame containing specificity (1 - false positive rate), sensitivity (true positive rate), precision (1 - false discovery rate), f1_score, and mcc (Matthews correlation coefficient).

Examples

# \donttest{
p <- 20
n <- 500

true_net <- gen_net(p = p, edge_prob = 0.25)

y <- MASS::mvrnorm(n = n,
                   mu = rep(0, p),
                   Sigma = true_net$cors)

# default
fit_atan <- ggmncv(R = cor(y),
                   n = nrow(y),
                   penalty = "atan",
                   progress = FALSE)

# lasso
fit_l1 <- ggmncv(R = cor(y),
                 n = nrow(y),
                 penalty = "lasso",
                 progress = FALSE)

# atan scores
score_binary(estimate = true_net$adj,
             true = fit_atan$adj,
             model_name = "atan")
#>       measure     score model_name
#> 1 specificity 0.9256757       atan
#> 2 sensitivity 0.8571429       atan
#> 3   precision 0.7659574       atan
#> 4      recall 0.8571429       atan
#> 5    f1_score 0.8089888       atan
#> 6         mcc 0.7528347       atan

score_binary(estimate = fit_l1$adj,
             true = true_net$adj,
             model_name = "lasso")
#>       measure     score model_name
#> 1 specificity 0.5524476      lasso
#> 2 sensitivity 1.0000000      lasso
#> 3   precision 0.4234234      lasso
#> 4      recall 1.0000000      lasso
#> 5    f1_score 0.5949367      lasso
#> 6         mcc 0.4836520      lasso
# }