Calculate score for each feature in each cell
cal_score_init(
expr,
tf = c("logtf", "tf"),
idf = "prob",
iae = "prob",
par.idf = NULL,
par.iae = NULL
)a count matrix, features in row and cells in column
a character, specify the TF method to use, can be "tf" or "logtf"
a character, specify the IDF method to use. Available methods can
be accessed using idf_iae_methods()
a character, specify the IAE method to use. Available methods can
be accessed using idf_iae_methods()
other parameters for specified IDF methods
other parameters for specified IAE methods
a list of combined score, tf, idf and iae
data <- matrix(rpois(100, 2), 10, dimnames = list(1:10))
label <- sample(c("A", "B"), 10, replace = TRUE)
smartid:::cal_score_init(data,
par.idf = list(label = label),
par.iae = list(label = label)
)
#> $score
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> 1 0.13842741 0.06606471 0.12684048 0.05627124 0.08291711 0.07998922
#> 2 17.65799223 31.49255860 0.00000000 13.66037755 75.15879494 55.78826168
#> 3 0.02342995 0.06139173 0.04178669 0.03559220 0.05244602 0.05059410
#> 4 0.05726918 0.01821506 0.01821506 0.01546594 0.01546594 0.04317015
#> 5 0.00000000 0.00000000 0.07550069 0.03349497 0.01705758 0.02443289
#> 6 0.02415247 0.08270208 0.06328489 0.07084801 0.05406332 0.07630676
#> 7 0.05733161 0.00000000 0.15022171 0.20671090 0.16817456 0.12380058
#> 8 0.04152991 0.12038266 0.01936978 0.04758723 0.01644639 0.00000000
#> 9 0.10039196 0.06250282 0.09182725 0.10280144 0.00000000 0.11072215
#> 10 66.97083957 16.32834338 16.32834338 27.22388753 52.56936927 0.00000000
#> [,7] [,8] [,9] [,10]
#> 1 0.10138468 0.121216075 0.03894219 0.03231435
#> 2 0.00000000 0.000000000 53.05821427 83.90133628
#> 3 0.04368778 0.225959672 0.02463138 0.04004424
#> 4 0.01906218 0.150358837 0.02101709 0.05024070
#> 5 0.06034835 0.017833743 0.00000000 0.05541108
#> 6 0.02302920 0.604465234 0.09457841 0.06069629
#> 7 0.25097827 0.009759261 0.06027144 0.09798574
#> 8 0.02027060 0.240364441 0.06387935 0.01854563
#> 9 0.03341569 0.013770553 0.03684262 0.00000000
#> 10 64.04523566 0.000000000 70.17737321 30.62917664
#>
#> $tf
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> 1 0.18223826 0.08697351 0.16698418 0.07408051 0.10915952 0.1053050 0.13347190
#> 2 0.04876637 0.08697351 0.00000000 0.03772609 0.20756727 0.1540714 0.00000000
#> 3 0.04876637 0.12777885 0.08697351 0.07408051 0.10915952 0.1053050 0.09093039
#> 4 0.13969676 0.04443201 0.04443201 0.03772609 0.03772609 0.1053050 0.04649838
#> 5 0.00000000 0.00000000 0.16698418 0.07408051 0.03772609 0.0540380 0.13347190
#> 6 0.04876637 0.16698418 0.12777885 0.14304958 0.10915952 0.1540714 0.04649838
#> 7 0.04876637 0.00000000 0.12777885 0.17582865 0.14304958 0.1053050 0.21348256
#> 8 0.09526475 0.27614370 0.04443201 0.10915952 0.03772609 0.0000000 0.04649838
#> 9 0.13969676 0.08697351 0.12777885 0.14304958 0.00000000 0.1540714 0.04649838
#> 10 0.18223826 0.04443201 0.04443201 0.07408051 0.14304958 0.0000000 0.17427723
#> [,8] [,9] [,10]
#> 1 0.11328584 0.05126699 0.04254151
#> 2 0.00000000 0.14653174 0.23171169
#> 3 0.14836485 0.05126699 0.08334684
#> 4 0.11328584 0.05126699 0.12255218
#> 5 0.03920533 0.00000000 0.12255218
#> 6 0.27753480 0.19096375 0.12255218
#> 7 0.03920533 0.05126699 0.08334684
#> 8 0.14836485 0.14653174 0.04254151
#> 9 0.03920533 0.05126699 0.00000000
#> 10 0.00000000 0.19096375 0.08334684
#>
#> $idf
#> A A A A A A A
#> 1 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 2 17.9180519 17.9180519 17.9180519 17.9180519 17.9180519 17.9180519 17.9180519
#> 3 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 4 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 5 0.3677248 0.3677248 0.3677248 0.3677248 0.3677248 0.3677248 0.3677248
#> 6 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 7 0.5822846 0.5822846 0.5822846 0.5822846 0.5822846 0.5822846 0.5822846
#> 8 0.5822846 0.5822846 0.5822846 0.5822846 0.5822846 0.5822846 0.5822846
#> 9 0.4730853 0.4730853 0.4730853 0.4730853 0.4730853 0.4730853 0.4730853
#> 10 18.1851147 18.1851147 18.1851147 18.1851147 18.1851147 18.1851147 18.1851147
#> B A A
#> 1 0.6931472 0.6931472 0.6931472
#> 2 0.0000000 17.9180519 17.9180519
#> 3 0.6931472 0.6931472 0.6931472
#> 4 0.6931472 0.6931472 0.6931472
#> 5 0.9162907 0.3677248 0.3677248
#> 6 0.6931472 0.6931472 0.6931472
#> 7 0.7537718 0.5822846 0.5822846
#> 8 0.7537718 0.5822846 0.5822846
#> 9 0.8266786 0.4730853 0.4730853
#> 10 0.0000000 18.1851147 18.1851147
#>
#> $iae
#> A A A A A A A
#> 1 1.0958650 1.0958650 1.0958650 1.0958650 1.0958650 1.0958650 1.0958650
#> 2 20.2083165 20.2083165 20.2083165 20.2083165 20.2083165 20.2083165 20.2083165
#> 3 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472 0.6931472
#> 4 0.5914380 0.5914380 0.5914380 0.5914380 0.5914380 0.5914380 0.5914380
#> 5 1.2295683 1.2295683 1.2295683 1.2295683 1.2295683 1.2295683 1.2295683
#> 6 0.7145220 0.7145220 0.7145220 0.7145220 0.7145220 0.7145220 0.7145220
#> 7 2.0190098 2.0190098 2.0190098 2.0190098 2.0190098 2.0190098 2.0190098
#> 8 0.7486753 0.7486753 0.7486753 0.7486753 0.7486753 0.7486753 0.7486753
#> 9 1.5190538 1.5190538 1.5190538 1.5190538 1.5190538 1.5190538 1.5190538
#> 10 20.2083165 20.2083165 20.2083165 20.2083165 20.2083165 20.2083165 20.2083165
#> B A A
#> 1 1.5436865 1.0958650 1.0958650
#> 2 0.0000000 20.2083165 20.2083165
#> 3 2.1972246 0.6931472 0.6931472
#> 4 1.9148196 0.5914380 0.5914380
#> 5 0.4964369 1.2295683 1.2295683
#> 6 3.1421609 0.7145220 0.7145220
#> 7 0.3302417 2.0190098 2.0190098
#> 8 2.1493112 0.7486753 0.7486753
#> 9 0.4248832 1.5190538 1.5190538
#> 10 0.0000000 20.2083165 20.2083165
#>