R/tf_idf_iae_wrappers.R
idf_hdb.Rd
inverse document frequency using hdbscan cluster as label
idf_hdb(expr, features = NULL, multi = TRUE, thres = 0, minPts = 2, ...)
a matrix, features in row and cells in column
vector, feature names or indexes to compute
logical, if to compute based on binary (FALSE) or multi-class (TRUE)
numeric, cell only counts when expr > threshold, default 0
integer, minimum size of clusters, default 2.
Details in dbscan::hdbscan()
.
parameters for dbscan::hdbscan()
a matrix of inverse cell frequency score
Details as idf_prob()
.
set.seed(123)
data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
smartid:::idf_hdb(data)
#> 3 0 2 2 0 0 3
#> 1 0.6931472 0.4462871 0.6931472 0.6931472 0.4462871 0.4462871 0.6931472
#> 2 0.2231435 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.2231435
#> 3 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 4 0.6931472 0.2231435 0.6931472 0.6931472 0.2231435 0.2231435 0.6931472
#> 5 0.8472979 0.4462871 0.2231435 0.2231435 0.4462871 0.4462871 0.8472979
#> 6 0.2231435 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.2231435
#> 7 0.6931472 0.4462871 0.6931472 0.6931472 0.4462871 0.4462871 0.6931472
#> 8 0.6931472 0.4462871 0.6931472 0.6931472 0.4462871 0.4462871 0.6931472
#> 9 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 10 0.6931472 0.4462871 0.6931472 0.6931472 0.4462871 0.4462871 0.6931472
#> 0 1 1
#> 1 0.4462871 0.2231435 0.2231435
#> 2 0.6931472 0.6931472 0.6931472
#> 3 0.6931472 0.6931472 0.6931472
#> 4 0.2231435 0.6931472 0.6931472
#> 5 0.4462871 0.2231435 0.2231435
#> 6 0.6931472 0.6931472 0.6931472
#> 7 0.4462871 0.6931472 0.6931472
#> 8 0.4462871 0.2231435 0.2231435
#> 9 0.6931472 0.6931472 0.6931472
#> 10 0.4462871 0.6931472 0.6931472