MaxMin is a diversity-selection technique that builds a compound subset by repeatedly choosing the molecule whose nearest already-selected molecule is as distant as possible. It helps explore chemical space instead of reproducing overrepresented scaffolds or functional groups. section 7.2.4 section 9.2.4
A typical MaxMin workflow is:
- Represent compounds with molecular fingerprints or descriptors. section 7.2.4
- Select one compound at random or choose one near the distribution center. section 9.2.4
- Iteratively select the compound that maximizes its minimum dissimilarity to the selected subset. section 7.2.4 section 9.2.4
Diverse docking initialization
For an imbalanced chemical library, MaxMin can initialize an active-learning pool before expensive molecular docking. By avoiding highly similar molecules, the initial surrogate model sees more molecular features and scaffolds, potentially increasing information gain and the chance of including rare active compounds. section 9.2.4
Listing 9.7 Initial Sampling – Random or Diverse
def initialize_samples(
X_pool, initialization: str, n_samples: int
) -> np.ndarray:
"""Initialize samples either randomly or using diversity picking."""
if initialization == 'random':
print("Selecting initial samples randomly...")
return np.random.choice(len(X_pool), size=n_samples, replace=False)
elif initialization == 'diverse':
print("Selecting initial samples following MaxMin diversity...")
picker = rdSimDivPickers.MaxMinPicker() #A
fps_for_diversity = [
list(fp) for fp in X_pool
] #B
picked = list(picker.LazyBitVectorPick( #C
fps_for_diversity,
len(fps_for_diversity),
n_samples
))
return np.array(picked)
else:
raise ValueError(f"Unknown initialization method: {initialization}")Use RDKit’s MaxMinPicker to select diverse compounds from fingerprint vectors without implementing the picker from scratch. section 9.2.4
