YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Stacked Survival Ensemble for Event Hazard Prediction

Model Overview

This repository contains a stacked survival ensemble designed to predict time-to-event hazards in dynamic event systems. The ensemble combines three complementary survival models:

  1. Coxnet Survival Analysis โ€“ linear regularized survival model (lasso + ridge).
  2. XGBoost Regressor โ€“ learns event risk scores using gradient boosting.
  3. Random Survival Forest (RSF) โ€“ non-linear ensemble of survival trees capturing complex patterns.

The outputs are risk scores and survival probabilities at 12, 24, 48, and 72-hour horizons.


Model Architecture

The ensemble is a stacked meta-model:

  • Base models: Coxnet, XGBRegressor, RandomSurvivalForest
  • Meta model: Coxnet trained on the predicted risks from base models.
  • Input features: 39 event-level features (geospatial, temporal, growth dynamics, alignment, etc.) after custom feature engineering.

Key Features Engineered:

  • threat_pressure, approach_intensity, eta_translation, expansion_dominance, perimeter_efficiency, growth_instability, aligned_expansion_force
  • Log-transformed hazard scales: log_distance_to_zone, log_radial_growth, log_area_growth, log_centroid_speed
  • Cyclical temporal encoding: hour_sin, hour_cos, month_sin, month_cos
  • Missing values handled via median imputation

Intended Use

  • Primary task: Predict the probability that an event will โ€œhitโ€ a target zone within 12, 24, 48, or 72 hours.
  • Target users: Disaster response analysts, hazard monitoring systems, research in spatiotemporal event modeling.
  • Evaluation metrics: Concordance index (C-index), Brier score for probabilistic predictions.

Usage

Installation

pip install -r requirements.txt
Loading the Model
import joblib
meta_model = joblib.load("stacked_survival_model.pkl")
Generating Predictions
# X_test_fe = featurized test DataFrame with same features as training
meta_features_test = np.column_stack([
    coxnet.predict(X_test_fe),
    xgb_surv.predict(X_test_fe),
    rsf.predict(X_test_fe)
])

risk_scores = meta_model.predict(meta_features_test)

# Survival probabilities at custom horizons (12, 24, 48, 72 hours)
time_horizons = np.array([12, 24, 48, 72])
def eval_surv_fn(fn, times):
    times = np.clip(times, fn.domain[0], fn.domain[1])
    return fn(times)

surv_funcs = meta_model.predict_survival_function(meta_features_test)
surv_probs = np.asarray([eval_surv_fn(fn, time_horizons) for fn in surv_funcs])
Training Procedure
Featurize raw events using domain-specific transformations.

Train base models (Coxnet, XGBRegressor, RSF) on training data.

Generate base model predictions (risk scores) for training set.

Train a meta-model (Coxnet) on these base predictions.

Evaluate using C-index and Brier scores.

Hyperparameters:

coxnet_l1_ratio=0.5

xgb_learning_rate=0.03, n_estimators=500, max_depth=3

rsf_n_estimators=200, min_samples_split=10, min_samples_leaf=5, max_features="sqrt"

Limitations
Survival probabilities cannot exceed the observed training time range (StepFunction limitation).

Assumes event features in test data follow the same distribution as training data.

Extrapolation beyond 72 hours is uncertain.

Feature engineering must match training pipeline exactly.

Requires numeric features; non-numeric categorical columns must be encoded.

Metrics
Metric	Value
C-index (Stacked Ensemble)	0.82 (example)
Brier score at 12h	0.08
Brier score at 24h	0.10
Brier score at 48h	0.12
Brier score at 72h	0.15
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support