Wensui Liu
2007-Nov-26 22:50 UTC
[R] anyway to force rpart() to include a specific predictor
If I understand correctly, rpart() will pick predictor at each node automatically. I am wondering if there is a way to force rpart() including a specific predictor. The reason I am asking is that I'd like to use rpart() to detect interaction terms for some variables. Thanks.
Weiwei Shi
2007-Nov-26 23:25 UTC
[R] anyway to force rpart() to include a specific predictor
just my2cent: could you make a derived feature by including the desired predictor in each of features you use to present to rpart? (by the way, if I can understand your question right, I assume rpart picks only one predictor each time at each node) Best, Weiwei On 11/26/07, Wensui Liu <liuwensui at gmail.com> wrote:> If I understand correctly, rpart() will pick predictor at each node > automatically. I am wondering if there is a way to force rpart() > including a specific predictor. The reason I am asking is that I'd > like to use rpart() to detect interaction terms for some variables. > > Thanks. > > ______________________________________________ > R-help at 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. >-- Weiwei Shi, Ph.D Research Scientist GeneGO, Inc. "Did you always know?" "No, I did not. But I believed..." ---Matrix III