This is a wrapper around the Python class sklearn.cluster.MeanShift.
Super classes
rgudhi::PythonClass
-> rgudhi::SKLearnClass
-> rgudhi::BaseClustering
-> MeanShift
Methods
Method new()
The MeanShift class constructor.
Usage
MeanShift$new(
bandwidth = NULL,
seeds = NULL,
bin_seeding = FALSE,
min_bin_freq = 1L,
cluster_all = TRUE,
n_jobs = 1L,
max_iter = 300L
)
Arguments
bandwidth
A numeric value specifying the bandwidth used in the RBF kernel. If
NULL
, the bandwidth is estimated using sklearn.cluster.estimate_bandwidth(). Defaults toNULL
.seeds
A numeric matrix of shape \(n_\mathrm{samples} \times n_\mathrm{features}\) specifying the seeds used to initialize kernels. If
NULL
, the seeds are calculated bysklearn.cluster.get_bin_seeds()
with bandwidth as the grid size and default values for other parameters. Defaults toNULL
.bin_seeding
A boolean value specifying whether initial kernel locations are not locations of all points, but rather the location of the discretized version of points, where points are binned onto a grid whose coarseness corresponds to the bandwidth. Setting this option to
TRUE
will speed up the algorithm because fewer seeds will be initialized. Defaults toFALSE
. Ignored ifseeds
is notNULL
.min_bin_freq
An integer value specifying the minimal size of bins. To speed up the algorithm, accept only those bins with at least
min_bin_freq
points as seeds. Defaults to1L
.cluster_all
A boolean value specifying whether all points are clustered, even those orphans that are not within any kernel. Orphans are assigned to the nearest kernel. If
FALSE
, then orphans are given cluster label-1
. Defaults toTRUE
.n_jobs
An integer value specifying the number of jobs to use for the computation. This works by computing each of the
n_init
runs in parallel. Defaults to1L
.max_iter
An integer value specifying the maximum number of iterations per seed point before the clustering operation terminates (for that seed point) if it has not yet converged. Defaults to
300L
.