Re: [R] splitting dataset based on variable and re-combining

2012-12-10 Thread Thomas Stewart
Why not use an indicator variable? P1 <- ... # prediction from model 1 (Setosa) for entire dataset P2 <- ... # prediction from model 2 for entire dataset I <- Species=="setosa" # Predictions <- P1 * I + P2 * ( 1 - I ) On Monday, December 10, 2012, Brian Feeny wrote: > > I have a dataset and I

Re: [R] splitting dataset based on variable and re-combining

2012-12-10 Thread Brian Feeny
I will look into that, thanks. I am afraid I don't quite understand what is going on there with the multiplication, so I will need to read up. What I ended up doing was like so: For train data, its easy, as I can subset to have the model only work off the data I want: rbfSVM_setosa <-

Re: [R] splitting dataset based on variable and re-combining

2012-12-10 Thread David L Carlson
gt; -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Brian Feeny > Sent: Monday, December 10, 2012 4:41 PM > To: r-help@r-project.org > Subject: [R] splitting dataset based on variable and re-combining > > &

[R] splitting dataset based on variable and re-combining

2012-12-10 Thread Brian Feeny
I have a dataset and I wish to use two different models to predict. Both models are SVM. The reason for two different models is based on the sex of the observation. I wish to be able to make predictions and have the results be in the same order as my original dataset. To illustrate I will us