r/learnmachinelearning • • 17h ago

Help Struggling to validate my Knowledge Graph dataset & negative sampling strategy for Drug–Food Interaction prediction

Hi everyone,

I'm working on a Drug–Food Interaction (DFI) prediction project using a Knowledge Graph + R-GCN with Cross-Attention. Since this is my first time working with graph-based link prediction (instead of standard tabular feature-label datasets), I'm still unsure whether my dataset setup and negative sampling strategy are methodologically sound.

My current setup:

Knowledge Graph: Built from DrugBank (drug entities and their biomedical relations) and FooDB (food entities and their constituent chemical compounds).

Ground Truth (Positive Labels): Known drug–food interaction pairs from DDID (positive-only pairs—there are no explicit "non-interacting" labels).

Model: R-GCN encoder on the KG + Cross-Attention between drug and food representations for binary link prediction.

What I'm unsure about:

  1. Dataset construction & leakage: Aside from ensuring no validation/test DDID pairs (or overlapping DrugBank food-interaction edges) leak into the KG before message passing, are there other subtle data leakage or entity-alignment pitfalls when mapping DDID onto a DrugBank + FooDB graph?
  2. Negative sampling under Open-World Assumption: Right now I'm considering 1:1 random negative sampling (type-constrained to drug–food pairs not in DDID). Since an unobserved pair doesn't necessarily mean "safe / no interaction," how risky is random negative sampling in practice for this kind of biomedical KG?
  3. Better alternatives: Would it make sense to compare random negative sampling against hard negative sampling, degree-based sampling, or Positive-Unlabeled (PU) learning? Or is 1:1 filtered random sampling already acceptable as a baseline if evaluated across multiple random seeds?
2 Upvotes

5 comments sorted by

4

u/PLBjt 17h ago

First thing I'd run is a degree-only baseline, score = deg(drug) * deg(food). If it gets close to your R-GCN, your negatives are too easy and the model is mostly learning "this drug interacts with a lot of stuff." Uniform random negatives inflate AUC for exactly that reason, so try degree-matched or type-constrained negatives, plus a cold-start split where test drugs never show up in training pairs. Also keep in mind some of your "negatives" are just unrecorded interactions since DDID is positive-only, so precision@k on held-out pairs tells you more than AUC alone.

2

u/Suspicious_Tax8577 14h ago

And one of the foods that will interact with a load of stuff is grapefruit.

I'll happily info dup how/why is OP is interested.

1

u/EffectiveAgitated137 11h ago

True, in DDID dataset, i see grapefruit actually dominates the dataset in food side. That's also part of what makes me nervous about the modeling side because super-hub foods like grapefruit have so many edges, I'm worried about degree bias (the R-GCN just predicting "interaction" whenever it sees grapefruit) and false negatives during random negative sampling.

1

u/Prince_Nshanty 7h ago

for the degree-matched negatives, do you usually bin the node degrees or just sample proportionally to degree?