metric_element_wise: Metric for Element-Wise Accuracy

Description Usage Arguments Details Value Recovery Use See Also Examples

View source: R/metrics.R

Description

Computes the element-wise accuracy of matrices.

Usage

1
metric_element_wise(estimate, oracle, na.rm = FALSE)

Arguments

estimate

Estimated values from the model.

oracle

Known values used to generate the model.

na.rm

A logical indicating if missing values (including NaN) should be removed. Default: FALSE

Details

The element-wise metric is also known as accuracy or the proportion of estimated values that are equivalent to the same elements in the oracle value.

The metric is computed under:

\frac{1}{JK}∑ _{j=1}^J∑ _{k=1}^K\mathcal I(\hat{θ}_{jk}=θ_{jk})

Value

A single numeric value between 0 and 1.

Recovery Use

The element-wise recovery metric is best used to understand differences between dichotomous matrices such as the \boldsymbol{Q} and \boldsymbol{Δ} matrices.

See Also

base::norm()

Examples

1
2
3
4
5
6
# Construct data
estimate = matrix(c(1,1,2,4,3,6), nrow = 2, ncol = 3)
truth = matrix(c(1,2,3,4,5,6), nrow = 2, ncol = 3)

# Compute the frobenius norm
metric_element_wise(estimate, truth)

tmsalab/edmcore documentation built on Sept. 4, 2021, 2:46 a.m.