Random sampling selects items uniformly at random from an available pool. In molecular docking, it can initialize an active-learning loop before any labeled data exists. section 9.2.4
For an initial set of molecular candidates, random sampling:
- Provides a simple, low-overhead selection that reflects the starting library’s distribution. section 9.2.4
- Can reproduce library imbalances, overrepresenting some scaffolds or functional groups while leaving parts of chemical space unexplored. section 9.2.4
- Serves as a virtual-screening baseline: in a dataset with 10% actives, a random top 1% selection is expected to contain one active per ten compounds screened. section 8.1.3
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}")Compare the NumPy random-selection branch with an optional RDKit MaxMin diversity-selection branch. section 9.2.4






























