tests/testthat/test-sklearn-scalers.R

test_that("Scalers work", {
  withr::with_seed(1234, {
    X <- matrix(rnorm(10), 5, 2)
  })
  mas <- MaxAbsScaler$new()
  expect_snapshot(mas$get_python_class()$fit_transform(X))
  mms <- MinMaxScaler$new()
  expect_snapshot(mms$get_python_class()$fit_transform(X))
  rs <- RobustScaler$new()
  expect_snapshot(rs$get_python_class()$fit_transform(X))
  ss <- StandardScaler$new()
  expect_snapshot(ss$get_python_class()$fit_transform(X))
})

Try the rgudhi package in your browser

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

rgudhi documentation built on March 31, 2023, 11:38 p.m.