set.seed(1234)
nc <- NbClust(wine_scaled, min.nc=2, max.nc=15, method="kmeans")

## *** : The Hubert index is a graphical method of determining the number of clusters.
## In the plot of Hubert index, we seek a significant knee that corresponds to a
## significant increase of the value of the measure i.e the significant peak in Hubert
## index second differences plot.
##

## *** : The D index is a graphical method of determining the number of clusters.
## In the plot of D index, we seek a significant knee (the significant peak in Dindex
## second differences plot) that corresponds to a significant increase of the value of
## the measure.
##
## *******************************************************************
## * Among all indices:
## * 2 proposed 2 as the best number of clusters
## * 19 proposed 3 as the best number of clusters
## * 1 proposed 14 as the best number of clusters
## * 1 proposed 15 as the best number of clusters
##
## ***** Conclusion *****
##
## * According to the majority rule, the best number of clusters is 3
##
##
## *******************************************************************
Según la regla de la mayoría, el número óptimo es 3
set.seed(1234) sirve para que, cada vez que corras el código, el resultado sea el mismo (bloquea la aleatoriedad inicial
nc <- NbClust(wine_scaled, min.nc=2, max.nc=15, method=“kmeans”) prueba simultáneamente hasta 26 índices estadísticos diferentes para ver cuál es el mejor número de clústeres entre 2 y 15.