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
- Save as `top10_features_summary.csv` (60 rows: 2 models × 3 targets × 10 features).
10744
+
- **Rationale:** One consolidated, deployment-ready file; no plots or per-patient arrays; easy dashboard/reporting.
10745
+
7. **Interactive CLI: Single-Patient Inference**
10746
+
- Optional CLI interface post-batch inference.
10747
+
- Input patient ID → validate against `test_ids`.
10748
+
- Display that patient’s predictions for LightGBM (`lightgbm_preds`) and TCN (`prob_max`, `prob_median`, `y_pred_reg_raw`).
10749
+
- Loop until user exits.
10750
+
- **Rationale:** Optional, lightweight, reproducible CLI for quick inspection; uses precomputed outputs; supports deployment without extra artefacts.
10751
+
**Outputs**
10752
+
- **Batch Predictions**
10753
+
- `lightgbm_inference_outputs.csv` → classification probabilities (`max_risk`, `median_risk`) + regression (`pct_time_high`) for all test patients.
10754
+
- `tcn_inference_outputs.csv` → probabilities and regression outputs for TCN model.
10755
+
- **Interpretability**
10756
+
- `top10_features_summary.csv` → combined top-10 features per target from LightGBM (SHAP) and TCN (Gradient×Input Saliency).
10757
+
- **Interactive CLI**
10758
+
- Optional terminal output for single-patient predictions using the same preprocessed inputs.
10759
+
**Reasoning / Rationale**
10760
+
- **Reproducibility:** Batch inference ensures deterministic outputs and removes variation from looping or incremental processing.
10761
+
- **Unified pipeline:** Consolidates separate evaluation and interpretability scripts into a single workflow for both LightGBM and TCN.
10762
+
- **Interpretability tailored to model type:** LightGBM → SHAP; TCN → Gradient×Input Saliency. Only top-10 features retained to keep outputs lightweight, consistent with Phase 6 methodology.
10763
+
- **Binary targets omitted:** Inference does not compute metrics; outputs are generated from input features only, without label reconstruction or calibration.
10764
+
- **Regression clipping:** Ensures numeric predictions are valid (no negative percentages).
10765
+
- **Deployment-ready and dataset-agnostic:** Any dataset with the required feature columns / tensors can be passed directly into the script without outcome labels.
10766
+
- **Optional CLI:** Lightweight inspection of single-patient predictions without recomputation; aligns with batch outputs for consistency.
0 commit comments