smaller set of just the most important features from herewe can run other unsupervised learning algorithms on this smaller set of features to find interesting patterns in the data (see the next section on clustering)orif we have labelswe can speed up the training cycle of supervised learning algorithms by feeding in this smaller matrix of features instead of using the original feature matrix clustering once we have reduced the set of original features to smallermore manageable setwe can find interesting patterns by grouping similar instances of data together this is known as clustering and can be accomplished with variety of unsupervised learning algorithms and be used for real-world applications such as market segmentation -means to cluster wellwe need to identify distinct groups such that the instances within group are similar to each other but different from instances in other groups one such algorithm is -means clustering with this algorithmwe specify the number of desired clusters kand the algorithm will assign each instance to exactly one of these clusters it optimizes the grouping by minimizing the within-cluster variation (also known as inertiasuch that the sum of the within-cluster variations across all clusters is as small as possible to speed up this clustering processk-means randomly assigns each observation to one of the clusters and then begins to reassign these observations to minimize the euclidean distance between each observation and its cluster' center pointor centroid as resultdifferent runs of -means--each with randomized start--will result in slightly different clustering assignments of the observations from these different runswe can choose the one that has the best separationdefined as the lowest total sum of within-cluster variations across all clusters hierarchical clustering an alternative clustering approach--one that does not require us to precommit to particular number of clusters--is known as hierarchical clustering one version of hierarchical clustering called agglomerative clustering uses tree-based clustering methodand builds what is called dendrogram dendrogram can be depicted graphically as an upside-down treewhere the leaves are at the bottom and the tree trunk is at the top there are faster variants of -means clustering such as mini-batch -meanswhich we cover later in the book unsupervised learning in the machine learning ecosystem