In cluster analysis,partitioning models and hierarchical models are two different approaches used to group data points based on their similarities.

Partitioning models divide a dataset into a predefined number of clusters, where each data point belongs to exactly one cluster.
These models aim to optimise a specific criterion, such as minimising the distance within clusters or maximizing the distance between them.
The result of these methods is a simple, flat structure where all data points are clearly assigned to one of the clusters.
In contrast, hierarchical models build a tree-like structure, called a dendrogram, which shows how data points can be grouped together at various levels.

These models don’t require the user to specify the number of clusters in advance. Instead, hierarchical clustering can work either from the bottom up (agglomerative), merging smaller clusters into larger ones, or from the top down (divisive), splitting large clusters into smaller ones.
Different linkage methods, such as single linkage (based on the nearest points) or complete linkage (based on the furthest points), determine how distances between clusters are calculated. The dendrogram provides a visual representation of the clusters, and the number of clusters can be decided later by cutting the tree at a particular level.
The key difference between these methods lies in their approach and outcomes.
Partitioning models are more straightforward, assigning each data point to a single cluster and often working well when the number of clusters is already known. However, they are limited in that they typically find spherical clusters and can be sensitive to the starting conditions and outliers in the data.
Hierarchical models, on the other hand, are more flexible, allowing for nested groupings and identifying clusters of varying shapes and sizes. They are particularly useful for exploratory analysis when the number of clusters isn’t clear, although they are more computationally demanding, especially with large datasets.