plot.fclust: Plotting fuzzy clustering output

plot.fclustR Documentation

Plotting fuzzy clustering output

Description

Plot method for class fclust. The function creates a scatter plot visualizing the cluster structure. The objects are represented by points in the plot using observed variables or principal components.

Usage

 ## S3 method for class fclust
 ## S3 method for class 'fclust'
 plot(x, v1v2, colclus, umin, ucex, pca, ...)

Arguments

x

Object of class fclust

v1v2

Vector with two elements specifying the numbers of the variables (or of the principal components) to be plotted (default: 1:2); in case of relational data, the argument is ignored

colclus

Vector specifying the color palette for the clusters (default: palette(rainbow(k)))

umin

Lowest maximal membership degree such that an object is assigned to a cluster (default: 0)

ucex

Logical value specifying if the points are magnified according to the maximal membership degree (if ucex=TRUE) (default: ucex=FALSE)

pca

Logical value specifying if the objects are represented using principal components (if pca=TRUE) (default: pca=FALSE); in case of relational data, the argument is ignored

...

Additional arguments arguments for plot

Details

In the scatter plot the objects are represented by circles (pch=16) and the prototypes by stars (pch=8) using observed variables (if pca=FALSE) or principal components (if pca=TRUE), the numbers of which are specified in v1v2. Their colors differ for every cluster according to colclus. Objects such that their maximal membership degrees are lower than umin are in black. The sizes of the circles depends on the maximal membership degrees of the corresponding objects if ucex=TRUE. Also note that principal components are extracted using standardized data.
In case of relational data, the first two components resulting from Non-metric Multidimensional Scaling performed using the package MASS are used.

Author(s)

Paolo Giordani, Maria Brigida Ferraro, Alessio Serafini

See Also

VIFCR, VAT, VCV, VCV2, Fclust, print.fclust, summary.fclust, Mc

Examples

## McDonald's data
data(Mc)
names(Mc)
## data normalization by dividing the nutrition facts by the Serving Size (column 1)
for (j in 2:(ncol(Mc)-1))
Mc[,j]=Mc[,j]/Mc[,1]
## removing the column Serving Size
Mc=Mc[,-1]
## fuzzy k-means
## (excluded the factor column Type (last column))
clust=FKM(Mc[,1:(ncol(Mc)-1)],k=6,m=1.5,stand=1)
## Scatter plot of Calories vs Cholesterol (mg)
names(Mc)
plot(clust,v1v2=c(1,5))
## Scatter plot of Calories vs Cholesterol (mg) using gray levels for the clusters
plot(clust,v1v2=c(1,5),colclus=gray.colors(6))
## Scatter plot of Calories vs Cholesterol (mg)
## coloring in black objects with maximal membership degree lower than 0.5
plot(clust,v1v2=c(1,5),umin=0.5)
## Scatter plot of Calories vs Cholesterol (mg)
## coloring in black objects with maximal membership degree lower than 0.5
## and magnifying the points according to the maximal membership degree
plot(clust,v1v2=c(1,5),umin=0.5,ucex=TRUE)
## Scatter plot using the first two principal components and
## coloring in black objects with maximal membership degree lower than 0.3
plot(clust,v1v2=1:2,umin=0.3,pca=TRUE)

fclust documentation built on Nov. 16, 2022, 5:10 p.m.

Related to plot.fclust in fclust...