Supervised Pathway Projection + Symbolic Regression for Interpretable Drug Response Prediction
Project description
pathlaw
Supervised Pathway Projection + Symbolic Regression for Interpretable Drug Response Prediction
pathlaw compresses a deep drug response model's latent representation into biologically named pathway scores, then fits a symbolic regression head — producing a single, globally readable formula:
lnIC50 ≈ 2.51 × EML(x, y) − 2.09
x (resistance) = +1.56·KRAS +1.12·DNA_REPAIR +1.04·G2M + ···
y (sensitivity) = +0.87·APOPTOSIS +0.70·PI3K_AKT + ···
No post-hoc aggregation. No direction analysis. No manual interpretation.
The formula is the explanation.
Install
pip install pathlaw
Quick start
from pathlaw import PathLaw
# X: intermediate representations from your model (N, n_input)
# y: target values, e.g. lnIC50 (N,)
model = PathLaw(n_input=1536, n_pathways=8, depth=3)
model.fit(X, y, epochs=300)
print(model.formula()) # human-readable formula
print(model.explain()) # clinical sentences from coefficients
How it works
Your model's latent (1536-dim)
↓
Pathway Projection Linear(1536 → 8) ← trainable, named after Hallmark gene sets
↓
EML Symbolic Head depth-3 tree ← learns lnIC50 ≈ EML(x, y)
↓
Formula + clinical sentences ← 0 analyst steps
The 8 default pathways (HALLMARK_PATHWAYS):
APOPTOSIS, G2M_CHECKPOINT, DNA_REPAIR, PI3K_AKT_MTOR,
KRAS_SIGNALING, ESTROGEN_RESPONSE, HYPOXIA, E2F_TARGETS
You can supply any pathway names matching your domain.
API
| Method | Description |
|---|---|
PathLaw(n_input, n_pathways, depth, pathway_names) |
Create model |
model.fit(X, y, epochs, ...) |
Train on intermediate reps + targets |
model.predict(X) |
Predict lnIC50 |
model.pathway_scores(X) |
Get named pathway activations |
model.formula() |
Human-readable formula string |
model.explain(threshold) |
Clinical sentences from coefficients |
model.formula_dict() |
Full formula as dict (includes LaTeX) |
model.evaluate(X, y) |
Pearson r, Spearman ρ, RMSE |
model.save(path) / PathLaw.load(path) |
Persistence |
Citation
If you use pathlaw in your research, please cite:
@article{hong2026pathlaw,
author = {Hong, Seokchol},
title = {Supervised Pathway Projection with Symbolic Regression
Enables Interpretable Drug Response Prediction},
year = {2026},
url = {https://github.com/seokcholhong/pathlaw}
}
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathlaw-0.1.0.tar.gz.
File metadata
- Download URL: pathlaw-0.1.0.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc76a7077247624ec2234911d866961c89db7f6be776916ed78c421bcbe7c7b7
|
|
| MD5 |
76708fb81045ae251779b0f48125ad99
|
|
| BLAKE2b-256 |
0bcc090e113fc10a512459b7a38eaa1c27c8d9001e831b5987eac644468aefa1
|
File details
Details for the file pathlaw-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pathlaw-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec5eb51cfe6ae409e250d4caf0db5e5f7719e4d3ecbae05fa7ba81f1b32df7ef
|
|
| MD5 |
5919dd83633e6c5a4306a6008dca95be
|
|
| BLAKE2b-256 |
b98a7b019e228a914c4053645b41ae0e4e7d5c362ad0836bcda41d89cfdb66c0
|