inverse document frequency using hdbscan cluster as label

idf_hdb(expr, features = NULL, multi = TRUE, thres = 0, minPts = 2, ...)

Arguments

expr

a matrix, features in row and cells in column

features

vector, feature names or indexes to compute

multi

logical, if to compute based on binary (FALSE) or multi-class (TRUE)

thres

numeric, cell only counts when expr > threshold, default 0

minPts

integer, minimum size of clusters, default 2. Details in dbscan::hdbscan().

...

parameters for dbscan::hdbscan()

Value

a matrix of inverse cell frequency score

Details

Details as idf_prob().

Examples

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