{
  "id": 704124,
  "title": "WiDS Global Datathon 2026: 5th Place Solution ( Bob the Builder(s))",
  "content": "<h2>Team &amp; Competition Overview</h2>\n<table>\n <tbody><tr>\n   <th>Attribute</th>\n   <th>Details</th>\n </tr>\n <tr>\n   <td><b>Competition</b></td>\n   <td>WiDS Global Datathon 2026</td>\n </tr>\n <tr>\n   <td><b>Team Name</b></td>\n   <td>Bob the Builder(s)</td>\n </tr>\n <tr>\n   <td><b>Public Score</b></td>\n   <td>0.97707</td>\n </tr>\n <tr>\n   <td><b>Private Score</b></td>\n   <td>0.96681</td>\n </tr>\n <tr>\n   <td><b>Private Rank</b></td>\n   <td>19</td>\n </tr>\n\n <tr>\n   <td><b>Location</b></td>\n   <td>Dhaka</td>\n </tr>\n\n</tbody></table>\n<hr>\n<h2>About the Team</h2>\n<p>I'm the sole member of team Bob the Builder(s). I'm a Sophomore at Bangladesh University of Engineering and Technology majoring in Computer Science and Engineering. And I like playing League of Legends : D !\nThis is my first Machine Learning competition and before this, I had no idea about Machine Learning or Deep Learning. I had to grind hard throughout the competition. My main aim was to use this as a stepping stone into the realm of ML and DL. I spent about a month or so on this competition. </p>\n<hr>\n<h2>Solution Summary</h2>\n<p>We built a <strong>zone-aware survival ensemble</strong> that predicts cumulative wildfire hit probabilities across 12, 24, 48, and 72-hour horizons. The core idea is a <strong>Zone-Based Routing System</strong> — fires are routed into Near (&lt; 5 km) and Far (≥ 5 km) zones, with independent model weight arrays optimized per zone via an exhaustive OOF grid search.\nThe Level-0 ensemble combines six model families — Gradient Boosting Survival Analysis (GBSA), XGBoost AFT, Cox Proportional Hazards, Random Survival Forests, a LightGBM Timing model, and a Two-Stage Calibrator — all trained inside a 7-fold Stratified K-Fold CV loop with IPCW-weighted targets. A pre-blending step merges AFT into GBSA (82/18 split) before zone-based weight optimization. The entire pipeline (training + inference) runs in approximately <strong>18 minutes</strong> on Kaggle's CPU kernel using Python with scikit-survival, XGBoost, LightGBM, and scikit-learn.</p>\n<hr>\n<h2>Feature Engineering</h2>\n<p>The raw dataset contains 35 columns. Through engineering we expanded this to ~90+ features organized into several families:</p>\n<h3>Spatial Zones &amp; Distance Percentiles</h3>\n<p>Fires behave fundamentally differently when they are at the doorstep versus miles away. We hard-coded structural zone boundaries — <strong>Near</strong> (&lt; 5 km), <strong>Warning</strong> (5–10 km), <strong>Far</strong> (≥ 10 km), and <strong>Very Far</strong> (≥ 15 km) — and computed <strong>Relative Percentile Ranks</strong> within each zone. For example, <code>near_speed_rank</code> evaluates a fire's effective closing speed strictly against the historical distribution of other near-zone fires.</p>\n<h3>ETA, Velocity &amp; Boundary Margins</h3>\n<ul>\n<li><strong>Effective Closing Speed:</strong> Combines absolute closing speed, radial growth rate, and an alignment penalty into a single physical proxy.</li>\n<li><strong>Time-to-Arrival (ETA):</strong> Distance divided by effective closing speed.</li>\n<li><strong>Wavefront ETA:</strong> Subtracts the radial growth from the distance before computing ETA, tracking the leading edge of the fire.</li>\n<li><strong>Margin &amp; Gate Proximity:</strong> The literal margin of error (distance − fire radius − projected advance) and proximity to a critical 5 km \"gate.\"</li>\n</ul>\n<h3>Composite Threat &amp; Environmental Indices</h3>\n<ul>\n<li><strong>Fire Power:</strong> <code>log(1 + area_km²) × effective_closing / (dist_km + 0.1)</code>.</li>\n<li><strong>Threat Score:</strong> Combines alignment, effective closing speed, and log-area, inversely penalized by distance.</li>\n<li><strong>Environmental Threat:</strong> Fuses wind speed, inverse humidity, and canopy cover percentage.</li>\n<li><strong>Cyclic Temporal Features:</strong> Sine/cosine transforms of month, hour, and day-of-week, plus a binary fire season flag (months 6–10).</li>\n</ul>\n<h3>Feature Selection Strategy</h3>\n<p>Different model families used curated feature subsets rather than a single universal set:</p>\n<ul>\n<li><strong>GBSA / RSF / XGB-AFT</strong> received all 35 raw numeric columns, letting the tree-based learners handle selection internally.</li>\n<li><strong>CoxPH</strong> used a hand-picked set of 27 features emphasizing distance transforms, ETA variants, zone flags, and threat composites — chosen to avoid multicollinearity in the linear model. Features were pushed through a QuantileTransformer → StandardScaler pipeline.</li>\n<li><strong>Timing Model &amp; Calibrators</strong> operated on specialized ~18-feature subsets tailored to the Near-zone and Far-zone tasks respectively.</li>\n</ul>\n<h3>Notable Interactions</h3>\n<p>The interaction between <strong>distance zone</strong> and <strong>effective closing speed</strong> was critical. A fast-closing fire in the near zone is an immediate threat; the same speed in the far zone is far less concerning. This motivated the zone-based weighting system rather than a single global model. \nNo external data was used.</p>\n<h2>Training Methods &amp; Ensemble Architecture</h2>\n<h3>Level-0: Six Base Model Families</h3>\n<p>All models were trained inside a <strong>7-fold Stratified K-Fold</strong> CV loop. Stratification used a composite label (event × 2 + near_zone_flag) to ensure balanced representation of close-proximity threats. Targets were IPCW-weighted binary labels via Kaplan-Meier censoring adjustment (weights clipped at 30.0).</p>\n<ol>\n<li><strong>Gradient Boosting Survival Analysis (GBSA):</strong> Five hyperparameter configurations × 8 random seeds = 40 models per fold, using Cox Partial Hazard loss. Parameters ranged from slow/deep (n_estimators=3000, lr=0.005) to fast/shallow (n_estimators=900, lr=0.020).</li>\n<li><strong>XGBoost Accelerated Failure Time (AFT):</strong> Trained on <code>survival:aft</code> with sigma tuned across [1.0, 1.3, 1.6]. Predictions are <strong>pre-blended</strong> into GBSA (82% GBSA + 18% AFT) before any downstream ensembling.</li>\n<li><strong>Cox Proportional Hazards (CoxPH):</strong> A linear survival model averaged across 9 L2 penalty alphas [0.0005 to 3.0], with QuantileTransformer + StandardScaler preprocessing.</li>\n<li><strong>Random Survival Forests (RSF):</strong> Four configurations × 6 seeds = 24 models per fold with heavy bootstrapping.</li>\n<li><strong>LightGBM Timing Model (Near Zone Only):</strong> A regressor predicting log-time-to-arrival on uncensored near-zone data, mapped to probabilities via normal CDF.</li>\n<li><strong>Two-Stage Calibrator:</strong> L2-Logistic Regression → Isotonic Regression pipeline, trained separately for Near and Far subsets across horizons 12, 24, and 48.</li>\n</ol>\n<h3>Zone-Based Blending</h3>\n<p>Rather than averaging predictions globally, independent 5-weight arrays for Near and Far zones were found via <strong>exhaustive combinatorial OOF grid search</strong> (values [0.0, 0.1, …, 0.6] per model slot) optimizing the Hybrid metric.\n<strong>Final optimized weights:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Model Slot</th>\n<th>Near Zone</th>\n<th>Far Zone</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GBSA+AFT</td>\n<td>0.5</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>CoxPH</td>\n<td>0.5</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>RSF</td>\n<td>0.1</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>Calibrator</td>\n<td>0.6</td>\n<td>0.1</td>\n</tr>\n<tr>\n<td>Timing</td>\n<td>0.15</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>Near zones leaned on GBSA, Cox, and Calibrator diversity; the far zone was almost entirely Calibrator-driven.</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h3>Level-1 Meta-Stacker</h3>\n<p>A per-horizon LightGBM Classifier was trained on OOF base predictions alongside non-linear distance transforms. However, OOF tuning found the optimal meta weight to be <strong>0.0</strong> — the zone-based blend alone proved optimal and the meta-stacker did not contribute to the final predictions.</p>\n<hr>\n<h2>Post-Processing Pipeline</h2>\n<p>Raw predictions were subjected to a 7-step post-processing sequence:</p>\n<ol>\n<li><strong>Test-Time Augmentation (TTA):</strong> The test distance array was jittered by −2%, 0%, and +2%. The entire inference pipeline ran 3 times and averaged.</li>\n<li><strong>Horizon Smoothing:</strong> Adjacent horizons were blended to eliminate sharp jumps: <code>prob_24h = 0.90 × prob_24h + 0.10 × prob_12h</code> and <code>prob_48h = 0.85 × prob_48h + 0.15 × prob_24h</code>. The 72h horizon was not smoothed.</li>\n<li><strong>Strict Monotonicity Enforcement:</strong> Cumulative maximums (<code>np.maximum.accumulate</code>) across the horizon axis ensured probabilities never decrease over time.</li>\n<li><strong>Gaussian Jitter Injection:</strong> Small random Gaussian noise (mean=0, std=0.002) was added to break ties and smooth artifacts.</li>\n<li><strong>Horizon Temperature Scaling:</strong> Logit manipulation per-horizon — 24h sharpened (T=0.95), 48h neutral (T=1.00), 72h softened (T=1.05). The 12h horizon was left unscaled.</li>\n<li><strong>Very Far p12 Override:</strong> If distance ≥ 15 km, the 12-hour probability was hard-set to 0.0 — fires physically cannot travel that far in 12 hours.</li>\n<li><strong>Universal p72 Override:</strong> All 72-hour probabilities forced to 1.0, reflecting that over 72 hours every observed wildfire effectively reaches the target.</li>\n</ol>\n<hr>\n<h2>Key Insights &amp; What Set Us Apart</h2>\n<p>The <strong>most important trick</strong> was the Zone-Based Routing System — splitting predictions into Near and Far zones with independently optimized weights. This avoided the compromise of a one-size-fits-all global blend and let specialized models dominate in their strongest regimes.\nThree things we believe set us apart:</p>\n<ol>\n<li><strong>Physically motivated features</strong> — ETA, wavefront tracking, and margin calculations grounded in fire behavior rather than generic statistical transforms.</li>\n<li><strong>Pre-blending AFT into GBSA</strong> before ensemble construction — this stabilized gradient-boosted predictions and improved OOF scores.</li>\n<li><strong>Aggressive post-processing</strong> — the 7-step pipeline enforcing physical realism (monotonicity, zone-specific deterministic rules, temperature scaling) squeezed additional score improvements without overfitting.\nWe also discovered that fires at distance ≥ 15 km effectively never hit within 12 hours, and that the 72h survival probability was essentially 1.0 for all observations — both motivating deterministic overrides that improved the Brier score component.</li>\n</ol>\n<hr>\n<h2>Simplified Model</h2>\n<p>For a simpler alternative, the most important model is <strong>GBSA with Cox Partial Hazard loss</strong>. A single GBSA model trained on just ~8 key raw features could achieve roughly 99% of the full pipeline's performance:</p>\n<ol>\n<li><code>dist_min_ci_0_5h</code> (distance to target)</li>\n<li><code>closing_speed_abs_m_per_h</code></li>\n<li><code>radial_growth_rate_m_per_h</code></li>\n<li><code>alignment_abs</code></li>\n<li><code>area_first_ha</code></li>\n<li><code>area_growth_rate_ha_per_h</code></li>\n<li><code>projected_advance_m</code></li>\n<li><code>centroid_speed_m_per_h</code></li>\n</ol>\n<hr>\n<h2>Execution Time</h2>\n<p>All times measured on <strong>Kaggle CPU kernel</strong> (no GPU).</p>\n<table>\n<thead>\n<tr>\n<th>Stage</th>\n<th>Time</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Full pipeline (training + inference)</td>\n<td>~18 minutes</td>\n</tr>\n</tbody>\n</table>",
  "comments": [],
  "comment_count": 0,
  "messages": [
    {
      "id": 3466093,
      "postDate": "2026-06-03T14:12:31.740Z",
      "content": "<h2>Team &amp; Competition Overview</h2>\n<table>\n <tbody><tr>\n   <th>Attribute</th>\n   <th>Details</th>\n </tr>\n <tr>\n   <td><b>Competition</b></td>\n   <td>WiDS Global Datathon 2026</td>\n </tr>\n <tr>\n   <td><b>Team Name</b></td>\n   <td>Bob the Builder(s)</td>\n </tr>\n <tr>\n   <td><b>Public Score</b></td>\n   <td>0.97707</td>\n </tr>\n <tr>\n   <td><b>Private Score</b></td>\n   <td>0.96681</td>\n </tr>\n <tr>\n   <td><b>Private Rank</b></td>\n   <td>19</td>\n </tr>\n\n <tr>\n   <td><b>Location</b></td>\n   <td>Dhaka</td>\n </tr>\n\n</tbody></table>\n<hr>\n<h2>About the Team</h2>\n<p>I'm the sole member of team Bob the Builder(s). I'm a Sophomore at Bangladesh University of Engineering and Technology majoring in Computer Science and Engineering. And I like playing League of Legends : D !\nThis is my first Machine Learning competition and before this, I had no idea about Machine Learning or Deep Learning. I had to grind hard throughout the competition. My main aim was to use this as a stepping stone into the realm of ML and DL. I spent about a month or so on this competition. </p>\n<hr>\n<h2>Solution Summary</h2>\n<p>We built a <strong>zone-aware survival ensemble</strong> that predicts cumulative wildfire hit probabilities across 12, 24, 48, and 72-hour horizons. The core idea is a <strong>Zone-Based Routing System</strong> — fires are routed into Near (&lt; 5 km) and Far (≥ 5 km) zones, with independent model weight arrays optimized per zone via an exhaustive OOF grid search.\nThe Level-0 ensemble combines six model families — Gradient Boosting Survival Analysis (GBSA), XGBoost AFT, Cox Proportional Hazards, Random Survival Forests, a LightGBM Timing model, and a Two-Stage Calibrator — all trained inside a 7-fold Stratified K-Fold CV loop with IPCW-weighted targets. A pre-blending step merges AFT into GBSA (82/18 split) before zone-based weight optimization. The entire pipeline (training + inference) runs in approximately <strong>18 minutes</strong> on Kaggle's CPU kernel using Python with scikit-survival, XGBoost, LightGBM, and scikit-learn.</p>\n<hr>\n<h2>Feature Engineering</h2>\n<p>The raw dataset contains 35 columns. Through engineering we expanded this to ~90+ features organized into several families:</p>\n<h3>Spatial Zones &amp; Distance Percentiles</h3>\n<p>Fires behave fundamentally differently when they are at the doorstep versus miles away. We hard-coded structural zone boundaries — <strong>Near</strong> (&lt; 5 km), <strong>Warning</strong> (5–10 km), <strong>Far</strong> (≥ 10 km), and <strong>Very Far</strong> (≥ 15 km) — and computed <strong>Relative Percentile Ranks</strong> within each zone. For example, <code>near_speed_rank</code> evaluates a fire's effective closing speed strictly against the historical distribution of other near-zone fires.</p>\n<h3>ETA, Velocity &amp; Boundary Margins</h3>\n<ul>\n<li><strong>Effective Closing Speed:</strong> Combines absolute closing speed, radial growth rate, and an alignment penalty into a single physical proxy.</li>\n<li><strong>Time-to-Arrival (ETA):</strong> Distance divided by effective closing speed.</li>\n<li><strong>Wavefront ETA:</strong> Subtracts the radial growth from the distance before computing ETA, tracking the leading edge of the fire.</li>\n<li><strong>Margin &amp; Gate Proximity:</strong> The literal margin of error (distance − fire radius − projected advance) and proximity to a critical 5 km \"gate.\"</li>\n</ul>\n<h3>Composite Threat &amp; Environmental Indices</h3>\n<ul>\n<li><strong>Fire Power:</strong> <code>log(1 + area_km²) × effective_closing / (dist_km + 0.1)</code>.</li>\n<li><strong>Threat Score:</strong> Combines alignment, effective closing speed, and log-area, inversely penalized by distance.</li>\n<li><strong>Environmental Threat:</strong> Fuses wind speed, inverse humidity, and canopy cover percentage.</li>\n<li><strong>Cyclic Temporal Features:</strong> Sine/cosine transforms of month, hour, and day-of-week, plus a binary fire season flag (months 6–10).</li>\n</ul>\n<h3>Feature Selection Strategy</h3>\n<p>Different model families used curated feature subsets rather than a single universal set:</p>\n<ul>\n<li><strong>GBSA / RSF / XGB-AFT</strong> received all 35 raw numeric columns, letting the tree-based learners handle selection internally.</li>\n<li><strong>CoxPH</strong> used a hand-picked set of 27 features emphasizing distance transforms, ETA variants, zone flags, and threat composites — chosen to avoid multicollinearity in the linear model. Features were pushed through a QuantileTransformer → StandardScaler pipeline.</li>\n<li><strong>Timing Model &amp; Calibrators</strong> operated on specialized ~18-feature subsets tailored to the Near-zone and Far-zone tasks respectively.</li>\n</ul>\n<h3>Notable Interactions</h3>\n<p>The interaction between <strong>distance zone</strong> and <strong>effective closing speed</strong> was critical. A fast-closing fire in the near zone is an immediate threat; the same speed in the far zone is far less concerning. This motivated the zone-based weighting system rather than a single global model. \nNo external data was used.</p>\n<h2>Training Methods &amp; Ensemble Architecture</h2>\n<h3>Level-0: Six Base Model Families</h3>\n<p>All models were trained inside a <strong>7-fold Stratified K-Fold</strong> CV loop. Stratification used a composite label (event × 2 + near_zone_flag) to ensure balanced representation of close-proximity threats. Targets were IPCW-weighted binary labels via Kaplan-Meier censoring adjustment (weights clipped at 30.0).</p>\n<ol>\n<li><strong>Gradient Boosting Survival Analysis (GBSA):</strong> Five hyperparameter configurations × 8 random seeds = 40 models per fold, using Cox Partial Hazard loss. Parameters ranged from slow/deep (n_estimators=3000, lr=0.005) to fast/shallow (n_estimators=900, lr=0.020).</li>\n<li><strong>XGBoost Accelerated Failure Time (AFT):</strong> Trained on <code>survival:aft</code> with sigma tuned across [1.0, 1.3, 1.6]. Predictions are <strong>pre-blended</strong> into GBSA (82% GBSA + 18% AFT) before any downstream ensembling.</li>\n<li><strong>Cox Proportional Hazards (CoxPH):</strong> A linear survival model averaged across 9 L2 penalty alphas [0.0005 to 3.0], with QuantileTransformer + StandardScaler preprocessing.</li>\n<li><strong>Random Survival Forests (RSF):</strong> Four configurations × 6 seeds = 24 models per fold with heavy bootstrapping.</li>\n<li><strong>LightGBM Timing Model (Near Zone Only):</strong> A regressor predicting log-time-to-arrival on uncensored near-zone data, mapped to probabilities via normal CDF.</li>\n<li><strong>Two-Stage Calibrator:</strong> L2-Logistic Regression → Isotonic Regression pipeline, trained separately for Near and Far subsets across horizons 12, 24, and 48.</li>\n</ol>\n<h3>Zone-Based Blending</h3>\n<p>Rather than averaging predictions globally, independent 5-weight arrays for Near and Far zones were found via <strong>exhaustive combinatorial OOF grid search</strong> (values [0.0, 0.1, …, 0.6] per model slot) optimizing the Hybrid metric.\n<strong>Final optimized weights:</strong></p>\n<table>\n<thead>\n<tr>\n<th>Model Slot</th>\n<th>Near Zone</th>\n<th>Far Zone</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GBSA+AFT</td>\n<td>0.5</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>CoxPH</td>\n<td>0.5</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>RSF</td>\n<td>0.1</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>Calibrator</td>\n<td>0.6</td>\n<td>0.1</td>\n</tr>\n<tr>\n<td>Timing</td>\n<td>0.15</td>\n<td>0.0</td>\n</tr>\n<tr>\n<td>Near zones leaned on GBSA, Cox, and Calibrator diversity; the far zone was almost entirely Calibrator-driven.</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h3>Level-1 Meta-Stacker</h3>\n<p>A per-horizon LightGBM Classifier was trained on OOF base predictions alongside non-linear distance transforms. However, OOF tuning found the optimal meta weight to be <strong>0.0</strong> — the zone-based blend alone proved optimal and the meta-stacker did not contribute to the final predictions.</p>\n<hr>\n<h2>Post-Processing Pipeline</h2>\n<p>Raw predictions were subjected to a 7-step post-processing sequence:</p>\n<ol>\n<li><strong>Test-Time Augmentation (TTA):</strong> The test distance array was jittered by −2%, 0%, and +2%. The entire inference pipeline ran 3 times and averaged.</li>\n<li><strong>Horizon Smoothing:</strong> Adjacent horizons were blended to eliminate sharp jumps: <code>prob_24h = 0.90 × prob_24h + 0.10 × prob_12h</code> and <code>prob_48h = 0.85 × prob_48h + 0.15 × prob_24h</code>. The 72h horizon was not smoothed.</li>\n<li><strong>Strict Monotonicity Enforcement:</strong> Cumulative maximums (<code>np.maximum.accumulate</code>) across the horizon axis ensured probabilities never decrease over time.</li>\n<li><strong>Gaussian Jitter Injection:</strong> Small random Gaussian noise (mean=0, std=0.002) was added to break ties and smooth artifacts.</li>\n<li><strong>Horizon Temperature Scaling:</strong> Logit manipulation per-horizon — 24h sharpened (T=0.95), 48h neutral (T=1.00), 72h softened (T=1.05). The 12h horizon was left unscaled.</li>\n<li><strong>Very Far p12 Override:</strong> If distance ≥ 15 km, the 12-hour probability was hard-set to 0.0 — fires physically cannot travel that far in 12 hours.</li>\n<li><strong>Universal p72 Override:</strong> All 72-hour probabilities forced to 1.0, reflecting that over 72 hours every observed wildfire effectively reaches the target.</li>\n</ol>\n<hr>\n<h2>Key Insights &amp; What Set Us Apart</h2>\n<p>The <strong>most important trick</strong> was the Zone-Based Routing System — splitting predictions into Near and Far zones with independently optimized weights. This avoided the compromise of a one-size-fits-all global blend and let specialized models dominate in their strongest regimes.\nThree things we believe set us apart:</p>\n<ol>\n<li><strong>Physically motivated features</strong> — ETA, wavefront tracking, and margin calculations grounded in fire behavior rather than generic statistical transforms.</li>\n<li><strong>Pre-blending AFT into GBSA</strong> before ensemble construction — this stabilized gradient-boosted predictions and improved OOF scores.</li>\n<li><strong>Aggressive post-processing</strong> — the 7-step pipeline enforcing physical realism (monotonicity, zone-specific deterministic rules, temperature scaling) squeezed additional score improvements without overfitting.\nWe also discovered that fires at distance ≥ 15 km effectively never hit within 12 hours, and that the 72h survival probability was essentially 1.0 for all observations — both motivating deterministic overrides that improved the Brier score component.</li>\n</ol>\n<hr>\n<h2>Simplified Model</h2>\n<p>For a simpler alternative, the most important model is <strong>GBSA with Cox Partial Hazard loss</strong>. A single GBSA model trained on just ~8 key raw features could achieve roughly 99% of the full pipeline's performance:</p>\n<ol>\n<li><code>dist_min_ci_0_5h</code> (distance to target)</li>\n<li><code>closing_speed_abs_m_per_h</code></li>\n<li><code>radial_growth_rate_m_per_h</code></li>\n<li><code>alignment_abs</code></li>\n<li><code>area_first_ha</code></li>\n<li><code>area_growth_rate_ha_per_h</code></li>\n<li><code>projected_advance_m</code></li>\n<li><code>centroid_speed_m_per_h</code></li>\n</ol>\n<hr>\n<h2>Execution Time</h2>\n<p>All times measured on <strong>Kaggle CPU kernel</strong> (no GPU).</p>\n<table>\n<thead>\n<tr>\n<th>Stage</th>\n<th>Time</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Full pipeline (training + inference)</td>\n<td>~18 minutes</td>\n</tr>\n</tbody>\n</table>",
      "rawMarkdown": "\n## Team & Competition Overview\n\n<table>\n  <tr>\n    <th align=\"left\">Attribute</th>\n    <th align=\"left\">Details</th>\n  </tr>\n  <tr>\n    <td><b>Competition</b></td>\n    <td>WiDS Global Datathon 2026</td>\n  </tr>\n  <tr>\n    <td><b>Team Name</b></td>\n    <td>Bob the Builder(s)</td>\n  </tr>\n  <tr>\n    <td><b>Public Score</b></td>\n    <td>0.97707</td>\n  </tr>\n  <tr>\n    <td><b>Private Score</b></td>\n    <td>0.96681</td>\n  </tr>\n  <tr>\n    <td><b>Private Rank</b></td>\n    <td>19</td>\n  </tr>\n \n  <tr>\n    <td><b>Location</b></td>\n    <td>Dhaka</td>\n  </tr>\n \n</table>\n\n---\n\n## About the Team\n\nI'm the sole member of team Bob the Builder(s). I'm a Sophomore at Bangladesh University of Engineering and Technology majoring in Computer Science and Engineering. And I like playing League of Legends : D !\nThis is my first Machine Learning competition and before this, I had no idea about Machine Learning or Deep Learning. I had to grind hard throughout the competition. My main aim was to use this as a stepping stone into the realm of ML and DL. I spent about a month or so on this competition. \n\n***\n\n## Solution Summary\n\nWe built a **zone-aware survival ensemble** that predicts cumulative wildfire hit probabilities across 12, 24, 48, and 72-hour horizons. The core idea is a **Zone-Based Routing System** — fires are routed into Near (< 5 km) and Far (≥ 5 km) zones, with independent model weight arrays optimized per zone via an exhaustive OOF grid search.\n\nThe Level-0 ensemble combines six model families — Gradient Boosting Survival Analysis (GBSA), XGBoost AFT, Cox Proportional Hazards, Random Survival Forests, a LightGBM Timing model, and a Two-Stage Calibrator — all trained inside a 7-fold Stratified K-Fold CV loop with IPCW-weighted targets. A pre-blending step merges AFT into GBSA (82/18 split) before zone-based weight optimization. The entire pipeline (training + inference) runs in approximately **18 minutes** on Kaggle's CPU kernel using Python with scikit-survival, XGBoost, LightGBM, and scikit-learn.\n\n***\n\nFeature Engineering\n---\nThe raw dataset contains 35 columns. Through engineering we expanded this to ~90+ features organized into several families:\n\n### Spatial Zones & Distance Percentiles\n\nFires behave fundamentally differently when they are at the doorstep versus miles away. We hard-coded structural zone boundaries — **Near** (< 5 km), **Warning** (5–10 km), **Far** (≥ 10 km), and **Very Far** (≥ 15 km) — and computed **Relative Percentile Ranks** within each zone. For example, `near_speed_rank` evaluates a fire's effective closing speed strictly against the historical distribution of other near-zone fires.\n\n### ETA, Velocity & Boundary Margins\n\n*   **Effective Closing Speed:** Combines absolute closing speed, radial growth rate, and an alignment penalty into a single physical proxy.\n*   **Time-to-Arrival (ETA):** Distance divided by effective closing speed.\n*   **Wavefront ETA:** Subtracts the radial growth from the distance before computing ETA, tracking the leading edge of the fire.\n*   **Margin & Gate Proximity:** The literal margin of error (distance − fire radius − projected advance) and proximity to a critical 5 km \"gate.\"\n\n### Composite Threat & Environmental Indices\n\n*   **Fire Power:** `log(1 + area_km²) × effective_closing / (dist_km + 0.1)`.\n*   **Threat Score:** Combines alignment, effective closing speed, and log-area, inversely penalized by distance.\n*   **Environmental Threat:** Fuses wind speed, inverse humidity, and canopy cover percentage.\n*   **Cyclic Temporal Features:** Sine/cosine transforms of month, hour, and day-of-week, plus a binary fire season flag (months 6–10).\n\n### Feature Selection Strategy\n\nDifferent model families used curated feature subsets rather than a single universal set:\n\n*   **GBSA / RSF / XGB-AFT** received all 35 raw numeric columns, letting the tree-based learners handle selection internally.\n*   **CoxPH** used a hand-picked set of 27 features emphasizing distance transforms, ETA variants, zone flags, and threat composites — chosen to avoid multicollinearity in the linear model. Features were pushed through a QuantileTransformer → StandardScaler pipeline.\n*   **Timing Model & Calibrators** operated on specialized ~18-feature subsets tailored to the Near-zone and Far-zone tasks respectively.\n\n### Notable Interactions\n\nThe interaction between **distance zone** and **effective closing speed** was critical. A fast-closing fire in the near zone is an immediate threat; the same speed in the far zone is far less concerning. This motivated the zone-based weighting system rather than a single global model. \n\nNo external data was used.\n\n## Training Methods & Ensemble Architecture\n\n### Level-0: Six Base Model Families\n\nAll models were trained inside a **7-fold Stratified K-Fold** CV loop. Stratification used a composite label (event × 2 + near_zone_flag) to ensure balanced representation of close-proximity threats. Targets were IPCW-weighted binary labels via Kaplan-Meier censoring adjustment (weights clipped at 30.0).\n\n1.  **Gradient Boosting Survival Analysis (GBSA):** Five hyperparameter configurations × 8 random seeds = 40 models per fold, using Cox Partial Hazard loss. Parameters ranged from slow/deep (n_estimators=3000, lr=0.005) to fast/shallow (n_estimators=900, lr=0.020).\n2.  **XGBoost Accelerated Failure Time (AFT):** Trained on `survival:aft` with sigma tuned across [1.0, 1.3, 1.6]. Predictions are **pre-blended** into GBSA (82% GBSA + 18% AFT) before any downstream ensembling.\n3.  **Cox Proportional Hazards (CoxPH):** A linear survival model averaged across 9 L2 penalty alphas [0.0005 to 3.0], with QuantileTransformer + StandardScaler preprocessing.\n4.  **Random Survival Forests (RSF):** Four configurations × 6 seeds = 24 models per fold with heavy bootstrapping.\n5.  **LightGBM Timing Model (Near Zone Only):** A regressor predicting log-time-to-arrival on uncensored near-zone data, mapped to probabilities via normal CDF.\n6.  **Two-Stage Calibrator:** L2-Logistic Regression → Isotonic Regression pipeline, trained separately for Near and Far subsets across horizons 12, 24, and 48.\n\n### Zone-Based Blending\n\nRather than averaging predictions globally, independent 5-weight arrays for Near and Far zones were found via **exhaustive combinatorial OOF grid search** (values [0.0, 0.1, …, 0.6] per model slot) optimizing the Hybrid metric.\n\n**Final optimized weights:**\n\n| Model Slot | Near Zone | Far Zone |\n|------------|-----------|----------|\n| GBSA+AFT | 0.5 | 0.0 |\n| CoxPH | 0.5 | 0.0 |\n| RSF | 0.1 | 0.0 |\n| Calibrator | 0.6 | 0.1 |\n| Timing | 0.15 | 0.0 |\n\nNear zones leaned on GBSA, Cox, and Calibrator diversity; the far zone was almost entirely Calibrator-driven.\n\n### Level-1 Meta-Stacker\n\nA per-horizon LightGBM Classifier was trained on OOF base predictions alongside non-linear distance transforms. However, OOF tuning found the optimal meta weight to be **0.0** — the zone-based blend alone proved optimal and the meta-stacker did not contribute to the final predictions.\n\n***\n\n## Post-Processing Pipeline\n\nRaw predictions were subjected to a 7-step post-processing sequence:\n\n1.  **Test-Time Augmentation (TTA):** The test distance array was jittered by −2%, 0%, and +2%. The entire inference pipeline ran 3 times and averaged.\n2.  **Horizon Smoothing:** Adjacent horizons were blended to eliminate sharp jumps: `prob_24h = 0.90 × prob_24h + 0.10 × prob_12h` and `prob_48h = 0.85 × prob_48h + 0.15 × prob_24h`. The 72h horizon was not smoothed.\n3.  **Strict Monotonicity Enforcement:** Cumulative maximums (`np.maximum.accumulate`) across the horizon axis ensured probabilities never decrease over time.\n4.  **Gaussian Jitter Injection:** Small random Gaussian noise (mean=0, std=0.002) was added to break ties and smooth artifacts.\n5.  **Horizon Temperature Scaling:** Logit manipulation per-horizon — 24h sharpened (T=0.95), 48h neutral (T=1.00), 72h softened (T=1.05). The 12h horizon was left unscaled.\n6.  **Very Far p12 Override:** If distance ≥ 15 km, the 12-hour probability was hard-set to 0.0 — fires physically cannot travel that far in 12 hours.\n7.  **Universal p72 Override:** All 72-hour probabilities forced to 1.0, reflecting that over 72 hours every observed wildfire effectively reaches the target.\n\n***\n\n## Key Insights & What Set Us Apart\n\nThe **most important trick** was the Zone-Based Routing System — splitting predictions into Near and Far zones with independently optimized weights. This avoided the compromise of a one-size-fits-all global blend and let specialized models dominate in their strongest regimes.\n\nThree things we believe set us apart:\n\n1.  **Physically motivated features** — ETA, wavefront tracking, and margin calculations grounded in fire behavior rather than generic statistical transforms.\n2.  **Pre-blending AFT into GBSA** before ensemble construction — this stabilized gradient-boosted predictions and improved OOF scores.\n3.  **Aggressive post-processing** — the 7-step pipeline enforcing physical realism (monotonicity, zone-specific deterministic rules, temperature scaling) squeezed additional score improvements without overfitting.\n\nWe also discovered that fires at distance ≥ 15 km effectively never hit within 12 hours, and that the 72h survival probability was essentially 1.0 for all observations — both motivating deterministic overrides that improved the Brier score component.\n\n***\n\n## Simplified Model\n\nFor a simpler alternative, the most important model is **GBSA with Cox Partial Hazard loss**. A single GBSA model trained on just ~8 key raw features could achieve roughly 99% of the full pipeline's performance:\n\n1.  `dist_min_ci_0_5h` (distance to target)\n2.  `closing_speed_abs_m_per_h`\n3.  `radial_growth_rate_m_per_h`\n4.  `alignment_abs`\n5.  `area_first_ha`\n6.  `area_growth_rate_ha_per_h`\n7.  `projected_advance_m`\n8.  `centroid_speed_m_per_h`\n\n\n\n***\n\n## Execution Time\n\nAll times measured on **Kaggle CPU kernel** (no GPU).\n\n| Stage | Time |\n|-------|------|\n| Full pipeline (training + inference) | ~18 minutes |\n\n",
      "votes": 1
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T08:49:00Z",
  "competition_id": 125681,
  "competition_slug": "WiDSWorldWide_GlobalDathon26",
  "team_id": 15422617,
  "solution_url": "/competitions/WiDSWorldWide_GlobalDathon26/writeups/wids-global-datathon-2026-5th-place-solution-bo"
}