Doubt in Algorithm Tunning?


  1. Is it correct to say that Algorithm tunning is performed only after algorithm is finalized?
    But how to use tunning results to fit in the selected algorithm.
    i know how to calculate “Alpha” while tunning but don’t know to fit in final algo any of :SVM / KNN etc…

Create model with default paramters

trainControl <- trainControl(method=“repeatedcv”, number=10, repeats=3)
seed <- 7
metric <- “Accuracy"
mtry <- sqrt(ncol(x))
tunegrid <- expand.grid(.mtry=mtry)
rfDefault <- train(Class~., data=dataset, method=“rf”, metric=metric, tuneGrid=tunegrid,

can please someone take a minute to mae me understand this?

Best Regards,


The optimization function from the caret package outputs a model with the results of each iteration and already includes the best parameter choice. You can just call predict(rfDefault, newdata = testdata) to make a prediction with the optimized parameters. For more information, I recommend reading the caret docs (which are superb, by the way).

About optimization of specific models, see this list of learning algorithms supported.


Thanks caiotaniguchi for the knowledge.