Max, 

Thanks, I do understand that the final model is fitted.  I think I was not 
clear in my posting.  I am changing datasets between tuning and real training.  
So maybe I tune on "trainset" but its only 5000 rows, doing my gridsearch and 
all that, and then once I have the hyper parameters, I will use an increased 
trainset size, say 25000.

So between tuning and training, I am modifying the trainset, specifically 
making it bigger.  So I have to re-fit the model and I guess what I am trying 
to make sure of is that really the
only thing I need to "carry over" so to speak, is the hyper parameters I was 
looking for.  Is this correct?  That is what I am doing, and simply passing a 
grid with my specific 2 hyperparameters, to avoid it doing any type of search.



Brian

On Nov 23, 2012, at 6:06 PM, Max Kuhn wrote:

> Brian,
> 
> This is all outlined in the package documentation. The final model is fit 
> automatically. For example, using 'verboseIter' provides details. From ?train
> 
> > knnFit1 <- train(TrainData, TrainClasses,
> 
> +                  method = "knn",
> 
> +                  preProcess = c("center", "scale"),
> 
> +                  tuneLength = 10,
> 
> +                  trControl = trainControl(method = "cv", verboseIter = 
> TRUE))
> 
> + Fold01: k= 5 
> 
> - Fold01: k= 5 
> 
> + Fold01: k= 7 
> 
> - Fold01: k= 7 
> 
> + Fold01: k= 9 
> 
> - Fold01: k= 9 
> 
> + Fold01: k=11 
> 
> - Fold01: k=11 
> 
> <snip>
> 
> + Fold10: k=17 
> 
> - Fold10: k=17 
> 
> + Fold10: k=19 
> 
> - Fold10: k=19 
> 
> + Fold10: k=21 
> 
> - Fold10: k=21 
> 
> + Fold10: k=23 
> 
> - Fold10: k=23 
> 
> Aggregating results
> 
> Selecting tuning parameters
> 
> Fitting model on full training set
> 
> 
> 
> Max
> 
> 
> 
> On Fri, Nov 23, 2012 at 5:52 PM, Brian Feeny <bfe...@mac.com> wrote:
> 
> I am used to packages like e1071 where you have a tune step and then pass 
> your tunings to train.
> 
> It seems with caret, tuning and training are both handled by train.
> 
> I am using train and trainControl to find my hyper parameters like so:
> 
> MyTrainControl=trainControl(
>   method = "cv",
>   number=5,
>   returnResamp = "all",
>    classProbs = TRUE
> )
> 
> rbfSVM <- train(label~., data = trainset,
>                method="svmRadial",
>                tuneGrid = expand.grid(.sigma=c(0.0118),.C=c(8,16,32,64,128)),
>                trControl=MyTrainControl,
>                fit = FALSE
> )
> 
> Once this returns my ideal parameters, in this case Cost of 64, do I simply 
> just re-run the whole process again, passing a grid only containing the 
> specific parameters? like so?
> 
> 
> rbfSVM <- train(label~., data = trainset,
>                method="svmRadial",
>                tuneGrid = expand.grid(.sigma=0.0118,.C=64),
>                trControl=MyTrainControl,
>                fit = FALSE
> )
> 
> This is what I have been doing but I am new to caret and want to make sure I 
> am doing this correctly.
> 
> Brian
> 
> ______________________________________________
> 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.
> 
> 
> 
> -- 
> 
> Max


        [[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.

Reply via email to