A random split divides dataset examples into training and test subsets by random assignment. For the hERG blockers dataset, use the existing Set II column to identify these subsets while predicting whether compounds block the hERG channel. section 3.2.1
In the hERG screening workflow, the split supports these practices:
- Select the Random Split field rather than using pIC50 as a model feature, because pIC50 helped define the target class and requires experimental measurement. section 3.2.1
- Inspect the dataset before modeling, since curation and exploratory analysis help reveal missing values, inconsistent entries, and other data problems. section 3.2.1
Listing 3.1 Loading hERG Blockers Dataset
from pathlib import Path
import pandas as pd
import urllib.request
def load_herg_blockers_data():
herg_blockers_path = Path("data/ch03/hERG_blockers.xlsx")
return pd.read_excel(
herg_blockers_path,
usecols="A:F",
header=None,
skiprows=[0,1],
names=[
"SMILES", "Name", "pIC50",
"Class", "Scaffold Split", "Random Split"
],
).head(-68) #ALoad the hERG dataset with pandas and retain its Random Split column for defining the modeling subsets. section 3.2.1

