2 – Hyperparameters

Hyperparameters determine the behavior of computation method. In this case, two hyperparameters are necessary:

  • The k number of clusters that will be computed. This number can and will be changed during the case study meetings to find out the best organization process, as explained in the next section. After a few runs, Pert intuitively set k to 6.
  • The f number of features that will be taken into account. In this case, there are two features: distance and location.

The program implements a k-means function as shown in the following code:

#II.Hyperparameters
# Features = 2
k = 6
kmeans = KMeans(n_clusters=k)

Note that the Features hyperparameter is commented. In this case, the number of features is implicit and determined by the format of the training dataset, which contains two columns.