Adiciona contas para acurácia do ensemble.

parent 07097b8a
......@@ -128,6 +128,12 @@ simul <- function(n_class = 3, tx_acer = 0.55, N = 1000) {
mean(u)
}
# Comparando teórico com simulado.
k <- 13
alpha <- 0.7
sum(dbinom(ceiling(k/2):k, size = k, prob = alpha))
simul(n_class = k, tx_acer = alpha, N = 10000)
# Grid de valores nos parâmetros da simulação.
grid <- expand.grid(n_class = c(3, 5, 9, 13, 19, 25),
tx_acer = seq(0.35, 0.95, by = 0.025))
......@@ -150,9 +156,19 @@ xyplot(acc ~ tx_acer,
title = "#Classif.",
cex.title = 1),
grid = TRUE,
type = "o") +
type = "p") +
layer({
panel.abline(v = 0.5, h = 0.5, lty = 2)
}) +
glayer({
k <- group.value
p <- sapply(x,
FUN = function(alpha) {
sum(dbinom(ceiling(k/2):k,
size = k,
prob = alpha))
})
panel.lines(x, p, col = col.line)
})
#-----------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment