Description Usage Arguments Value See Also Examples
With the help of this function the out of bag curves for parameters like mtry, sample.fraction and min.node.size of random forests can be created for any measure that is available in the mlr package.
1 2 | OOBCurvePars(lrn, task, pars = c("mtry"), nr.grid = 10, par.vals = NULL,
measures = list(auc))
|
lrn |
The learner created with |
task |
Learning task created by the function |
pars |
One of the hyperparameter "mtry", "sample.fraction" or "min.node.size". |
nr.grid |
Number of points on hyperparameter space that should be evaluated (distributed equally) |
par.vals |
Optional vector of hyperparameter points that should be evaluated. If set, nr.grid is not used anymore. Default is NULL. |
measures |
List of performance measure(s) of mlr to evaluate. Default is mmce for classification and mse for regression. See the mlr tutorial for a list of available measures for the corresponding task. |
Returns a list with parameter values and a list of performances.
OOBCurve
for out-of-bag curves dependent on the number of trees.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
library(mlr)
task = sonar.task
lrn = makeLearner("classif.ranger", predict.type = "prob", num.trees = 1000)
results = OOBCurvePars(lrn, task, measures = list(auc))
plot(results$par.vals, results$performances$auc, type = "l", xlab = "mtry", ylab = "auc")
lrn = makeLearner("classif.ranger", predict.type = "prob", num.trees = 1000, replace = FALSE)
results = OOBCurvePars(lrn, task, pars = "sample.fraction", measures = list(mmce))
plot(results$par.vals, results$performances$mmce, type = "l", xlab = "sample.fract.", ylab = "mmce")
results = OOBCurvePars(lrn, task, pars = "min.node.size", measures = list(mmce))
plot(results$par.vals, results$performances$mmce, type = "l", xlab = "min.node.size", ylab = "mmce")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.