tests/testthat/test-split_graph.R

test_that("multiplication works", {

  set.seed(17)

  M <- rsparsematrix(8, 12, nnz = 30, rand.x = NULL)

  graph_parts <- split_graph(M)

  expect_equal(
    graph_parts$train + graph_parts$test,
    methods::as(M, "dMatrix")
  )
})

Try the gdim package in your browser

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

gdim documentation built on Sept. 8, 2023, 5:56 p.m.