compute_loss | R Documentation |
The FARO loss is computed between two feature allocations, each represented in binary matrix form.
compute_loss(Z1, Z2, a = 1, augmented = FALSE)
Z1 |
A feature allocation in binary matrix form, with items in the rows and features in the columns. |
Z2 |
A feature allocation in binary matrix form, with items in the rows and features in the columns. |
a |
A numeric scalar for the cost parameter of generalized Hamming
distance used in FARO loss. The other cost parameter, |
augmented |
If |
The FARO loss as a scalar value if augmented = FALSE
, otherwise, a list
of 3 elements including the loss and the two column permutations.
D. B. Dahl, D. J. Johnson, R. J. Andros (2023), Comparison and Bayesian Estimation of Feature Allocations, Journal of Computational and Graphical Statistics, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2023.2204136")}.
Z1 <- matrix(c(0,1,1,0,1,1,0,1,1,1,1,1), byrow=TRUE, nrow=6)
Z2 <- matrix(c(0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0), byrow=TRUE, nrow=6)
compute_loss(Z1,Z2)
x <- compute_loss(Z1,Z2,a=1,TRUE)
sum(cbind(Z1,0) != Z2)
sum(cbind(Z1,0)[,x$permutation1] != Z2)
sum(cbind(Z1,0) != Z2[,x$permutation2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.