View source: R/assign_cluster.R
assign_cluster | R Documentation |
Assign assessors to clusters by finding the cluster with highest posterior probability.
assign_cluster(model_fit, soft = TRUE, expand = FALSE)
model_fit |
An object of type |
soft |
A logical specifying whether to perform soft or hard clustering.
If |
expand |
A logical specifying whether or not to expand the rowset of
each assessor to also include clusters for which the assessor has 0 a
posterior assignment probability. Only used when |
A dataframe. If soft = FALSE
, it has one row per assessor, and
columns assessor
, probability
and map_cluster
. If soft = TRUE
, it
has n_cluster
rows per assessor, and the additional column cluster
.
Other posterior quantities:
compute_consensus()
,
compute_posterior_intervals()
,
get_acceptance_ratios()
,
heat_plot()
,
plot.BayesMallows()
,
plot.SMCMallows()
,
plot_elbow()
,
plot_top_k()
,
predict_top_k()
,
print.BayesMallows()
# Fit a model with three clusters to the simulated example data
set.seed(1)
mixture_model <- compute_mallows(
data = setup_rank_data(cluster_data),
model_options = set_model_options(n_clusters = 3),
compute_options = set_compute_options(nmc = 5000, burnin = 1000)
)
head(assign_cluster(mixture_model))
head(assign_cluster(mixture_model, soft = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.