ci / api (push) Failing after 10s
ci / terraform (push) Failing after 11s
ci / web (push) Failing after 35s
ci / pipeline (push) Failing after 2m29s
ci / images (api) (push) Skipped
ci / images (ml) (push) Skipped
ci / images (pipeline) (push) Skipped
ci / images (web) (push) Skipped
End-to-end variant interpretation platform for rare genetic disease research: SvelteKit UI, FastAPI + PostgreSQL API, Nextflow/Ensembl VEP pipeline, LightGBM pathogenicity scoring with MLflow, K8s/ArgoCD/GCP infrastructure. Public test data only; no clinical claims.
17 lines
757 B
Python
17 lines
757 B
Python
"""Feature engineering shared by training and serving. Keep this identical to api/app/services/scoring.py."""
|
|
import pandas as pd
|
|
|
|
IMPACT_ORDER = {"MODIFIER": 0, "LOW": 1, "MODERATE": 2, "HIGH": 3}
|
|
CATEGORICAL = ["consequence"]
|
|
NUMERIC = ["impact_rank", "gnomad_af", "cadd_phred", "am_pathogenicity"]
|
|
|
|
|
|
def build(df: pd.DataFrame) -> pd.DataFrame:
|
|
out = pd.DataFrame()
|
|
out["impact_rank"] = df["impact"].map(IMPACT_ORDER).fillna(0)
|
|
out["gnomad_af"] = pd.to_numeric(df["gnomad_af"], errors="coerce").fillna(0.0)
|
|
out["cadd_phred"] = pd.to_numeric(df["cadd_phred"], errors="coerce")
|
|
out["am_pathogenicity"] = pd.to_numeric(df["am_pathogenicity"], errors="coerce")
|
|
out["consequence"] = df["consequence"].astype("category")
|
|
return out
|