Displaying 11 results from an estimated 11 matches for "ylevel".
Did you mean:
level
2010 May 13
1
cdplot() with 'POSIXct' x
...but use the original POSIXct x to
draw the x axis.
Index: src/library/graphics/R/cdplot.R
===================================================================
--- src/library/graphics/R/cdplot.R (revision 51984)
+++ src/library/graphics/R/cdplot.R (working copy)
@@ -43,8 +43,8 @@
if(!is.null(ylevels))
y <- factor(y, levels = if(is.numeric(ylevels)) levels(y)[ylevels] else ylevels)
x <- mf[,2]
- if(!is.numeric(x))
- stop("explanatory variable should be numeric")
+ if (!(is.numeric(x) || is(x, "POSIXct")))
+ stop("explanatory variab...
2012 Nov 14
3
ctree
Hello,
I plotted a nice tree with "ctree" . It shows 3 nodes with the prediction of
my 2 groups. (see picture)
Unfortunately I need a larger scale to read the exact prediction of my
groups to get the specificity and sensitivity. I tried to change the scale
with "axis" but it didn't work, my guess because it's not a normal graph
with x and y axis.
Has someone an idea
2008 Oct 27
0
Displaying number of Y/N affected by tree in rule form RE: R question/request on rules from rpart
...ks for developing it and
suggesting how to make the enhancement.
Regards,
Dhruv
listrules<-function(model)
{
if (!inherits(model, "rpart")) stop("Not a legitimate rpart tree")
#
# Get some information.
#
frm <- model$frame
names <- row.names(frm)
ylevels <- attr(model, "ylevels")
ds.size <- model$frame[1,]$n
#
# Print each leaf node as a rule.
#
for (i in 1:nrow(frm))
{
if (frm[i,1] == "<leaf>")
{
# The following [,5] is hardwired - needs work!
cat("\n")
cat(sprintf(&q...
2008 Aug 13
2
mob(party) formula question
I try tu use mob() with my data.frame ('data.frame': 288 obs. of 81
variables; factors, numerics and ordered factors)
My response is a binary variable and I should use for modelling a logistic
regression (family=binomial).
I read in the "MOB" Vignette that I could use a formula like this if I would
like to have only partitioning variables apart from the response.
2006 Oct 17
1
Some questions on Rpart algorithm
Hello:
I am using rpart and would like more background on how the splits are made
and how to interpret results - also how to properly use text(.rpart). I have
looked through Venables and Ripley and through the rpart help and still have
some questions. If there is a source (say, Breiman et al) on decision trees
that would clear this all up, please let me know. The questions below
pertain to a
2011 May 26
2
Plot binomial regression line
Dear all,
I am quite new with R and I have a problem with plotting a binomial
regression line in a plot.
This is what I type in:
> model<-glm(Para~Size,binomial)
> par(mfrow=c(1,1))
> xv<-seq(3.2,4.5,0.01)
> yv<-predict(model,list(area=xv),type="response")
> plot(Size,Para)
> lines(xv,yv)
The error message that I get is:
> Error in xy.coords(x, y) :
2002 Aug 28
0
user defined function in rpart
...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) {paste(formatg(yval,digits),"\nn=", n,sep="&qu...
2005 May 25
0
Error with user defined split function in rpart (PR#7895)
...on would also check for bad data, see rpart.poisson
# for instace.
temp3 <- function(y, offset, parms, wt) {
print("***** START: TEMP3 *****");
if (!is.null(offset)) y <- y-offset
ret <- list(y=y, parms=0, numresp=5, numy=1,
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) {paste(formatg(yval,digits),"\nn=", n,sep="&qu...
2002 Aug 29
3
2 questions
Hi all,
I am using R1.5.0 under Unix,
I have a couple of questions here.
1. My program is running out of memory. I am writing a program to grow a
list of trees using rpart() on a subset of a large dataset(5807x693) with
a different response for every tree. I saw that after each tree was
constucted, 116 MB of data was being added to the Vcells. I have no idea
what this data is. My dataset is
2012 Jan 08
2
rpart question
We are trying to make a decision tree using rpart and we are continually
running into the following error:
> fit_rpart=rpart(ENROLL_YN~MINORITY,method="class")
> summary(fit_rpart)
Call:
rpart(formula = ENROLL_YN ~ MINORITY, method = "class")
n= 5725
CP nsplit rel error
1 0 0 1
Error in yval[, 1] : incorrect number of dimensions
ENROLL_YN is a
2005 Aug 26
1
Help in Compliling user -defined functions in Rpart
...ned 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]=(sum(wt[1:i])+0.5*wt[i+1])/n} #fractional ran...