Datasets:
File size: 1,370 Bytes
124eb57 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/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()
|