Description Usage Arguments Value Author(s) Examples
Entropy for binary target variables (Negative Bernoulli Log-Likelihood)
h = ∑_i{-y_i * log(\hat y_i) - (1- y_i) * log(1 - \hat y_i)}
1 2 3 4 5 6 7 | ## S3 method for class 'modello_number'
bin.entropy(y, yh)
## Default S3 method:
bin.entropy(y, yh)
bin.entropy(y, yh)
|
y |
predicted probability |
yh |
target classes (0 or 1) |
Returns the entropy
Filippo Monari
1 2 3 4 5 6 7 8 9 10 11 12 13 | modello.init(10, 10, 10, 10)
## For modello_numbers
y = number(sample(c(1, 0), 10, replace=TRUE), dx=FALSE)
yh = number(runif(10))
h = bin.entropy(y, yh)
print(h)
print(h$v)
modello.close()
## For numerics
y = sample(c(1, 0), 10, replace=TRUE)
yh = runif(10)
h = bin.entropy(y, yh)
print(h)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.