S3-Prompt / BBBP /preprocess.log
Syzseisus's picture
Initial release
fc0d038 verified
Raw History Blame Contribute Delete
11.5 kB
=== [BBBP] Data generation started at 2026-01-06 12:40:31 ===
========================= Preprocessing BBBP =========================
1. Download dataset from DeepChem
2. Trim columns - keep only SMILES, label, and raw_ID
3. Add embedding - ECFP or MolT5-{small, base, large}
4. Split dataset - stratified for classification, random for regression
======================================================================
==================== Morgan Fingerprint Embedding ====================
Load `df_raw` from url
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2050 entries, 0 to 2049
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 num 2050 non-null int64
1 name 2050 non-null object
2 p_np 2050 non-null int64
3 smiles 2050 non-null object
dtypes: int64(2), object(2)
memory usage: 64.2+ KB
======================================================================
Keep only `smiles`, `label`, and `raw_ID` columns
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2050 entries, 0 to 2049
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2050 non-null int64
1 smiles 2050 non-null object
2 label 2050 non-null int64
dtypes: int64(2), object(1)
memory usage: 48.2+ KB
======================================================================
[INFO] Corrected invalid SMILES for BBBP raw_ID=651
Remove NaNs
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2050 entries, 0 to 2049
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2050 non-null int64
1 smiles 2050 non-null object
2 label 2050 non-null int64
dtypes: int64(2), object(1)
memory usage: 48.2+ KB
======================================================================
smiles:O=N([O-])C1=C(CN=C1NCCSCc2ncccc2)Cc3ccccc3
smiles:c1(nc(NC(N)=[NH2])sc1)CSCCNC(=[NH]C#N)NC
smiles:Cc1nc(sc1)\[NH]=C(\N)N
smiles:s1cc(CSCCN\C(NC)=[NH]\C#N)nc1\[NH]=C(\N)N
smiles:c1c(c(ncc1)CSCCN\C(=[NH]\C#N)NCC)Br
smiles:n1c(csc1\[NH]=C(\N)N)c1ccccc1
smiles:n1c(csc1\[NH]=C(\N)N)c1cccc(c1)N
smiles:n1c(csc1\[NH]=C(\N)N)c1cccc(c1)NC(C)=O
smiles:n1c(csc1\[NH]=C(\N)N)c1cccc(c1)N\C(NC)=[NH]\C#N
smiles:c1(cc(N\C(=[NH]\c2cccc(c2)CC)C)ccc1)CC
Remove NaNs
<class 'pandas.core.frame.DataFrame'>
Index: 2040 entries, 0 to 2049
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 2040 non-null object
dtypes: int64(2), object(2)
memory usage: 79.7+ KB
======================================================================
Re-type `label` columns
<class 'pandas.core.frame.DataFrame'>
Index: 2040 entries, 0 to 2049
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 2040 non-null object
dtypes: int64(2), object(2)
memory usage: 79.7+ KB
======================================================================
Save `df_raw` as `raw_path`: ../MoleculeNetICL_SD-SPL/BBBP/raw.csv
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2050 entries, 0 to 2049
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 num 2050 non-null int64
1 name 2050 non-null object
2 p_np 2050 non-null int64
3 smiles 2050 non-null object
dtypes: int64(2), object(2)
memory usage: 64.2+ KB
======================================================================
Save `df` as `trimmed_path`: ../MoleculeNetICL_SD-SPL/BBBP/trimmed.csv
<class 'pandas.core.frame.DataFrame'>
Index: 2040 entries, 0 to 2049
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 2040 non-null object
dtypes: int64(2), object(2)
memory usage: 79.7+ KB
======================================================================
Remove 10 rows due to empty SMILES, label or Scaffold SMILES
>> 2040/2050 rows remaining after trimming
======================================================================
Init Morgan Fingerprint Embedding ...
Get embedding with FP
<class 'pandas.core.frame.DataFrame'>
Index: 2040 entries, 0 to 2049
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 2040 non-null object
4 embed 2040 non-null object
dtypes: int64(2), object(3)
memory usage: 95.6+ KB
======================================================================
Save `embed_col` as `embed_path`: ../MoleculeNetICL_SD-SPL/BBBP/embed_fp_r=2_b=1024.pk
<class 'pandas.core.frame.DataFrame'>
Index: 2040 entries, 0 to 2049
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 2040 non-null object
4 embed 2040 non-null object
dtypes: int64(2), object(3)
memory usage: 95.6+ KB
======================================================================
Remove 0 rows due to empty embedding
2040/2040 rows remaining after trimming
======================================================================
Saved Train/Valid/Test (8:1:1) splits
======================================================================
# train = 1632
sample: {
raw_ID: 1392
smiles: C3=C(C2(C(N(CN1CCOCC1)C(C2)=O)=O)C)C=CC=C3
label: 1
fp <class 'numpy.ndarray'>
embed: (1024,)
}
# valid = 204
sample: {
raw_ID: 1979
smiles: C1=CC=CC2=C1N(C3=C(S2)C=CC=C3)CC(C)N(C)C
label: 1
embed: (1024,)
}
# test = 204
sample: {
raw_ID: 1450
smiles: CC1OC(C)OC(O1)C
label: 1
embed: (1024,)
}
======================================================================
======================= MolT5-small Embedding ========================
Load `df_raw` from `raw_path`: ../MoleculeNetICL_SD-SPL/BBBP/raw.csv
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2050 entries, 0 to 2049
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 num 2050 non-null int64
1 name 2050 non-null object
2 p_np 2050 non-null int64
3 smiles 2050 non-null object
dtypes: int64(2), object(2)
memory usage: 64.2+ KB
======================================================================
Load `df` from `trimmed_path`: ../MoleculeNetICL_SD-SPL/BBBP/trimmed.csv
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2040 entries, 0 to 2039
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 1941 non-null object
dtypes: int64(2), object(2)
memory usage: 63.9+ KB
======================================================================
Remove 10 rows due to empty SMILES, label or Scaffold SMILES
>> 2040/2050 rows remaining after trimming
======================================================================
Init MolT5-small Embedding ...
Use cuda
0%| | 0/2 [00:00<?, ?it/s] 50%|███████████████████████████████████████████████████████████████████████████████▌ | 1/2 [00:01<00:01, 1.74s/it] 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:02<00:00, 1.16s/it] Get embedding with MolT5
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2040 entries, 0 to 2039
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 1941 non-null object
4 embed 2040 non-null object
dtypes: int64(2), object(3)
memory usage: 79.8+ KB
======================================================================
Save `embed_col` as `embed_path`: ../MoleculeNetICL_SD-SPL/BBBP/embed_molt5_small_d512.pt
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2040 entries, 0 to 2039
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 2040 non-null int64
1 smiles 2040 non-null object
2 label 2040 non-null int64
3 scaffold_smiles 1941 non-null object
4 embed 2040 non-null object
dtypes: int64(2), object(3)
memory usage: 79.8+ KB
======================================================================
Remove 0 rows due to empty embedding
2040/2040 rows remaining after trimming
======================================================================
Load split dfs from ../MoleculeNetICL_SD-SPL/BBBP
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1632 entries, 0 to 1631
Data columns (total 3 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 raw_ID 1632 non-null int64
1 smiles 1632 non-null object
2 label 1632 non-null int64
dtypes: int64(2), object(1)
memory usage: 38.4+ KB
======================================================================
# train = 1632
sample: {
raw_ID: 1392
smiles: C3=C(C2(C(N(CN1CCOCC1)C(C2)=O)=O)C)C=CC=C3
label: 1
small <class 'torch.Tensor'>
embed: torch.Size([512])
}
# valid = 204
sample: {
raw_ID: 1979
smiles: C1=CC=CC2=C1N(C3=C(S2)C=CC=C3)CC(C)N(C)C
label: 1
embed: torch.Size([512])
}
# test = 204
sample: {
raw_ID: 1450
smiles: CC1OC(C)OC(O1)C
label: 1
embed: torch.Size([512])
}
======================================================================
=== Completed successfully at 2026-01-06 12:41:09 (Duration: 38s) ===