tests/testthat/testSelectThreshold.R

context("Select Threshold")

data2 <- get(load("../data/example2.RData"))

test_that("SelectThreshold works", {
  expect_setequal(selectThreshold(0.1)(data2, 'clase', IEPConsistency())$featuresSelected, c('x1', 'x2', 'x4', 'x5', 'x3', 'x6'))
  expect_setequal(selectThreshold(0.6)(data2, 'clase', IEPConsistency())$featuresSelected, c('x2', 'x4', 'x5', 'x3', 'x6'))
  expect_setequal(selectThreshold(0.9)(data2, 'clase', IEPConsistency())$featuresSelected, c('x6'))
})

test_that("Name is set", {
  expect_equal(attr(selectThreshold(),'name'),"Select Threshold");
  expect_equal(attr(selectThreshold(),'shortName'),"selectThreshold");
})

Try the FSinR package in your browser

Any scripts or data that you put into this service are public.

FSinR documentation built on Nov. 23, 2020, 5:10 p.m.