tests/testthat/test-kernels.R

context("test-kernels")

test_that("RBF works", {
  X <- matrix(rnorm(10), 2, 5)
  G <- SE(X, 2, .2)
  expect_true(all(eigen(G)$values>0))
  expect(all(diag(G)-4 < .000001), "Gram matrix diagonal not as expected")
})

test_that("LINEAR works", {
  X <- matrix(rnorm(15), 5, 3)
  G <- LINEAR(X, 1, rep(0, nrow(X)))
  expect_true(all(eigen(G)$values>0))
})

Try the fido package in your browser

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

fido documentation built on June 22, 2024, 9:36 a.m.