Nothing
test_that("can train a regression forest", {
expect_silent(
rf <- train(data=iris, response_name="Sepal.Length",
split_rule="maxstat")
)
expect_is(rf, "literanger")
})
test_that("get error when training a classification forest", {
expect_error(
train(data=iris, response_name="Species", split_rule = "maxstat"),
"'arg' should be one of .gini., .extratrees., .hellinger."
)
})
test_that("get error when alpha is outside (0,1]", {
expect_error(train(data=iris, response_name=="Sepal.Length",
split_rule="maxstat", alpha=0))
expect_error(train(data=iris, response_name=="Sepal.Length",
split_rule="maxstat",
alpha=0.5 * (1 + .Machine$double.eps)))
})
test_that("get error when minprop is outside [0,0.5]", {
expect_error(train(data=iris, response_name=="Sepal.Length",
split_rule="maxstat",
minprop=-.Machine$double.xmin))
expect_error(train(data=iris, response_name=="Sepal.Length",
split_rule="maxstat",
minprop=0.5 * (1 + .Machine$double.eps)))
})
test_that("trained forest has acceptable r-squared", {
rf <- train(data=iris, response_name="Sepal.Length", split_rule="maxstat")
expect_gt(1 - rf$oob_error / var(iris$Sepal.Length), 0.5)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.