tests/testthat/test-sql-datasets.R

context("sql datasets")

test_succeeds("sqlite_dataset creates a dataset", {

  skip_if_no_tensorflow()

  record_spec <- sql_record_spec(
    names = c("disp", "drat", "vs", "gear", "mpg", "qsec", "hp", "am", "wt",  "carb", "cyl"),
    types = c(tf$float64, tf$int32, tf$float64, tf$int32, tf$float64, tf$float64,
              tf$float64, tf$int32, tf$int32, tf$int32, tf$int32)
  )

  dataset <- sqlite_dataset(
    'data/mtcars.sqlite3',
    'select * from mtcars',
    record_spec
  )

})

Try the tfdatasets package in your browser

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

tfdatasets documentation built on June 30, 2022, 1:04 a.m.