[R] using rpart with a tree misclassification condition

2010-11-22 Thread meytar

Hello
I want to build a classification tree for a binary response variable
while the condition for the final tree should be :
The total misclassification for each group (zero or one) will be less then
10% .
for example: if I have in the root 100 observations, 90 from group 0 and 10
from group 1, I want that in the final tree a maximum of 9 and 1
observations out of group 0 and 1, respectively, will be misclassified.
Does anyone know what code will be appropriate for implementing this
condition?
Thank you in advance
Meytar 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/using-rpart-with-a-tree-misclassification-condition-tp3053167p3053167.html
Sent from the R help mailing list archive at Nabble.com.

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] using rpart with a tree misclassification condition

2010-11-22 Thread Uwe Ligges



On 22.11.2010 08:32, meytar wrote:


Hello
I want to build a classification tree for a binary response variable
while the condition for the final tree should be :
The total misclassification for each group (zero or one) will be less then
10% .
for example: if I have in the root 100 observations, 90 from group 0 and 10
from group 1, I want that in the final tree a maximum of 9 and 1
observations out of group 0 and 1, respectively, will be misclassified.
Does anyone know what code will be appropriate for implementing this
condition?



If you mean the misclassification for new observations: no, otherwise I 
would be extremely rich.


If you meant the apparent error rate: Just grow a full tree and then 
prune step by step until the error is too large for your condition. Then 
just take the tree model from one step before 


Uwe Ligges








Thank you in advance
Meytar


__
R-help@r-project.org 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] using rpart with a tree misclassification condition

2010-11-22 Thread meytar

Thank you for your prompt reply!
Yes, I meant the apparent error rate.
According to your advice, if I use rpart to build a full tree, what
pruning command will be appropriate and will able me to add as an input to
the pruning procedure the total error rate i'm looking for?
Thank you very much
Meytar
-- 
View this message in context: 
http://r.789695.n4.nabble.com/using-rpart-with-a-tree-misclassification-condition-tp3053167p3053230.html
Sent from the R help mailing list archive at Nabble.com.

[[alternative HTML version deleted]]

__
R-help@r-project.org 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.