The Molecular Screening Dilemma
In computational drug discovery, wet-lab biochemical assays are slow and expensive. Sirtuin 6 (SIRT6) is an NAD+-dependent deacylase enzyme tied to DNA repair, metabolic regulation, and cellular aging, making it an attractive therapeutic target for metabolic diseases and longevity research.
Finding small molecules that bind strongly to SIRT6 requires screening candidate compounds for Low Binding Free Energy (BFE): lower energy values represent stronger, more stable molecular complexes.
For an Introduction to Artificial Intelligence course project at Telkom University, I explored binary molecular classification. The catch: our dataset contained only 100 molecular compounds, each described by six computational chemistry descriptors.
100 Molecular Compounds (6 Chemical Descriptors)
│
▼
The Small-N Dilemma
(100 continuous float samples cause
Decision Trees to memorize training noise)
│
▼
IQR Outlier Detection
(Bridges skewed chemical index distributions)
│
▼
StandardScaler Normalization
(Prevents high-magnitude descriptors
from dominating Euclidean distance)
│
▼
5-Fold Stratified Cross-Validation
├── Unconstrained Tree: Train 100% / CV 73.0% (Overfitting)
└── Scaled KNN (k=5): Train 82% / CV 81.25% (Stable)
│
▼
Streamlit Molecular Screening Dashboard
The 100% Training Score Trap
With only 100 compounds, each described by six continuous descriptors (including topological indices like SC-6, weighted hydrogen bond acceptor counts maxwHBa, and hydrogen bond donor sums SHBd), no two molecules shared identical feature values.
When I trained an unconstrained DecisionTreeClassifier on the raw data, the console printed a perfect score:
Decision Tree Training Results:
Training Accuracy: 100.0%
5-Fold CV Score: 73.0%
Holdout Test Score: 80.0%
A 100% training score is almost never a victory in machine learning. It is usually a red flag for memorization.
Because the six floating-point chemical descriptors had unique values for every single molecule, the unconstrained decision tree created dozens of ultra-narrow threshold splits (SC-6 <= 0.412, maxwHBa <= 1.284). Each leaf isolated an individual molecule from the training set. The tree had not learned the biophysics of SIRT6 binding affinity; it had simply memorized the identity of our 80 training samples.
How do we predict binding affinity when our entire dataset has only 100 data points?
Feature Scaling and Robust IQR Outlier Filtering
To make predictions generalize, I changed two foundational steps:
First, I applied Interquartile Range (IQR) filtering to detect extreme measurement anomalies:
IQR = Q3 - Q1
Outlier bounds: [Q1 - 1.5 * IQR, Q3 + 1.5 * IQR]
Points lying beyond the upper or lower IQR thresholds were examined. For small datasets, IQR is more resilient than Z-score filtering because a single extreme molecular outlier will distort the sample mean and standard deviation.
Second, distance-based models require feature scaling. Without normalization, descriptor columns with ranges between 0 and 500 completely drown out topological indices that vary between 0.0 and 1.0. I used StandardScaler to center each chemical descriptor to zero mean and unit variance.
Comparing Tree Splitting with Scaled K-Nearest Neighbors
I trained a K-Nearest Neighbors classifier configured with k = 5 on the scaled descriptors.
KNN approaches the problem without constructing fragile split boundaries. Instead of memorizing rules, it computes Euclidean distances in scaled 6-dimensional space and lets the five nearest molecular neighbors vote on the binding class.
Decision Tree vs. Scaled KNN on 100 Samples:
Decision Tree:
[Train: 100.0%] ==================================================
[5-Fold CV: 73.0%] ===================================== (High Variance)
Scaled KNN (k=5):
[Train: 82.0%] =========================================
[5-Fold CV: 81.25%] ======================================== (Consistent)
The difference was clear across 5-fold cross-validation:
| Model Architecture | Preprocessing | Training Accuracy | 5-Fold CV Score | Test Accuracy |
|---|---|---|---|---|
| Decision Tree | Raw Unscaled | 100.0% | 73.00% | 80.00% |
| K-Nearest Neighbors | StandardScaler | 82.00% | 81.25% | 85.00% |
Scaled KNN achieved an 81.25% cross-validation score, closely tracking its 85.0% test accuracy. Averaging votes across five local neighbors prevented individual noisy compounds from hijacking the decision boundary.
Interactive Screening Interface in Streamlit
To allow researchers to test candidate molecules without writing Python code, I deployed the pipeline in a Streamlit web application:
Chemist Inputs 6 Molecular Descriptors
│
▼
Streamlit Form (SC-6, maxwHBa, SHBd...)
│
▼
StandardScaler Transform
│
▼
Tuned KNN (k=5) Inference
│
▼
Binding Probability & Inhibitor Tier (Low/High BFE)
A user enters six descriptor values from computational chemistry packages, and the app scales the vector, queries nearest training neighbors, and outputs whether the compound is a probable strong inhibitor candidate (Low BFE) or weak binder (High BFE).
What I Learned
Working with 100 molecular samples taught me that small datasets require far more engineering discipline than big data pipelines.
When data is scarce, complex algorithms with high capacity will easily memorize training noise. A 100% training score is a warning sign of structural overfitting.
Simple, non-parametric approaches like scaled K-Nearest Neighbors with cross-validated voting often outperform deep decision trees because their local neighborhood boundaries resist memorizing individual outliers.