Skip to content

feature added: RL failure forecaster explainability - #33

Open
Oklyagina wants to merge 13 commits into
ainetus:mainfrom
Oklyagina:debug/hgb-pipeline-alignment-powergrid
Open

Oklyagina wants to merge 13 commits into
ainetus:mainfrom
Oklyagina:debug/hgb-pipeline-alignment-powergrid

Conversation

@Oklyagina

@Oklyagina Oklyagina commented Oct 30, 2026 •

Copy link
Copy Markdown
  • Updated the Docker image from Debian Bullseye to Bookworm because Bullseye package repositories were returning 404 errors.
  • added one-hour-ahead RL-agent failure forecasting to the PowerGrid simulator.
  • added explanatory field to json

Before launching service, download the trained models and copy the failure_forecast contents to PowerGrid/Ressources/failure_forecast/, preserving explainability/rules/.

When an overload event is accepted by InteractiveAI, the simulator:

  1. Forecasts load and generation one hour ahead (t+12).
  2. Builds the corresponding future Grid2Op operating state.
  3. Independently disconnects each of the 10 configured transmission lines.
  4. Extracts the post-contingency scenario features.
  5. Uses the trained HGB classifier to produce a failure probability and binary
    prediction for every line.
  6. Publishes all results in one child event linked to the original overload.

The child event is titled "Predicted RL failure probabilities by line" and contains, for every configured line, following values:

{
  "41_48_131": {  
    "failure_probability": 0.75,
    "failure_probability_pct": 75.0,
    "failure_prediction": 1,
    "explanation": "For a contingency on line 41_48_131, ...",
    "rule_prediction": 1,
    "rule_agrees_with_forecast": true
  }
}

The rule-based prediction is produced by a small explanatory rule extracted from the classifier. It is included to show whether the simplified rule agrees with the HGB result; it never changes the HGB probability or prediction.

Explanatory rules are loaded and validated locally from Ressources/failure_forecast/explainability/rules.

No LLM connection, API key, or network request is required at runtime. Missing or invalid rules result in null explainability fields without suppressing the HGB forecast.

Deployment changes:

  • Added joblib/scikit-learn runtime dependencies.
  • Added configurable failure-forecast artifact directory.
  • Added documentation for the required model and rule artifacts.

Example of json output with 10 lines info

{
  "data": {
    "kpis": {
      "failure_forecasts": {
        "62_58_180": {
          "failure_probability": 0.75,
          "failure_probability_pct": 75.0,
          "failure_prediction": 1,
          "explanation": "For a contingency on line 62_58_180, ...",
          "rule_prediction": 1,
          "rule_agrees_with_forecast": true
        },
        "62_63_160": {},
        "48_50_136": {},
        "48_53_141": {},
        "41_48_131": {},
        "39_41_121": {},
        "43_44_125": {},
        "44_45_126": {},
        "34_35_110": {},
        "54_58_154": {}
      }
    }
  }
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants