Perform clustering on the rows (usually cases) of a dataset.
cluster(
x,
algorithm = "KMeans",
config = NULL,
execution_config = setup_FutureExecution(),
outdir = NULL,
verbosity = 1L
)Clustering object.
Matrix, data.frame, or ClusterConfig object: Data to cluster (rows
are cases to be clustered), or a ClusterConfig recipe (from
setup_ClusterConfig) carrying the data path, algorithm config, and output
directory.
Character: Clustering algorithm. Not needed when config is
supplied, which names its own; an explicit algorithm that disagrees with
config is an error.
ClusteringConfig, optional: Algorithm-specific config from a
clustering setup_* function. Its features selects the columns to cluster
on; NULL selects every numeric column of x, since a clustering backend
reads numbers. The returned object's config carries the resolved names.
ExecutionConfig object: Execution settings, e.g.
setup_FutureExecution or setup_SerialExecution. A clustering dispatches
no work to other processes and no registered algorithm threads, so the fit
runs on one thread; the config's seed seeds it.
Character, optional: Output directory. If not NULL, the returned
Clustering object is saved there as an .rds file, alongside a run record
(cluster_<algorithm>.record.json) stating what the run resolved. See
write_record.
Integer: Verbosity level.
EDG
See docs.rtemis.org/r for detailed documentation.
iris_km <- cluster(exc(iris, "Species"), algorithm = "KMeans")
Run the code above in your browser using DataLab