Commit
ยท
a3fddce
1
Parent(s):
e059a0b
Added new interim scoring message, removed extra print
Browse files- .pre-commit-config.yaml +1 -1
- about.py +3 -3
- app.py +17 -5
- constants.py +4 -0
- submit.py +3 -1
.pre-commit-config.yaml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
exclude: '^.*\.(ipynb|json)$'
|
| 2 |
repos:
|
| 3 |
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 4 |
rev: v5.0.0
|
|
|
|
| 1 |
+
exclude: '^.*\.(ipynb|json|pdb)$'
|
| 2 |
repos:
|
| 3 |
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 4 |
rev: v5.0.0
|
about.py
CHANGED
|
@@ -16,7 +16,7 @@ WEBSITE_HEADER = f"""
|
|
| 16 |
You can **predict any or all of the 5 properties**, and you can filter the main leaderboard by property.
|
| 17 |
See more details in the "{ABOUT_TAB_NAME}" tab.
|
| 18 |
|
| 19 |
-
๐๏ธ There will be a test set scoring on **October 13th** (which will score all the latest test set submissions at that point).
|
| 20 |
Use this to refine your models before the final submission deadline on **1 November 2025**.
|
| 21 |
"""
|
| 22 |
|
|
@@ -42,7 +42,7 @@ Here we invite the community to submit and develop better predictors, which will
|
|
| 42 |
#### ๐ Prizes
|
| 43 |
|
| 44 |
For each of the 5 properties in the competition, there is a prize for the model with the highest performance for that property on the private test set.
|
| 45 |
-
There is also an 'open-source' prize for the best reproducible model: one that is trained on the GDPa1 dataset (reporting cross-validation results) and assessed on the private test set where authors provide all training code and data.
|
| 46 |
This will be judged by a panel (i.e. by default the model with the highest average Spearman correlation across all properties will be selected, but a really good model on just one property may be better for the community).
|
| 47 |
|
| 48 |
For each of these 6 prizes, participants have the choice between
|
|
@@ -192,7 +192,7 @@ You do **not** need to predict all 5 properties โ each property has its own le
|
|
| 192 |
- Include the `"hierarchical_cluster_IgG_isotype_stratified_fold"` column if submitting cross-validation predictions.
|
| 193 |
3. You can resubmit as often as you like; only your latest submission will count for both the leaderboard and final test set scoring.
|
| 194 |
|
| 195 |
-
The GDPa1 results should appear on the leaderboard within a minute, and can also be calculated manually using average Spearman rank correlation across the 5 folds.
|
| 196 |
|
| 197 |
## Cross-validation
|
| 198 |
|
|
|
|
| 16 |
You can **predict any or all of the 5 properties**, and you can filter the main leaderboard by property.
|
| 17 |
See more details in the "{ABOUT_TAB_NAME}" tab.
|
| 18 |
|
| 19 |
+
๐๏ธ There will be a test set scoring on **October 13th** (which will score all the latest test set submissions at that point).
|
| 20 |
Use this to refine your models before the final submission deadline on **1 November 2025**.
|
| 21 |
"""
|
| 22 |
|
|
|
|
| 42 |
#### ๐ Prizes
|
| 43 |
|
| 44 |
For each of the 5 properties in the competition, there is a prize for the model with the highest performance for that property on the private test set.
|
| 45 |
+
There is also an 'open-source' prize for the best reproducible model: one that is trained on the GDPa1 dataset (reporting cross-validation results) and assessed on the private test set where authors provide all training code and data.
|
| 46 |
This will be judged by a panel (i.e. by default the model with the highest average Spearman correlation across all properties will be selected, but a really good model on just one property may be better for the community).
|
| 47 |
|
| 48 |
For each of these 6 prizes, participants have the choice between
|
|
|
|
| 192 |
- Include the `"hierarchical_cluster_IgG_isotype_stratified_fold"` column if submitting cross-validation predictions.
|
| 193 |
3. You can resubmit as often as you like; only your latest submission will count for both the leaderboard and final test set scoring.
|
| 194 |
|
| 195 |
+
The GDPa1 results should appear on the leaderboard within a minute, and can also be calculated manually using average Spearman rank correlation across the 5 folds.
|
| 196 |
|
| 197 |
## Cross-validation
|
| 198 |
|
app.py
CHANGED
|
@@ -11,6 +11,7 @@ load_dotenv() # Load environment variables from .env file (before imports)
|
|
| 11 |
from about import ABOUT_INTRO, ABOUT_TEXT, FAQS, SUBMIT_INSTRUCTIONS, WEBSITE_HEADER
|
| 12 |
from constants import (
|
| 13 |
ASSAY_RENAME, # noqa: F401
|
|
|
|
| 14 |
SEQUENCES_FILE_DICT,
|
| 15 |
LEADERBOARD_DISPLAY_COLUMNS,
|
| 16 |
ABOUT_TAB_NAME,
|
|
@@ -38,8 +39,21 @@ def format_leaderboard_table(df_results: pd.DataFrame, assay: str | None = None)
|
|
| 38 |
# Note: We can also just say the following as a text box at the bottom of the leaderboard: "Note: Results for the Heldout Test Set are only evaluated at competition close"
|
| 39 |
# Convert spearman column to string to avoid dtype incompatibility when assigning text
|
| 40 |
df["spearman"] = df["spearman"].astype(str)
|
|
|
|
|
|
|
|
|
|
| 41 |
df.loc[
|
| 42 |
-
(df["dataset"] == "Heldout Test Set")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
] = "N/A, evaluated at competition close"
|
| 44 |
|
| 45 |
# Finally, rename columns for readability
|
|
@@ -64,6 +78,7 @@ def get_leaderboard_object(assay: str | None = None):
|
|
| 64 |
filter_columns=LEADERBOARD_COLUMNS_RENAME_LIST(filter_columns),
|
| 65 |
every=15,
|
| 66 |
render=True,
|
|
|
|
| 67 |
)
|
| 68 |
return lb
|
| 69 |
|
|
@@ -87,9 +102,7 @@ with gr.Blocks(theme=gr.themes.Default(text_size=sizes.text_lg)) as demo:
|
|
| 87 |
|
| 88 |
with gr.Row():
|
| 89 |
with gr.Column(scale=6): # bigger text area
|
| 90 |
-
gr.Markdown(
|
| 91 |
-
WEBSITE_HEADER
|
| 92 |
-
)
|
| 93 |
with gr.Column(scale=2): # smaller side column for logo
|
| 94 |
gr.Image(
|
| 95 |
value="./assets/competition_logo.jpg",
|
|
@@ -232,7 +245,6 @@ with gr.Blocks(theme=gr.themes.Default(text_size=sizes.text_lg)) as demo:
|
|
| 232 |
if isinstance(answer, list):
|
| 233 |
# Italicize each line
|
| 234 |
italicized_answer = " \n".join(f"*{item}*" for item in answer)
|
| 235 |
-
print(italicized_answer)
|
| 236 |
gr.Markdown(italicized_answer)
|
| 237 |
else:
|
| 238 |
gr.Markdown(f"*{answer}*") # Italics for answers
|
|
|
|
| 11 |
from about import ABOUT_INTRO, ABOUT_TEXT, FAQS, SUBMIT_INSTRUCTIONS, WEBSITE_HEADER
|
| 12 |
from constants import (
|
| 13 |
ASSAY_RENAME, # noqa: F401
|
| 14 |
+
FIRST_DEADLINE,
|
| 15 |
SEQUENCES_FILE_DICT,
|
| 16 |
LEADERBOARD_DISPLAY_COLUMNS,
|
| 17 |
ABOUT_TAB_NAME,
|
|
|
|
| 39 |
# Note: We can also just say the following as a text box at the bottom of the leaderboard: "Note: Results for the Heldout Test Set are only evaluated at competition close"
|
| 40 |
# Convert spearman column to string to avoid dtype incompatibility when assigning text
|
| 41 |
df["spearman"] = df["spearman"].astype(str)
|
| 42 |
+
# Cast submission_time to datetime
|
| 43 |
+
df["submission_time"] = pd.to_datetime(df["submission_time"], errors="coerce")
|
| 44 |
+
# Before the first deadline: Say we're busy evaluating
|
| 45 |
df.loc[
|
| 46 |
+
(df["dataset"] == "Heldout Test Set")
|
| 47 |
+
& (df["spearman"] == "nan")
|
| 48 |
+
& (df["submission_time"] <= FIRST_DEADLINE),
|
| 49 |
+
"spearman",
|
| 50 |
+
] = "Busy evaluating first deadline"
|
| 51 |
+
# After the first deadline: Evaluated at competition close
|
| 52 |
+
df.loc[
|
| 53 |
+
(df["dataset"] == "Heldout Test Set")
|
| 54 |
+
& (df["spearman"] == "nan")
|
| 55 |
+
& (df["submission_time"] > FIRST_DEADLINE),
|
| 56 |
+
"spearman",
|
| 57 |
] = "N/A, evaluated at competition close"
|
| 58 |
|
| 59 |
# Finally, rename columns for readability
|
|
|
|
| 78 |
filter_columns=LEADERBOARD_COLUMNS_RENAME_LIST(filter_columns),
|
| 79 |
every=15,
|
| 80 |
render=True,
|
| 81 |
+
height=500, # Set a fixed height to make it scrollable
|
| 82 |
)
|
| 83 |
return lb
|
| 84 |
|
|
|
|
| 102 |
|
| 103 |
with gr.Row():
|
| 104 |
with gr.Column(scale=6): # bigger text area
|
| 105 |
+
gr.Markdown(WEBSITE_HEADER)
|
|
|
|
|
|
|
| 106 |
with gr.Column(scale=2): # smaller side column for logo
|
| 107 |
gr.Image(
|
| 108 |
value="./assets/competition_logo.jpg",
|
|
|
|
| 245 |
if isinstance(answer, list):
|
| 246 |
# Italicize each line
|
| 247 |
italicized_answer = " \n".join(f"*{item}*" for item in answer)
|
|
|
|
| 248 |
gr.Markdown(italicized_answer)
|
| 249 |
else:
|
| 250 |
gr.Markdown(f"*{answer}*") # Italics for answers
|
constants.py
CHANGED
|
@@ -4,6 +4,7 @@ Constants for the Antibody Developability Benchmark
|
|
| 4 |
|
| 5 |
import os
|
| 6 |
from huggingface_hub import HfApi
|
|
|
|
| 7 |
|
| 8 |
ASSAY_LIST = ["AC-SINS_pH7.4", "PR_CHO", "HIC", "Tm2", "Titer"]
|
| 9 |
ASSAY_RENAME = {
|
|
@@ -99,3 +100,6 @@ BASELINE_USERNAMES = ["loodvanniekerkginkgo"]
|
|
| 99 |
|
| 100 |
def LEADERBOARD_COLUMNS_RENAME_LIST(columns: list[str]) -> list[str]:
|
| 101 |
return list(map(lambda x: LEADERBOARD_COLUMNS_RENAME.get(x, x), columns))
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
import os
|
| 6 |
from huggingface_hub import HfApi
|
| 7 |
+
import pandas as pd
|
| 8 |
|
| 9 |
ASSAY_LIST = ["AC-SINS_pH7.4", "PR_CHO", "HIC", "Tm2", "Titer"]
|
| 10 |
ASSAY_RENAME = {
|
|
|
|
| 100 |
|
| 101 |
def LEADERBOARD_COLUMNS_RENAME_LIST(columns: list[str]) -> list[str]:
|
| 102 |
return list(map(lambda x: LEADERBOARD_COLUMNS_RENAME.get(x, x), columns))
|
| 103 |
+
|
| 104 |
+
# First deadline: 2025-10-14 23:59:59 EST
|
| 105 |
+
FIRST_DEADLINE = pd.to_datetime("2025-10-14 23:59:59").tz_localize("US/Eastern")
|
submit.py
CHANGED
|
@@ -41,7 +41,9 @@ def upload_submission(
|
|
| 41 |
}
|
| 42 |
with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as tmp:
|
| 43 |
# json.dump(record, tmp, indent=2)
|
| 44 |
-
json.dump(
|
|
|
|
|
|
|
| 45 |
tmp.flush()
|
| 46 |
tmp_name = tmp.name
|
| 47 |
|
|
|
|
| 41 |
}
|
| 42 |
with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as tmp:
|
| 43 |
# json.dump(record, tmp, indent=2)
|
| 44 |
+
json.dump(
|
| 45 |
+
record, tmp
|
| 46 |
+
) # Note: No indent because indents and large text contents cause this error: https://github.com/huggingface/datasets/issues/3227
|
| 47 |
tmp.flush()
|
| 48 |
tmp_name = tmp.name
|
| 49 |
|