Displaying 3 results from an estimated 3 matches for "n_l".
Did you mean:
_l
2011 Jun 13
1
In rpart, how is "improve" calculated? (in the "class" case)
....38 ?
# Here is what I thought it should have been:
# for "information"
entropy <- function(p) {
if(any(p==1)) return(0) # works for the case when y has only 0 and 1
categories...
-sum(p*log(p,2))
}
gini <- function(p) {sum(p*(1-p))}
obs_1 <- y[x>.5]
obs_0 <- y[x<.5]
n_l <- sum(x>.5)
n_R <- sum(x<.5)
n <- length(x)
# for entropy (information)
impurity_root <- entropy(prop.table(table(y)))
impurity_l <- entropy(prop.table(table(obs_0)))
impurity_R <-entropy(prop.table(table(obs_1)))
# shouldn't this have been "improve" ??
impur...
2011 Jun 21
0
How does rpart computes "improve" for split="information"?? (which seems to be different then the "gini" case)
...help with explaining it?
Bellow is some R code simply showing how the gini is computed (and how the
information is not as clear)
# creating data
set.seed(1324)
y <- sample(c(0,1), 20, T)
x <- y
x[1:5] <- 0
# manually making the first split
obs_L <- y[x<.5]
obs_R <- y[x>.5]
n_L <- sum(x<.5)
n_R <- sum(x>.5)
n <- length(x)
calc.impurity <- function(func = gini)
{
impurity_root <- func(prop.table(table(y)))
impurity_L <- func(prop.table(table(obs_L)))
impurity_R <-func(prop.table(table(obs_R)))
imp <- impurity_root - ((n_L/n)*impurity_l + (n...
2009 Jul 23
1
[PATCH server] changes required for fedora rawhide inclusion.
...&)2ylQ;+kdf0E`2
zU%-F%35J5$4w32#B-NA7$d12_?6?Bj at vk$TSi5JH6Ki#`DTjF79xdgQs<Ek_KOi)_
zE<$tg_(O)0b5mFBxVH9HKVB*wrgjQZstUn&w@&R8u93mMQoOC7DW=B2;Yc*6Jrg_+
zLDWMhMkhT?c{+UZxoO}2Rk3xq4|W?0Sra;OToX#6TH~(#RqC=6Eb5~8mRlD!q$q50
zdVBu{+3|h_Lr~kJVcXp@{1=_rxENB@^UxBNeayUW37Xs}2CXBiF-rtDhNnM*gn_l8
z3_ViAIkXAN5UedD>N00RWjz38$a5jG_;W8q at wXvFJ41_q)O*l*uHl&O-}IhKk8<tH
z$=0P_dw4jl44?A>*XyXVy`$U1cAuekRf4;bT^=&T=w|Wn{$%)Is1GSmizlD2PdXx9
zvYpqi!A<SX>omV(go)Rwa(PEcS~vjM+9=rRsdoIK3ZFuw^zcZ`@Wtn*H6CahW{=nH
zgJXwQKSq2?KWWWrcQm?t_E1&VvVA!7Das5NPtS;3v3)n>UFnAOM}o`!Toz&...