Skip to contents

Formula: L(w) = -sum_i sum_j [ y_ij log(yhat_ij) + (1 - y_ij) log(1 - yhat_ij) ]

Usage

Bcelo(Y, P)

Arguments

Y

Observed 0/1 outcomes; a flat vector is read as one column.

P

Predicted success probabilities, strictly inside (0, 1).

Value

List with loss, mean_loss, n, L.

References

Montesinos Lopez, Montesinos Lopez and Crossa (2022), Multivariate Statistical Machine Learning Methods for Genomic Prediction, Springer, doi:10.1007/978-3-030-89010-0. Chapter 10, Sect. 10.7, pp. 400-403. Read from the chapter PDF, not recalled. BOOK DEFECT: the display in Sect. 10.7.2 prints this loss without its leading minus sign, even though the same paragraph calls it the negative log-likelihood of a product of Bernoulli distributions and the Poisson loss two displays later does carry its sign. What is implemented here is the quantity the surrounding text requires – a loss that is minimised – not the sign-dropped display. The book has not been silently corrected elsewhere.

Examples

Bcelo(Y = 5L, P = 0.5)
#> $loss
#> [1] 0.6931472
#> 
#> $mean_loss
#> [1] 0.6931472
#> 
#> $n
#> [1] 1
#> 
#> $L
#> [1] 1
#> 
#> $method
#> [1] "Binary cross-entropy loss, MVSML Sect. 10.7.2"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"