Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-10 Thread Prof Brian Ripley
On Wed, 9 Aug 2006, Am Stat wrote:

 Dr. Ripley,

R-help is not the address of `Dr. Ripley', nor even that of the person who 
wrote to you.

 Thanks very much for your help. I have used your partition tree and it works 
 well.  I am not familiar with the 'tree' package but I found that the 
 threshold to make a cut  returned by tree and rpart is almost the same 
 value.
 
 Does that mean the decision boundaries for Rpart and Tree are the same for a 
 same data when using the default  value of parameters, no matter what the 
 structure of data  is?

No, they can differ.  There are comparisons in MASS (the book).

 
 Thanks very much!
 
 Leon
 
 
 
 
 - Original Message - 
 From: Prof Brian Ripley [EMAIL PROTECTED]
 To: Am Stat [EMAIL PROTECTED]
 Cc: r-help@stat.math.ethz.ch
 Sent: Wednesday, August 09, 2006 3:04 AM
 Subject: Re: [R] How to draw the decision boundaries for LDA and Rpart 
 object
 
 
  On Wed, 9 Aug 2006, Am Stat wrote:
 
  Hello useR,
 
  Could you please tell me how to draw the decision boundaries in a
  scatterplot of the original data for a LDA or Rpart object.
 
  There are examples in MASS (the book).
 
  For example:
   library(rpart)
  fit.rpart - rpart(as.factor(group.id)~., data=data.frame(Data) )
 
 
  How can I draw the cutting lines on the orignial Data?
 
  Or is there any built in functions that can read the rpart object
  'fit.rpart' to do that?
 
  See partition.tree in package tree.
 
  PLEASE do read the posting guide 
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
  -- 
  Brian D. Ripley,  [EMAIL PROTECTED]
  Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
  University of Oxford, Tel:  +44 1865 272861 (self)
  1 South Parks Road, +44 1865 272866 (PA)
  Oxford OX1 3TG, UKFax:  +44 1865 272595
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-09 Thread Prof Brian Ripley
On Wed, 9 Aug 2006, Am Stat wrote:

 Hello useR,
 
 Could you please tell me how to draw the decision boundaries in a 
 scatterplot of the original data for a LDA or Rpart object.

There are examples in MASS (the book).

 For example:
  library(rpart)
 fit.rpart - rpart(as.factor(group.id)~., data=data.frame(Data) )
 
 
 How can I draw the cutting lines on the orignial Data?
 
 Or is there any built in functions that can read the rpart object 
 'fit.rpart' to do that?

See partition.tree in package tree.

 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-09 Thread Am Stat
Dr. Ripley,

Thanks very much for your help. I have used your partition tree and it works 
well.  I am not familiar with the 'tree' package but I found that the 
threshold to make a cut  returned by tree and rpart is almost the same 
value.

Does that mean the decision boundaries for Rpart and Tree are the same for a 
same data when using the default  value of parameters, no matter what the 
structure of data  is?

Thanks very much!

Leon




- Original Message - 
From: Prof Brian Ripley [EMAIL PROTECTED]
To: Am Stat [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Wednesday, August 09, 2006 3:04 AM
Subject: Re: [R] How to draw the decision boundaries for LDA and Rpart 
object


 On Wed, 9 Aug 2006, Am Stat wrote:

 Hello useR,

 Could you please tell me how to draw the decision boundaries in a
 scatterplot of the original data for a LDA or Rpart object.

 There are examples in MASS (the book).

 For example:
  library(rpart)
 fit.rpart - rpart(as.factor(group.id)~., data=data.frame(Data) )


 How can I draw the cutting lines on the orignial Data?

 Or is there any built in functions that can read the rpart object
 'fit.rpart' to do that?

 See partition.tree in package tree.

 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-09 Thread hadley wickham
 Could you please tell me how to draw the decision boundaries in a scatterplot 
 of the original data for a LDA or Rpart object.

 For example:
  library(rpart)
 fit.rpart - rpart(as.factor(group.id)~., data=data.frame(Data) )


You might want to have a look a classifly
(http://had.co.nz/classifly/) which will do this in high dimensions.
(You will need to install ggobi for it to work, however)

Hadley

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.