tests/testthat/test_R_RF.R

library(testthat)
test_that("tests that RF is working", {
  context("Basis test")
  set.seed(1242)
  x <- iris[, -1]
  y <- iris[, 1]
  fo <- RF(x = x, y = y, ntree = 5)

  expect_equal(predict(fo, feature.new = x)[1], 5.148312, tolerance = 0.00001)
})
theo-s/Rforestry_R documentation built on Dec. 23, 2021, 9:55 a.m.