  Selecting the appropriate number of clusters is a critical step in applying
clustering algorithms. To assist in this process, various cluster validity
indices (CVIs) have been developed. These indices are designed to identify the
optimal number of clusters within a dataset. However, users may not always seek
the absolute optimal number of clusters but rather a secondary option that
better aligns with their specific applications. This realization has led us to
introduce a Bayesian cluster validity index (BCVI), which builds upon existing
indices. The BCVI utilizes either Dirichlet or generalized Dirichlet priors,
resulting in the same posterior distribution. We evaluate our BCVI using the
Wiroonsri index for hard clustering and the Wiroonsri-Preedasawakul index for
soft clustering as underlying indices. We compare the performance of our
proposed BCVI with that of the original underlying indices and several other
existing CVIs, including Davies-Bouldin, Starczewski, Xie-Beni, and KWON2
indices. Our BCVI offers clear advantages in situations where user expertise is
valuable, allowing users to specify their desired range for the final number of
clusters. To illustrate this, we conduct experiments classified into three
different scenarios. Additionally, we showcase the practical applicability of
our approach through real-world datasets, such as MRI brain tumor images. These
tools will be published as a new R package 'BayesCVI'.
