protac-bench / examples /example_submission.py
PROTAC-Bench's picture
Initial release for NeurIPS 2026 ED Track double-blind review
124eb57 verified
#!/usr/bin/env python3
"""Example: how to format predictions for PROTAC-Bench evaluation.
This script demonstrates the expected prediction format. Replace the
random predictions with your model's output.
Usage:
python examples/example_submission.py
python evaluation/evaluate.py --predictions example_predictions.csv --output my_results.json
"""
import json
from pathlib import Path
import numpy as np
import pandas as pd
DATA_DIR = Path(__file__).resolve().parent.parent / "data"
def main():
# Load dataset
df = pd.read_csv(DATA_DIR / "protac_bench.csv")
print(f"Dataset: {len(df)} entries")
# === Replace this with your model's predictions ===
np.random.seed(42)
predicted_probs = np.random.rand(len(df))
# ==================================================
# Format predictions: must have 'index' and 'predicted_probability' columns
submission = pd.DataFrame({
"index": range(len(df)),
"predicted_probability": predicted_probs,
})
out_path = Path(__file__).resolve().parent.parent / "example_predictions.csv"
submission.to_csv(out_path, index=False)
print(f"Saved {len(submission)} predictions to {out_path}")
print(f"\nTo evaluate, run:")
print(f" python evaluation/evaluate.py --predictions {out_path.name} --output results.json")
if __name__ == "__main__":
main()