assign_cluster: Assign Assessors to Clusters

View source: R/assign_cluster.R

assign_clusterR Documentation

Assign Assessors to Clusters

Description

Assign assessors to clusters by finding the cluster with highest posterior probability.

Usage

assign_cluster(
  model_fit,
  burnin = model_fit$burnin,
  soft = TRUE,
  expand = FALSE
)

Arguments

model_fit

An object of type BayesMallows, returned from compute_mallows.

burnin

A numeric value specifying the number of iterations to discard as burn-in. Defaults to model_fit$burnin, and must be provided if model_fit$burnin does not exist. See assess_convergence.

soft

A logical specifying whether to perform soft or hard clustering. If soft=TRUE, all cluster probabilities are returned, whereas if soft=FALSE, only the maximum a posterior (MAP) cluster probability is returned, per assessor. In the case of a tie between two or more cluster assignments, a random cluster is taken as MAP estimate.

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 soft = TRUE. Defaults to FALSE.

Value

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.

See Also

compute_mallows for an example where this function is used.

Other posterior quantities: compute_consensus.BayesMallows(), compute_consensus.SMCMallows(), compute_consensus(), compute_posterior_intervals.BayesMallows(), compute_posterior_intervals.SMCMallows(), compute_posterior_intervals(), heat_plot(), plot.BayesMallows(), plot.SMCMallows(), plot_elbow(), plot_top_k(), predict_top_k(), print.BayesMallowsMixtures(), print.BayesMallows()


BayesMallows documentation built on Nov. 25, 2023, 5:09 p.m.