Displaying 8 results from an estimated 8 matches for "numresp".
Did you mean:
numres
2004 Jun 17
2
using "= matrix (...)" in .C calls
...cptable = matrix(double(numcp*cpcol), nrow=cpcol),
dsplit = matrix(double(1), nsplit,3),
isplit = matrix(integer(1), nsplit,3),
csplit = catmat,
dnode = matrix(double(1), nodes, 3+numresp),
inode = matrix(integer(1), nodes, 6),
PACKAGE = "rpart")
Which in communicates with the C code in "s_to_rp.c"
void s_to_rp2(Sint *n, Sint *nsplit, Sint *nnode, Sint
*ncat,
Sint *numcat, Sint *...
2005 May 25
0
Error with user defined split function in rpart (PR#7895)
...rop[i])
direc[i] <- -1;
}
goodness <- (lprop + rprop);
ret <- list(goodness= goodness, direction=direc)
print("***** END: TEMP2 *****");
ret
}
# The init function:
# fix up y to deal with offsets
# return a dummy parms list
# numresp is the number of values produced by the eval routine's "label"
# numy is the number of columns for y
# summary is a function used to print one line in summary.rpart
# text is a function used to put text on the plot in text.rpart
# In general, this function would also check for b...
2007 Feb 18
3
User defined split function in rpart
Dear R community,
I am trying to write my own user defined split function for rpart. I read
the example in the tests directory and I understand the general idea of the
how to implement user defined splitting functions. However, I am having
troubles with addressing the data frame used in calling rpart in my split
functions.
For example, in the evaluation function that is called once per node,
2002 Aug 28
0
user defined function in rpart
...<=i]~-1))^2))
gd[x==i]<-ndev-(lft+rt)
#dir[x==i]<-1
}
list(goodness=gd , direction=)
}
else{
list(goodness= , direction = )
}
}
tst.init<-function(y, offset, parms, wt){
browser()
if (!is.null(offset)) y <- y-offset
list(y=y, parms=0, numresp=2, numy=2,
summary= function(yval, dev, wt, ylevel, digits ) {
paste(" mean=", format(signif(yval, digits)),
", MSE=" , format(signif(dev/wt, digits)),
sep='')
},
text= function(yval, dev, wt, ylevel, digits, n, use.n ) {
if(use.n) {pa...
2002 Apr 25
1
understanding and resolving seg faults
...cptable = matrix(double(numcp*cpcol), nrow=cpcol),
dsplit = matrix(double(1), nsplit,3),
isplit = matrix(integer(1), nsplit,3),
csplit = catmat,
dnode = matrix(double(1), nodes, 3+numresp),
deltaI = matrix(double(1), nodes, nsplit),
inode = matrix(integer(1), nodes, 6))
--
Clayton Springer, Ph. D.
Sandia National Laboratories csprin@ca.sandia.gov
Biosystems Research Department (925) 29...
2005 Aug 26
1
Help in Compliling user -defined functions in Rpart
...####################################User
defined function
#####################################################################
temp.init<-function(y,offset,parms,wt){
if (!is.null(offset)) y<-y-offset
if (is.matrix(y))stop ("response must be a vector")
list(y=y,parms=0,numy=1,numresp=1,
summary=function(yval,dev,wt,ylevel,digits){
paste("mean=",format(signif(yval,digits)),
"MSE=",format(signif(dev/wt,digits)),
sep='')
})
}
temp.eval<-function(y,wt,parms){
n<-length(y)
r<-wt
for (i in 1:n-1) {r[i+1]=(...
2002 Jan 25
0
rpart subsets
...is point the rpart run will
complete but will have many NaN's in the rpart$frame for yval's. This is
because of an oversight in rpart.s when calculating the probabilities for
each node. The change to the function rpart in rpart.s is:
if (method.int ==3 ) {
numclass <- init$numresp -1
temp <- rp$dnode[,-(1:4)] %*% diag(init$parms$prior*
sum(init$counts)/init$counts)
# Bob's clumsy attempt to remove the NaN's that result when
# calculating the probabilities
tempx <- matrix(0, nrow=nrow(temp), ncol=ncol(temp))
tempx[which(is.finite(temp))] <...
2002 Jan 28
0
rpart subset fix
...is point the rpart run will
complete but will have many NaN's in the rpart$frame for yval's. This is
because of an oversight in rpart.s when calculating the probabilities for
each node. The change to the function rpart in rpart.s is:
if (method.int ==3 ) {
numclass <- init$numresp -1
temp <- rp$dnode[,-(1:4)] %*% diag(init$parms$prior*
sum(init$counts)/init$counts)
# Bob's clumsy attempt to remove the NaN's that result when
# calculating the probabilities
tempx <- matrix(0, nrow=nrow(temp), ncol=ncol(temp))
tempx[which(is.finite(temp))] <...