STRPBM.IDX | R Documentation |
Computes the STR (A. Starczewski, 2017) and PBM (M. K. Pakhira et al., 2004) indexes for a result either kmeans or hierarchical clustering from user specified kmin
to kmax
.
STRPBM.IDX(x, kmax, kmin = 2, method = "kmeans", indexlist = "all", nstart = 100)
x |
a numeric data frame or matrix where each column is a variable to be used for cluster analysis and each row is a data point. |
kmax |
a maximum number of clusters to be considered. |
kmin |
a minimum number of clusters to be considered. The default is |
method |
a character string indicating which clustering method to be used ( |
indexlist |
a character string indicating which cluster validity indexes to be computed ( |
nstart |
a maximum number of initial random sets for kmeans for |
PBM index can be used with both crisp and fuzzy clustering algorithms.
The largest value of STR(k)
indicates a valid optimal partition.
The largest value of PBM(k)
indicates a valid optimal partition.
STR |
the STR index for |
PBM |
the PBM index for |
Nathakhun Wiroonsri and Onthada Preedasawakul
M. K. Pakhira, S. Bandyopadhyay and U. Maulik, "Validity index for crisp and fuzzy clusters," Pattern Recogn 37(3):487–501 (2004).
A. Starczewski, "A new validity index for crisp clusters," Pattern Anal Applic 20, 687–700 (2017).
Wvalid, FzzyCVIs, DI.IDX, R1_data
library(UniversalCVI)
# The data is from Wiroonsri (2024).
x = R1_data[,1:2]
# ---- Kmeans ----
# Compute all the indices by STRPBM.IDX
K.ALL = STRPBM.IDX(scale(x), kmax = 15, kmin = 2, method = "kmeans",
indexlist = "all", nstart = 100)
print(K.ALL)
# Compute STR index
K.STR = STRPBM.IDX(scale(x), kmax = 15, kmin = 2, method = "kmeans",
indexlist = "STR", nstart = 100)
print(K.STR)
# ---- Hierarchical ----
# Average linkage
# Compute all the indices by STRPBM.IDX
H.ALL = STRPBM.IDX(scale(x), kmax = 15, kmin = 2, method = "hclust_average",
indexlist = "all")
print(H.ALL)
# Compute STR index
H.STR = STRPBM.IDX(scale(x), kmax = 15, kmin = 2, method = "hclust_average",
indexlist = "STR")
print(H.STR)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.