direct_k_cluster {partition} | R Documentation |
Target based on K-means clustering
Description
Directors are functions that tell the partition algorithm what
to try to reduce. as_director()
is a helper function to create new
directors to be used in partitioner
s. partitioner
s can be created with
as_partitioner()
.
direct_k_cluster()
assigns each variable to a cluster using
K-means. As the partition looks for the best reduction,
direct_k_cluster()
iterates through values of k
to assign clusters.
This search is handled by the binary search method by default and thus
does not necessarily need to fit every value of k.
Usage
direct_k_cluster(
.partition_step,
algorithm = c("armadillo", "Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"),
search = c("binary", "linear"),
init_k = NULL,
seed = 1L
)
Arguments
.partition_step |
a |
algorithm |
The K-Means algorithm to use. The default is a fast version
of the LLoyd algorithm written in armadillo. The rest are options in
|
search |
The search method. Binary search is generally more efficient but linear search can be faster in very low dimensions. |
init_k |
The initial k to test. If |
seed |
The seed to set for reproducibility |
Value
a partition_step
object
See Also
Other directors:
as_director()
,
direct_distance()