# lunar-boy/e-nose-gas-classification-h2s-regression architecture

> Architecture diagram of the GitHub repository lunar-boy/e-nose-gas-classification-h2s-regression, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lunar-boy/e-nose-gas-classification-h2s-regression
- Repository: https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression

## Overview

This repository is a collection of standalone electronic-nose analysis workflows, not a shared application. Users prepare frame-wise gas recordings for multi-gas classification and run a separate H2S concentration-regression pipeline; both yield evaluation results and figures. Additional scripts derive run-level fingerprints and visualize model summaries, while small utilities inspect or trim sensor recordings. The README documents the major capabilities, but sampled excerpts do not expose every pipeline’s internal calls, so the graph shows documented input/output relationships and omits uncertain internal wiring.

Main entry points: [`data/raw_data`](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data/raw_data) (Gas recordings), [`run_h2s_concentration_regression.py`](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/run_h2s_concentration_regression.py) (H2S regression pipeline), [`data/all_gases_framewise.csv`](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/data/all_gases_framewise.csv) (Frame-wise dataset), [`tools/fuse_data.py`](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/fuse_data.py) (Add cycle metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_raw["Gas recordings"]
  node_metadata["Metadata-enriched files"]
  node_fuse_data["Add cycle metadata<br/>[fuse_data.py]"]
  node_fuse_csv["Merge gas CSVs<br/>[fuse_csv.py]"]
  node_framewise["Frame-wise dataset"]
  node_sensor_tools["Recording trim utilities"]
end

subgraph group_classify["Gas classification"]
  node_classification["Run/window classification"]
  node_class_results["Classification metrics and confusion matrices"]
end

subgraph group_regress["H2S regression"]
  node_h2s_raw["H2S concentration recordings"]
  node_regression["H2S regression pipeline"]
  node_reg_results["Regression metrics and artifacts"]
  node_baseline_csv["Baseline comparison CSV"]
end

subgraph group_visualize["Analysis figures"]
  node_fingerprint["Fingerprint and PCA"]
  node_fingerprint_fig["Fingerprint figures"]
  node_regression_fig["H2S model comparison figure"]
  node_regression_fig_out["H2S summary outputs"]
  node_metrics_plot["Metrics summary plots"]
  node_confmat_plot["Confusion-matrix panels"]
  node_sensor_plot["Sensor time-series plots<br/>[plot_16_sensors.py]"]
  node_sensor_plot_flush["Flush-trimmed sensor plots"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_fuse_data
node_raw -->|"reads"| node_fuse_data
node_fuse_data -->|"writes"| node_metadata
node_user -->|"runs"| node_fuse_csv
node_metadata -->|"reads"| node_fuse_csv
node_fuse_csv -->|"writes"| node_framewise
node_user -->|"runs"| node_classification
node_framewise -->|"reads"| node_classification
node_classification -->|"writes"| node_class_results
node_user -->|"runs"| node_regression
node_h2s_raw -->|"reads"| node_regression
node_regression -->|"writes"| node_reg_results
node_regression -->|"writes"| node_baseline_csv
node_user -->|"runs"| node_fingerprint
node_framewise -->|"reads"| node_fingerprint
node_fingerprint -->|"writes"| node_fingerprint_fig
node_user -->|"runs"| node_regression_fig
node_baseline_csv -->|"reads"| node_regression_fig
node_regression_fig -->|"writes"| node_regression_fig_out
node_user -->|"runs"| node_metrics_plot
node_metrics_plot -.->|"reads"| node_class_results
node_user -->|"runs"| node_confmat_plot
node_confmat_plot -->|"reads"| node_class_results
node_user -->|"runs"| node_sensor_plot
node_raw -->|"reads"| node_sensor_plot
node_user -->|"runs"| node_sensor_plot_flush
node_raw -->|"reads"| node_sensor_plot_flush
node_user -->|"runs"| node_sensor_tools
node_sensor_tools -->|"rewrites"| node_raw

click node_raw "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data/raw_data"
click node_metadata "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data/raw_data/with_meta"
click node_fuse_data "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/fuse_data.py"
click node_fuse_csv "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/fuse_csv.py"
click node_framewise "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/data/all_gases_framewise.csv"
click node_classification "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/baseline_run_window_pipeline_rf.py"
click node_h2s_raw "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data"
click node_regression "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/run_h2s_concentration_regression.py"
click node_baseline_csv "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/data/baseline_comparison.csv"
click node_fingerprint "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/figure_fingerprint_pca.py"
click node_regression_fig "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/fig_h2s_regression_main4.py"
click node_metrics_plot "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/plot_metrics_summary.py"
click node_confmat_plot "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/plot_confmats_5baselines_rasterpanels.py"
click node_sensor_plot "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/plot_16_sensors.py"
click node_sensor_plot_flush "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/plot_16_sensors_skip_flush600s.py"
click node_sensor_tools "https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/drop_flush_prefix.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_raw,node_metadata,node_fuse_data,node_fuse_csv,node_framewise,node_sensor_tools toneBlue
class node_classification,node_class_results toneAmber
class node_h2s_raw,node_regression,node_reg_results,node_baseline_csv toneMint
class node_fingerprint,node_fingerprint_fig,node_regression_fig,node_regression_fig_out,node_metrics_plot,node_confmat_plot,node_sensor_plot,node_sensor_plot_flush toneRose
class node_user toneIndigo
```

## Components

### Data preparation

- [Gas recordings](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data/raw_data): `data/raw_data`
- [Metadata-enriched files](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data/raw_data/with_meta): `data/raw_data/with_meta`
- [Add cycle metadata](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/fuse_data.py): `tools/fuse_data.py`
- [Merge gas CSVs](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/fuse_csv.py): `tools/fuse_csv.py`
- [Frame-wise dataset](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/data/all_gases_framewise.csv): `data/all_gases_framewise.csv`
- [Recording trim utilities](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/drop_flush_prefix.py): `tools/drop_flush_prefix.py`

### Gas classification

- [Run/window classification](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/baseline_run_window_pipeline_rf.py): `baseline_run_window_pipeline_rf.py`
- **Classification metrics and confusion matrices**

### H2S regression

- [H2S concentration recordings](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/tree/main/data): `data`
- [H2S regression pipeline](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/run_h2s_concentration_regression.py): `run_h2s_concentration_regression.py`
- **Regression metrics and artifacts**
- [Baseline comparison CSV](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/data/baseline_comparison.csv): `data/baseline_comparison.csv`

### Analysis figures

- [Fingerprint and PCA](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/figure_fingerprint_pca.py): `figure_fingerprint_pca.py`
- **Fingerprint figures**
- [H2S model comparison figure](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/fig_h2s_regression_main4.py): `fig_h2s_regression_main4.py`
- **H2S summary outputs**
- [Metrics summary plots](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/plot_metrics_summary.py): `plot_metrics_summary.py`
- [Confusion-matrix panels](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/plot_confmats_5baselines_rasterpanels.py): `plot_confmats_5baselines_rasterpanels.py`
- [Sensor time-series plots](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/plot_16_sensors.py): `tools/plot_16_sensors.py`
- [Flush-trimmed sensor plots](https://github.com/lunar-boy/e-nose-gas-classification-h2s-regression/blob/main/tools/plot_16_sensors_skip_flush600s.py): `tools/plot_16_sensors_skip_flush600s.py`

### Other components

- **Researcher**

## Connections

- Researcher → Add cycle metadata: runs
- Gas recordings → Add cycle metadata: reads
- Add cycle metadata → Metadata-enriched files: writes
- Researcher → Merge gas CSVs: runs
- Metadata-enriched files → Merge gas CSVs: reads
- Merge gas CSVs → Frame-wise dataset: writes
- Researcher → Run/window classification: runs
- Frame-wise dataset → Run/window classification: reads
- Run/window classification → Classification metrics and confusion matrices: writes
- Researcher → H2S regression pipeline: runs
- H2S concentration recordings → H2S regression pipeline: reads
- H2S regression pipeline → Regression metrics and artifacts: writes
- H2S regression pipeline → Baseline comparison CSV: writes
- Researcher → Fingerprint and PCA: runs
- Frame-wise dataset → Fingerprint and PCA: reads
- Fingerprint and PCA → Fingerprint figures: writes
- Researcher → H2S model comparison figure: runs
- Baseline comparison CSV → H2S model comparison figure: reads
- H2S model comparison figure → H2S summary outputs: writes
- Researcher → Metrics summary plots: runs
- Metrics summary plots → Classification metrics and confusion matrices: reads
- Researcher → Confusion-matrix panels: runs
- Confusion-matrix panels → Classification metrics and confusion matrices: reads
- Researcher → Sensor time-series plots: runs
- Gas recordings → Sensor time-series plots: reads
- Researcher → Flush-trimmed sensor plots: runs
- Gas recordings → Flush-trimmed sensor plots: reads
- Researcher → Recording trim utilities: runs
- Recording trim utilities → Gas recordings: rewrites
