Description Usage Arguments Value Examples
View source: R/get_params_if_best_at_gridborder.R
Grid-search is often used for parameter selection. An optimization criteria is calculated for pre-defined model parameters (e.g. sigma/gamma and C for the SVM). When the optimum occurs at the limits of the parameters it is possible that extending the parameter range improves the model performance. This functions returns the values of the parameter limits given the optimum occurs at the limits.
1 2 | get_params_if_best_at_gridborder(x, params = NULL, optcrit = NULL,
ignore = NULL)
|
x |
A data frame with one column for each parameter and the optimization criteria. |
params |
The column name(s) of the parameters.
Optional, if |
optcrit |
The column name of the optimization criteria.
Optiona, if |
List with the optimums parameters given it occures at the limits of the parameters.
1 2 3 4 5 6 7 8 9 10 11 | {
x <- expand.grid(p1=1:3,
p2=2:5)
x$oc <- rnorm(nrow(x))
x[8, 3] <- max(x$oc) + 1 # no limit
get_params_if_best_at_gridborder(x, params=c("p1", "p2"), optcrit="oc")
x[4, 3] <- max(x$oc) + 1 # lower limit of p1
get_params_if_best_at_gridborder(x, params=c("p1", "p2"), optcrit="oc")
x[12, 3] <- max(x$oc) + 1 # upper limits of p1 and p2
get_params_if_best_at_gridborder(x, params=c("p1", "p2"), optcrit="oc")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.