Displaying 20 results from an estimated 1000 matches similar to: "RPart Simple Diagram issues"
2011 Dec 27
0
Using minsplit and unequal weights in rpart
Dear r-help mailing list,
Is there a way to incorporate weights into the minsplit criteria in rpart,
when the weights are uneven? I could not find a way for the minsplit
threshold to take the weights into account, and when the weights are uneven
it becomes an issue, as the following example shows.
My current workaround is to expand the data into one in which each row is
an observation, but that
2004 May 07
0
rpart for CART with weights/priors
Hi,
I have a technical question about rpart:
according to Breiman et al. 1984, different costs for misclassification in
CART can be modelled
either by means of modifying the loss matrix or by means of using different
prior probabilities for the classes,
which again should have the same effect as using different weights for the
response classes.
What I tried was this:
library(rpart)
2011 Jan 26
2
Extracting the terms from an rpart object
Hello all,
I wish to extract the terms from an rpart object.
Specifically, I would like to be able to know what is the response variable
(so I could do some manipulation on it).
But in general, such a method for rpart will also need to handle a "." case
(see fit2)
Here are two simple examples:
fit1 <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
fit1$call
fit2 <-
2012 Mar 04
1
rpart package, text function, and round of class counts
I run the following code:
library(rpart)
data(kyphosis)
fit <- rpart(Kyphosis ~ ., data=kyphosis)
plot(fit)
text(fit, use.n=TRUE)
The text labels represent the count of each class at the leaf node.
Unfortunately, the numbers are rounded and in scientific notation rather
than the exact number of examples sorted by that node in each class.
The plot is supposed to look like
2009 Dec 14
1
RPART - printing full splitting rule number on tree plot
Dear R-users
I am using RPART package to get regression trees. However having trouble getting the text function to put the full splitting rule number on the plot, instead to puts it in scientific notation. When a covariate has 1e4 or greater number of digits then the splitting rule number displayed on the plot is in scientific notation. But print.rpart displays the splitting rules in full.
2010 Dec 13
2
rpart.object help
Hi,
Suppose i have generated an object using the following :
fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
And when i print fit, i get the following :
n= 81
node), split, n, loss, yval, (yprob)
* denotes terminal node
1) root 81 17 absent (0.7901235 0.2098765)
2) Start>=8.5 62 6 absent (0.9032258 0.0967742)
4) Start>=14.5 29 0 absent (1.0000000
2009 Sep 14
1
summary of rpart-Object in tktext window?
Hi,
is it possible to put a summary of an rpart-Object into a tktext-window?
Here is what I'm trying to do:
fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
tt <- tktoplevel()
tex <- tktext(tt)
tkpack(tex)
tkinsert(tex, "end", summary(fit))
But since the summary of an object is a list, I always get back the
following error-message:
cannot handle object of
2010 Mar 07
1
Is there an equivalence of lm's “anova” for an rpart object ?
Simple example:
# Classification Tree with rpart
library(rpart)
# grow tree
fit <- rpart(Kyphosis ~ Age + Number + Start,
method="class", data=kyphosis)
Now I would like to know how can I measure the "importance" of each of my
three explanatory variables (Age, Number, Start) in the model?
If this was a regression model, I could have looked at p values from the
2010 May 03
1
rpart, cross-validation errors question
I ran this code (several times) from the Quick-R web page (
http://www.statmethods.net/advstats/cart.html) but my cross-validation
errors increase instead of decrease (same thing happens with an unrelated
data set).
Why does this happen?
Am I doing something wrong?
# Classification Tree with rpart
library(rpart)
# grow tree
fit <- rpart(Kyphosis ~ Age + Number + Start,
2011 Jan 26
1
Inconsistencies in the rpart.object help file?
Hello all,
I'm was going through the help for
?rpart.object
And noticed some inconsistencies, Some might be a mistake in the help file
and some might be my misunderstanding.
The help in the section:
value -> frame (first paragraph), states that:
> yval, the fitted value of the response at each node, *and splits, a two
> column matrix of left and right split labels for each node. *
2012 Apr 12
2
enableJIT(2) causes major slow-up in rpart
Hello,
Due to exploration of the JIT capabilities offered through the {compiler}
package, I came by the fact that using enableJIT(2) can *slow* the rpart
function (from the {rpart} package) by a magnitude of about 10 times.
Here is an example code to run:
library(rpart)
require(compiler)
enableJIT(0) # just making sure that JIT is off # We could also use
enableJIT(1) and it would be fine
fo
2011 Jul 29
1
help with predict.rpart
? data=read.table("http://statcourse.com/research/boston.csv", ,
sep=",", header = TRUE)
? library(rpart)
? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+
PT+B+LSTAT)
predict(fit,data[4,])
plot only reveals part of the tree in contrast to the results on obtains
with CART or C5
-------- Original Message --------
Subject: Re: [R] help with rpart
From: Sarah
2009 Feb 03
5
Large file size while persisting rpart model to disk
I am using rpart to build a model for later predictions. To save the
prediction across restarts and share the data across nodes I have been
using "save" to persist the result of rpart to a file and "load" it
later. But the saved size was becoming unusually large (even with
binary, compressed mode). The size was also proportional to the amount
of data that was used to create the
2011 Sep 08
1
"rpart" or "tree" function issue
I am trying to create a classification tree using either tree or rpart
functions but when it comes to plotting the results the formatting I get is
different than what I see in all the tutorials (like
http://www.youtube.com/watch?v=9XNhqO1bu0A or
http://www.youtube.com/watch?v=m3mLNpeke0I&feature=related or
http://www.statmethods.net/advstats/cart.html "tree for kyphosis"). I am
2011 May 12
1
Saving misclassified records into dataframe within a loop
Greetings R world,
I know some version of the this question has been asked before, but i need
to save the output of a loop into a data frame to eventually be written to a
postgres data base with dbWriteTable. Some background. I have developed
classifications models to help identify problem accounts. The logic is this,
if the model classifies the record as including variable X and it turns out
2004 Jun 29
0
gambling problem
Hi all
i have an interesting project that i have been working on. i intended to
set this as a first year programming problem but then changed my mind
since i thought that it might be too difficult for them to program.
the problem is as follows:
You have been approached by a local casino in order to
investigate the performance of one of their slot machines.
The slot machine
2008 Mar 30
1
Plot for jump point
Hi,
My code is as the following,
ratio<-seq(0,1,by=0.01)
payoff<-NULL
for (i in 1:length(ratio) )
{
payoff1<-100*(ratio[i]>=0.7)+max(100*(1+(ratio[i]-1)*2),0)*(ratio[i]<0.7)
payoff<-c(payoff,payoff1)
}
plot(ratio,payoff, xlab='ST/S0', ylab='Payoff',type='l')
I have the discontinuous point at ratio=0.7. I do not want to have the line at 0.7, and would
2011 Apr 22
3
Parametrized object name in Save statement
Greetings All,
I am looking to write a parametrized Rscript that will accept a variable
name(that also is the name of the flat file), transform the data into a data
frame and preform various modeling on the structure and save the output and
plot of the model. In this example i am using a rpart decision tree. The
only problem i am having is integrating the parameter into the internal
object name
2010 Jul 12
1
Using +<group> in "valid users" is not working
Hello to all,
I have recently upgraded to SAMBA 3.4.2 on Solaris 10, and reconfigured it to use domain authentication (security = domain). We slapped guest authentication on most shares, with an explicit "valid users = ...." on a small number of sensitive shares. Due to the number of users we were looking at, we set up two UNIX groups "payroll" and "payoff" and
2013 Mar 24
1
Error with paired t-test
This error keeps appearing when i perform a paired t-test in R
Error in t.test.default(payoff, paired = T) : 'y' is missing for paired test
This is the method i have used
> read.table("MeanPayoff.txt",header=T) Open Closed1 47.50000 42.37502 49.25000 50.00003 50.00000 49.80004 33.50000 20.00005 34.75000 33.88006 35.50000 20.50007 33.35000 12.87508 50.00000