plot_histograms.similarity: Plotting histograms of similarity measures between...

plot_histograms.similarityR Documentation

Plotting histograms of similarity measures between clusterings

Description

These functions plot histograms of a set of similarity measures obtained through perturbation methods. In particular plot_hist.similarity plots a single histogram referred to a specific number of clusters, while plot_multiple.hist.similarity plots multiple histograms referred to different numbers of clusters (one for each number of clusters, i.e. one for each row of the matrix S of similarity values).

Usage

plot_hist.similarity(sim, nbins = 25)

plot_multiple.hist.similarity(S, n.col = 3, labels = NULL, nbins = 25)

Arguments

sim

vector of similarity values

nbins

number of the bins of the histogram

S

Matrix of similarity values, rows correspond to diferent number of clusters

n.col

number of columns in the grid of the histograms (default = 3)

labels

label of the histograms. If NULL (default) the number of clusters from 2 to nrow(S)+1 are used

Value

No return value, the function is called for its side-effect of drawing a plot on the current graphics device.

Author(s)

Giorgio Valentini valentini@di.unimi.it

See Also

plot_cumulative, plot_cumulative.multiple

Examples

library("clusterv")
# Data set generation
M <- generate.sample6 (n=20, m=10, dim=1000, d=3, s=0.2);
# generation of multiple similarity measures by resampling
Sr.kmeans.sample6 <- do.similarity.resampling(M, c=10, nsub=20, f=0.8, s=sFM, 
                                      alg.clust.sim=Kmeans.sim.resampling); 
# plot of the histograms of similarity measures for clusterings from 2 to 10 clusters:
plot_multiple.hist.similarity (Sr.kmeans.sample6, n.col=3, labels=NULL, nbins=25);
# the same as postrcript file
postscript(file="histograms.eps", horizontal=FALSE, onefile = FALSE);
plot_multiple.hist.similarity (Sr.kmeans.sample6, n.col=3, labels=NULL, nbins=25);
dev.off();
unlink("histograms.eps");
# plot of a single histogram
plot_hist.similarity(Sr.kmeans.sample6[2,], nbins = 25)

mosclust documentation built on June 8, 2025, 11:23 a.m.