Distance measures how far apart two points are in a feature space. Nearby points are more alike in the features represented; farther-apart points are more dissimilar. For example, an apple at (5, 3) and an orange at (3, 4) can be compared using sweetness and size coordinates. In molecule screening, fingerprints represent molecules as points, and distance helps describe how different they are. section 2.5.1
Distance also helps select diverse samples for a dataset split:
- The Kennard–Stone algorithm calculates pairwise distances, starts with the two farthest-apart samples, then adds samples maximally distant from those already selected until the subset reaches its target size. section 6.2.2
- Distance calculations can be costly for many samples, and sparse, high-dimensional descriptor spaces pose separate statistical challenges. section 6.2.2
Figure 6.7 KSA ensures representative sampling from each cluster in this arbitrarily created data set, rather than sampling that is biased towards only one or two clusters.

Visualizes Kennard–Stone sampling across clusters in a toy dataset. section 6.2.2











