man/rmd/mean_shift_meanShiftR.md

For this engine, there is a single mode: partition

Tuning Parameters

This model has 1 tuning parameters:

Translation from tidyclust to the original package (partition)

mean_shift(bandwidth = 0.5) |>
  set_engine("meanShiftR") |>
  set_mode("partition") |>
  translate_tidyclust()
## Mean Shift Clustering Specification (partition)
## 
## Main Arguments:
##   bandwidth = 0.5
## 
## Computational engine: meanShiftR 
## 
## Model fit template:
## tidyclust::.mean_shift_fit_meanShiftR(x = missing_arg(), bandwidth = missing_arg(), 
##     bandwidth = 0.5)

Preprocessing requirements

Factor/categorical predictors need to be converted to numeric values (e.g., dummy or indicator variables) for this engine. When using the formula method via \code{\link[=fit.cluster_spec]{fit()}}, tidyclust will convert factor columns to indicators.

Unlike the LPCM engine, meanShiftR::meanShift() does not scale variables internally and operates on the raw data scale. The bandwidth value is used directly as a per-dimension kernel width on the original variables, and a scalar bandwidth is recycled to a per-column vector. Because of this, appropriate bandwidths typically depend on the spread of the predictors. Standardizing predictors before fitting (for example, with [recipes::step_normalize()]) is recommended; otherwise the default dials::bandwidth() range of c(0.01, 1) may be too narrow.

What does it mean to predict?

To predict the cluster assignment for a new observation, the mean shift procedure is run from the new point against the training data's kernel density estimate. The observation is assigned to the cluster whose training mode is closest to the converged value by Euclidean distance.

References



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.