inverse cell frequency: max
idf_m(expr, features = NULL, thres = 0)
a matrix of inverse cell frequency score for each feature
$$\mathbf{IDF_{i,j}} = log(\frac{max_{\{i^{'}\in j\}}(n_{i^{'}})}{n_i+1})$$ where \(i\) is the feature \(i\) and \(i^{'}\) is the feature except \(i\), \(n_i\) is the number of cells containing feature i, and \(n_{i^{'}}\) is the number of cells containing feature \(i^{'}\).
data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
smartid:::idf_m(data)
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> 1 -0.09531018 -0.09531018 -0.09531018 -0.09531018 -0.09531018 -0.09531018
#> 2 0.22314355 0.22314355 0.22314355 0.22314355 0.22314355 0.22314355
#> 3 0.10536052 0.10536052 0.10536052 0.10536052 0.10536052 0.10536052
#> 4 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
#> 5 0.22314355 0.22314355 0.22314355 0.22314355 0.22314355 0.22314355
#> 6 -0.09531018 -0.09531018 -0.09531018 -0.09531018 -0.09531018 -0.09531018
#> 7 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
#> 8 0.10536052 0.10536052 0.10536052 0.10536052 0.10536052 0.10536052
#> 9 0.35667494 0.35667494 0.35667494 0.35667494 0.35667494 0.35667494
#> 10 -0.09531018 -0.09531018 -0.09531018 -0.09531018 -0.09531018 -0.09531018
#> [,7] [,8] [,9] [,10]
#> 1 -0.09531018 -0.09531018 -0.09531018 -0.09531018
#> 2 0.22314355 0.22314355 0.22314355 0.22314355
#> 3 0.10536052 0.10536052 0.10536052 0.10536052
#> 4 0.00000000 0.00000000 0.00000000 0.00000000
#> 5 0.22314355 0.22314355 0.22314355 0.22314355
#> 6 -0.09531018 -0.09531018 -0.09531018 -0.09531018
#> 7 0.00000000 0.00000000 0.00000000 0.00000000
#> 8 0.10536052 0.10536052 0.10536052 0.10536052
#> 9 0.35667494 0.35667494 0.35667494 0.35667494
#> 10 -0.09531018 -0.09531018 -0.09531018 -0.09531018