Plot cluster labels
plot.dpmixgpd_cluster_labels.RdVisualize representative cluster sizes, assignment certainty, or cluster-specific response
summaries. For type = "summary", the response view is shown as boxplots ordered by
cluster size or label. When x comes from predict(..., newdata = ...), only clusters
represented in the new sample are displayed.
Arguments
- x
Cluster labels object.
- type
Plot type:
"sizes": bar chart of representative cluster sizes"certainty": assignment certainty distribution"summary": cluster-specific response boxplots
- top_n
Number of populated representative clusters to display for
type = "sizes"ortype = "summary". UseNULLto display all populated clusters.- order_by
Ordering rule for cluster displays:
"size": decreasing cluster size"label": ascending cluster label
- plotly
Logical; if
TRUE, convert theggplot2output to aplotly/htmlwidgetrepresentation via.wrap_plotly(). Defaults togetOption("CausalMixGPD.plotly", FALSE).- ...
Unused.
Details
This method visualizes the representative partition stored in a
dpmixgpd_cluster_labels object. The sizes view emphasizes the empirical
distribution of the selected clusters, the certainty view summarizes the
assignment scores \(\max_k p_{ik}\), and the summary view compares the
attached response data across representative clusters.
For new-data prediction, the plots are always interpreted relative to the representative training clusters. That is why only clusters observed in the predicted sample are shown even though the training partition may contain additional occupied groups.
See also
summary.dpmixgpd_cluster_labels(), predict.dpmixgpd_cluster_fit().
Other cluster workflow:
dpmgpd.cluster(),
dpmix.cluster(),
plot.dpmixgpd_cluster_bundle(),
plot.dpmixgpd_cluster_fit(),
plot.dpmixgpd_cluster_psm(),
predict.dpmixgpd_cluster_fit(),
print.dpmixgpd_cluster_bundle(),
print.dpmixgpd_cluster_fit(),
print.dpmixgpd_cluster_labels(),
print.dpmixgpd_cluster_psm(),
summary.dpmixgpd_cluster_bundle(),
summary.dpmixgpd_cluster_fit(),
summary.dpmixgpd_cluster_labels(),
summary.dpmixgpd_cluster_psm()