Displaying 1 result from an estimated 1 matches for "sumyequal0".
Did you mean:
sumyequal1
2005 May 25
0
Error with user defined split function in rpart (PR#7895)
...re that gets larger
# as the node is less acceptable is fine.
# - the measure underlies cost-complexity pruning, however
temp1 <- function(y, wt, parms) {
print("***** START: TEMP1 *****");
n <- length(y);
# Get the number of y's in each category
sumyEqual0 <- sum(y == 0);
sumyEqual1 <- sum(y == 1);
# Get the proportion of 0's and 1's
p0 <- sumyEqual0/n;
p1 <- sumyEqual1/n;
if (p0 >= p1) {
dev = sumyEqual1;
} else {
dev = sumyEqual0;
}
# Get the vector of labels
labels <- m...