# starryroses/turbofan-rul-predictor architecture

> Architecture diagram of the GitHub repository starryroses/turbofan-rul-predictor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/starryroses/turbofan-rul-predictor
- Repository: https://github.com/starryroses/turbofan-rul-predictor

## Overview

This repository is an interactive turbofan predictive-maintenance dashboard. A user selects an engine from the FD001 test data or enters sensor readings manually; the app runs the readings through a stacked RUL predictor, then presents health, anomaly, uncertainty, explanation, and maintenance information. The README also documents training and validation methods, but the sampled source is the dashboard rather than the training implementation; those methods are therefore represented only as documented model provenance.

Main entry points: [`src/streamlit_app.py`](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py) (Inference pipeline), [`src/models/xgb_model.pkl`](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/xgb_model.pkl) (XGBoost), [`src/models/scaler.pkl`](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/scaler.pkl) (Feature scaling), [`src/models/rf_model.pkl`](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/rf_model.pkl) (Random Forest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard interaction"]
  node_app["Streamlit dashboard<br/>[streamlit_app.py]"]
  node_engine_selection["Engine selection<br/>[streamlit_app.py]"]
  node_manual_input["Manual sensor input<br/>[streamlit_app.py]"]
  node_report["Health report<br/>[streamlit_app.py]"]
end

subgraph group_inference["RUL inference"]
  node_inference_pipeline["Inference pipeline<br/>[streamlit_app.py]"]
  node_scaling["Feature scaling<br/>[scaler.pkl]"]
  node_random_forest["Random Forest<br/>[rf_model.pkl]"]
  node_xgboost["XGBoost<br/>[xgb_model.pkl]"]
  node_lightgbm["LightGBM<br/>[lgbm_model.pkl]"]
  node_ridge_meta["Ridge meta-model<br/>[meta_model.pkl]"]
  node_calibration_model["XGBoost calibration model"]
end

subgraph group_insight["Prediction insights"]
  node_anomaly_detection["Anomaly detection<br/>[iso_model.pkl]"]
  node_uncertainty["Conformal intervals<br/>[streamlit_app.py]"]
  node_explanation["SHAP explanations<br/>[streamlit_app.py]"]
  node_recommendations["Maintenance guidance<br/>[streamlit_app.py]"]
end

subgraph group_assets["Data and model assets"]
  node_feature_metadata["Feature metadata<br/>[feature_cols.json]"]
  node_sensor_metadata["Sensor selection"]
  node_test_data[("FD001 test data")]
  node_truth_data[("True RUL values")]
  node_residuals["Calibration residuals"]
end

node_operator(("Dashboard user"))

node_operator -->|"uses"| node_app
node_app -->|"offers mode"| node_engine_selection
node_app -->|"offers mode"| node_manual_input
node_engine_selection -->|"loads"| node_test_data
node_engine_selection -->|"loads"| node_truth_data
node_engine_selection -->|"loads"| node_feature_metadata
node_engine_selection -->|"loads"| node_sensor_metadata
node_engine_selection -->|"submits readings"| node_inference_pipeline
node_manual_input -->|"submits readings"| node_inference_pipeline
node_inference_pipeline -->|"scales features"| node_scaling
node_inference_pipeline -->|"predicts with"| node_random_forest
node_inference_pipeline -->|"predicts with"| node_xgboost
node_inference_pipeline -->|"predicts with"| node_lightgbm
node_inference_pipeline -->|"combines predictions"| node_ridge_meta
node_inference_pipeline -->|"scores anomaly"| node_anomaly_detection
node_inference_pipeline -->|"returns results"| node_report
node_report -->|"computes interval"| node_uncertainty
node_report -->|"uses calibration"| node_residuals
node_report -->|"explains prediction"| node_explanation
node_explanation -->|"explains with"| node_xgboost
node_report -->|"shows guidance"| node_recommendations
node_inference_pipeline -->|"loads model"| node_calibration_model

click node_app "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_engine_selection "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_manual_input "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_report "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_inference_pipeline "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_scaling "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/scaler.pkl"
click node_random_forest "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/rf_model.pkl"
click node_xgboost "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/xgb_model.pkl"
click node_lightgbm "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/lgbm_model.pkl"
click node_ridge_meta "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/meta_model.pkl"
click node_feature_metadata "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/info/feature_cols.json"
click node_sensor_metadata "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/info/sensors_to_use.json"
click node_test_data "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/data/test_FD001_processed.csv"
click node_truth_data "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/data/test_FD001_true_rul.csv"
click node_anomaly_detection "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/iso_model.pkl"
click node_uncertainty "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_residuals "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/calibration_residuals.npy"
click node_explanation "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"
click node_calibration_model "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/xgb_calib_model.pkl"
click node_recommendations "https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_engine_selection,node_manual_input,node_report,node_operator toneBlue
class node_inference_pipeline,node_scaling,node_random_forest,node_xgboost,node_lightgbm,node_ridge_meta,node_calibration_model toneAmber
class node_anomaly_detection,node_uncertainty,node_explanation,node_recommendations toneMint
class node_feature_metadata,node_sensor_metadata,node_test_data,node_truth_data,node_residuals toneRose
```

## Components

### Dashboard interaction

- [Streamlit dashboard](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`
- [Engine selection](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`
- [Manual sensor input](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`
- [Health report](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`

### RUL inference

- [Inference pipeline](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`
- [Feature scaling](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/scaler.pkl): `src/models/scaler.pkl`
- [Random Forest](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/rf_model.pkl): `src/models/rf_model.pkl`
- [XGBoost](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/xgb_model.pkl): `src/models/xgb_model.pkl`
- [LightGBM](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/lgbm_model.pkl): `src/models/lgbm_model.pkl`
- [Ridge meta-model](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/meta_model.pkl): `src/models/meta_model.pkl`
- [XGBoost calibration model](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/xgb_calib_model.pkl): `src/models/xgb_calib_model.pkl`

### Prediction insights

- [Anomaly detection](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/iso_model.pkl): `src/models/iso_model.pkl`
- [Conformal intervals](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`
- [SHAP explanations](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`
- [Maintenance guidance](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/streamlit_app.py): `src/streamlit_app.py`

### Data and model assets

- [Feature metadata](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/info/feature_cols.json): `src/info/feature_cols.json`
- [Sensor selection](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/info/sensors_to_use.json): `src/info/sensors_to_use.json`
- [FD001 test data](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/data/test_FD001_processed.csv): `src/data/test_FD001_processed.csv`
- [True RUL values](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/data/test_FD001_true_rul.csv): `src/data/test_FD001_true_rul.csv`
- [Calibration residuals](https://github.com/starryroses/turbofan-rul-predictor/blob/main/src/models/calibration_residuals.npy): `src/models/calibration_residuals.npy`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Streamlit dashboard: uses (evidence: `README.md`)
- Streamlit dashboard → Engine selection: offers mode (evidence: `src/streamlit_app.py`)
- Streamlit dashboard → Manual sensor input: offers mode (evidence: `src/streamlit_app.py`)
- Engine selection → FD001 test data: loads (evidence: `src/streamlit_app.py`)
- Engine selection → True RUL values: loads (evidence: `src/streamlit_app.py`)
- Engine selection → Feature metadata: loads (evidence: `src/streamlit_app.py`)
- Engine selection → Sensor selection: loads (evidence: `src/streamlit_app.py`)
- Engine selection → Inference pipeline: submits readings (evidence: `src/streamlit_app.py`)
- Manual sensor input → Inference pipeline: submits readings (evidence: `src/streamlit_app.py`)
- Inference pipeline → Feature scaling: scales features (evidence: `src/streamlit_app.py`)
- Inference pipeline → Random Forest: predicts with (evidence: `src/streamlit_app.py`)
- Inference pipeline → XGBoost: predicts with (evidence: `src/streamlit_app.py`)
- Inference pipeline → LightGBM: predicts with (evidence: `src/streamlit_app.py`)
- Inference pipeline → Ridge meta-model: combines predictions (evidence: `src/streamlit_app.py`)
- Inference pipeline → Anomaly detection: scores anomaly (evidence: `src/streamlit_app.py`)
- Inference pipeline → Health report: returns results (evidence: `src/streamlit_app.py`)
- Health report → Conformal intervals: computes interval (evidence: `src/streamlit_app.py`)
- Health report → Calibration residuals: uses calibration (evidence: `src/streamlit_app.py`)
- Health report → SHAP explanations: explains prediction (evidence: `src/streamlit_app.py`)
- SHAP explanations → XGBoost: explains with (evidence: `src/streamlit_app.py`)
- Health report → Maintenance guidance: shows guidance (evidence: `README.md`)
- Inference pipeline → XGBoost calibration model: loads model (evidence: `src/streamlit_app.py`)
