conf.mat: Confusion Matrix

View source: R/conf.mat.R

conf.matR Documentation

Confusion Matrix

Description

Create a Confusion Matrix.

Usage

 
conf.mat( pred, actual, cutoff = 0.5, proportion = FALSE, 
                     dnn = c( "Prediction", "Actual" ), ... )

Arguments

pred

adjacency matrix corresponding to an estimated graph. It can be an object with S3 class "bdgraph" from function bdgraph. It can be an object of S3 class "ssgraph", from the function ssgraph::ssgraph() of R package ssgraph::ssgraph().

actual

adjacency matrix corresponding to the actual graph structure in which a_{ij}=1 if there is a link between notes i and j, otherwise a_{ij}=0. It can be an object with S3 class "sim" from function bdgraph.sim. It can be an object with S3 class "graph" from function graph.sim. It can be a factor, numeric or character vector of responses (true class), typically encoded with 0 (controls) and 1 (cases). Only two classes can be used in a ROC curve.

cutoff

cutoff value for the case that pred is vector of probabilites. The default is 0.5.

proportion

logical: FALSE (default) for a confusion matrix with number of cases. TRUE, for a confusion matrix with the proportion of cases.

dnn

names to be given to the dimensions in the result (the dimnames names).

...

further arguments to be passed to table.

Value

the results of table on pred and actual.

Author(s)

Reza Mohammadi a.mohammadi@uva.nl

See Also

conf.mat.plot, compare, roc, bdgraph

Examples

## Not run: 
set.seed( 100 )

# Generating multivariate normal data from a 'random' graph
data.sim <- bdgraph.sim( n = 50, p = 6, size = 7, vis = TRUE )

# Running sampling algorithm based on GGMs 
sample.ggm <- bdgraph( data = data.sim, method = "ggm", iter = 10000 )

# Confusion Matrix for GGM method
conf.mat( pred = sample.ggm, actual = data.sim )

## End(Not run)

BDgraph documentation built on Dec. 28, 2022, 1:54 a.m.