tests/testthat/_snaps/mean_shift.md

bad input

Code
  mean_shift(mode = "bogus")
Condition
  Error in `mean_shift()`:
  ! "bogus" is not a known mode for model `mean_shift()`.
Code
  bt <- set_engine(mean_shift(bandwidth = -1), "LPCM")
  fit(bt, mpg ~ ., mtcars)
Condition
  Error in `check_args()`:
  ! The bandwidth used for clustering should be > 0, not -1.
Code
  translate_tidyclust(mean_shift(), engine = NULL)
Condition
  Error in `translate_tidyclust.default()`:
  ! Please set an engine.
Code
  translate_tidyclust(mean_shift(formula = ~x))
Condition
  Error in `mean_shift()`:
  ! unused argument (formula = ~x)

printing

Code
  mean_shift()
Output
  Mean Shift Clustering Specification (partition)

  Computational engine: LPCM
Code
  mean_shift(bandwidth = 0.5)
Output
  Mean Shift Clustering Specification (partition)

  Main Arguments:
    bandwidth = 0.5

  Computational engine: LPCM

updating

Code
  update(mean_shift(bandwidth = 0.5), bandwidth = tune())
Output
  Mean Shift Clustering Specification (partition)

  Main Arguments:
    bandwidth = tune()

  Computational engine: LPCM

errors if bandwidth isn't specified

Code
  fit(set_engine(mean_shift(), "LPCM"), ~., data = mtcars)
Condition
  Error in `fit()`:
  ! Please specify `bandwidth` to be able to fit specification.

errors if bandwidth isn't specified (meanShiftR)

Code
  fit(set_engine(mean_shift(), "meanShiftR"), ~., data = mtcars)
Condition
  Error in `fit()`:
  ! Please specify `bandwidth` to be able to fit specification.

errors on bandwidth length mismatch (meanShiftR)

Code
  .mean_shift_fit_meanShiftR(as.matrix(mtcars), bandwidth = c(1, 2))
Condition
  Error in `fit()`:
  ! `bandwidth` must have length 1 or 11, not 2.


Try the tidyclust package in your browser

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

tidyclust documentation built on June 20, 2026, 9:08 a.m.