Skip to contents

X theta normalised row by row through morie_geron_softmax_function, the same delegation the Python module makes to hmsftm.

Usage

morie_geron_softmax_score(X, theta)

Arguments

X

(m, d) design matrix.

theta

(d, K) coefficients.

Value

List with scores, p, probabilities, predicted (0-based), estimate, n.

Examples

morie_geron_softmax_score(matrix(c(1, 2, 0.5, -1), nrow = 2,
    byrow = TRUE), matrix(c(0.3, -0.2, 0.5, 1, 0.4, -0.7), nrow = 2,
    byrow = TRUE))
#> $scores
#>       [,1] [,2]  [,3]
#> [1,]  2.30  0.6 -0.90
#> [2,] -0.85 -0.5  0.95
#> 
#> $p
#>           [,1]      [,2]       [,3]
#> [1,] 0.8173636 0.1493189 0.03331754
#> [2,] 0.1180817 0.1675659 0.71435247
#> 
#> $probabilities
#>           [,1]      [,2]       [,3]
#> [1,] 0.8173636 0.1493189 0.03331754
#> [2,] 0.1180817 0.1675659 0.71435247
#> 
#> $predicted
#> [1] 0 2
#> 
#> $estimate
#> [1] 0.765858
#> 
#> $n
#> [1] 2
#> 
#> $method
#> [1] "Linear class scores X @ theta, normalised via hmsftm"
#>