tests/testthat/test-formulas.R

context("Testing formulas")

source("helper-utils.R")

test_succeeds("parse_formula parses formula correct", {
  parsed <- parse_formula(y ~ tf$Tensor(x))
  expect_equal(parsed$features, "tf$Tensor(x)")
  expect_equal(parsed$response, "y")
  expect_equal(parsed$intercept, TRUE)
  
  parsed <- parse_formula(y ~ tf$Tensor(x) + x1)
  expect_equal(parsed$features, c("tf$Tensor(x)", "x1"))
})

Try the tfestimators package in your browser

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

tfestimators documentation built on Aug. 10, 2021, 1:06 a.m.