Tuning Hyper-Parameters in R Using MLR

rlogo

Recently, I was trying to tune hyper-parameters for support vector machines using the ksvm function. As ksvm is the default utility used by rattle for support vector machines, and I did most of my exploratory work in rattle, I needed something that worked with existing rattle code.

The mlr library in R contains a utility that allows you to do this. In this gist are examples for Support Vector Machines and Random Forests.

If you are using some of the more generic models in R, you may be able to use the following utility, tune.

https://www.rdocumentation.org/packages/e1071/versions/1.6-8/topics/tune

Update: Yet another alternative method to do grid-search in R is to use the caret library.