You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
# [BUG/ML-OPS] Fix Data Poisoning in XGBoost Inference Matrix (Pandas NaN Handling) #98
In security_auditor.py, the Pandas DataFrame construction for the XGBoost malware model currently utilizes .fillna(0) and fill_value=0. When the orchestrator degrades into Zero-Dependency Mode, advanced features (like Betweenness Centrality or Token Mass) are intentionally bypassed.
By hard-forcing these missing values to 0, the pipeline mathematically poisons the ML inference matrix. It explicitly instructs the model that a feature was measured as exactly zero, rather than treating it as missing data. XGBoost natively supports NaN and routes missing values accurately through its decision trees. Forcing a 0 skews threat detection weights and introduces artificial data drift.
🎯 Objective
Restore native missing-data handling (NaN) within the ML-Ops pipeline to guarantee accurate SAST (Static Application Security Testing) threat inference, especially when operating in air-gapped or dependency-restricted DevSecOps environments.
🛠️ Proposed Implementation
Update the construct_feature_matrix() logic in security_auditor.py:
Change fill_value=0 to fill_value=np.nan during Pandas DataFrame reindexing.
Remove the .fillna(0) call entirely to allow XGBoost to process the sparse matrix and true null values gracefully.
✅ Acceptance Criteria
construct_feature_matrix() applies np.nan for omitted structural columns.
XGBoost ingests the NaN sparse matrix without throwing tensor or type errors.
Zero-Dependency Mode no longer artificially skews malware classification outcomes.
Activity
fix(ml-ops): preserve native NaN sparsity in XGBoost inference matrix (…
Merge pull request squid-protocol#127 from squid-protocol/feature/98-…