K-HEALTHinAIR — Pilot ES (Spain): Indoor Air Quality Analysis
Description
# K-HEALTHinAIR — Pilot ES (Spain): Indoor Air Quality Analysis
## Overview
This dataset and set of analysis notebooks correspond to the **Spanish pilot** of the K-HEALTHinAIR EU-funded project. The pilot monitors indoor and outdoor air quality across three building types: **residential homes** (HOM), a **hospital** (HOS), and a **market / public space** (MKT), with campaigns running from March 2023 to June 2025.
These analyses are intended to be used with data collected from sensors as deployed in the pilot sites. The data provided is the subset filtered by pilot owners from the K-HEALTHinAIR platform to carry out specific analysis.
This pilot is distinguished by its large hospital deployment (212 sensors across multiple clinical areas), the integration of **formaldehyde** measurements, the availability of **VOC speciation data** from manual sampling campaigns (CIEMAT format), and the provision of cleaned `_filtered_data` variants alongside raw files.
---
## Contents
```
ES/
├── README.md
├── EDA_ES_HOM.ipynb
├── EDA_ES_HOM_Outliers_file.ipynb
├── EDA_ES_HOS.ipynb
├── EDA_ES_HOS_Outliers.ipynb
├── EDA_ES_corr_I_O_file.ipynb
├── EDA_ES_HOS_corr_I_O.ipynb
├── ESHOS01_VOC.ipynb
├── Forecasting_ES_HOS.ipynb
└── Data/
├── ESHOM_*.csv (5 files — residential homes)
├── ESHOS_*.csv (5 files — hospital)
└── ESMKT_*.csv (2 files — market)
```
---
## Notebooks
### `EDA_ES_HOM.ipynb`
Exploratory data analysis of residential home sensors. Includes descriptive statistics, Pearson and Spearman correlation matrices, intensity plots, air quality threshold assessment (CO₂ < 900 ppm; WHO-adapted TVOC categories; PM limits), logistic regression for working-day prediction, seasonal decomposition, and autocorrelation analysis.
### `EDA_ES_HOM_Outliers_file.ipynb`
Outlier detection and data quality assessment for home sensor data using Isolation Forest. Generates the `_filtered_data` variant of the HOM files.
### `EDA_ES_HOS.ipynb`
Exploratory analysis of the hospital deployment. Covers 212 sensors distributed across multiple clinical areas. Includes descriptive statistics, air quality assessment, and temporal patterns.
### `EDA_ES_HOS_Outliers.ipynb`
Outlier detection for hospital sensor data. Applies Isolation Forest and generates the `_filtered_data` variant of the HOS files.
### `EDA_ES_corr_I_O_file.ipynb`
File-level indoor–outdoor correlation analysis across all ES building types. Computes Pearson heatmaps and I/O ratios.
### `EDA_ES_HOS_corr_I_O.ipynb`
Indoor–outdoor correlation analysis specific to the hospital scenario, accounting for the multi-area, multi-sensor structure of the deployment.
### `ESHOS01_VOC.ipynb`
Analysis of VOC speciation data from manual sampling campaigns in the hospital. Compares individual compound concentrations (CIEMAT format) against continuous sensor TVOC readings, computes indoor–outdoor VOC ratios, and identifies exceedances of compound-specific reference limits.
### `Forecasting_ES_HOS.ipynb`
Time-series forecasting of indoor air quality in the hospital. Models evaluated: ARIMA and Decision Tree Regressors with autoregressive features. Includes stationarity testing (ADF), lag plots, and autocorrelation analysis.
---
## Data Files
### Column structure — raw sensor files
All raw CSV files include the following columns:
| Column | Description | Units |
|---|---|---|
| `_time` | Measurement timestamp (~5 min native resolution) | UTC datetime |
| `sub_scenario` | Sub-scenario code (e.g., `HOM01`, `HOS01`, `MKT01`) | — |
| `area` | Area identifier (e.g., `HOS01005`) | — |
| `sensor_id` | Anonymised sensor identifier (SHA hash) | — |
| `co2` | Indoor CO₂ | ppm |
| `formaldehyde` | Indoor formaldehyde | µg/m³ |
| `humidity` | Indoor relative humidity | % |
| `pm1` | Indoor PM₁ | µg/m³ |
| `pm10` | Indoor PM₁₀ | µg/m³ |
| `pm25` | Indoor PM₂.₅ | µg/m³ |
| `temperature` | Indoor temperature | °C |
| `tvocs` | Indoor total VOCs | ppb |
| `out_co` | Outdoor CO | mg/m³ |
| `out_humidity` | Outdoor relative humidity | % |
| `out_no2` | Outdoor NO₂ | µg/m³ |
| `out_o3` | Outdoor O₃ | µg/m³ |
| `out_pm10` | Outdoor PM₁₀ | µg/m³ |
| `out_pm25` | Outdoor PM₂.₅ | µg/m³ |
| `out_so2` | Outdoor SO₂ | µg/m³ |
| `out_temperature` | Outdoor temperature | °C |
Outdoor values are shared across all sensors in the same area. Missing values are represented as empty cells.
### Additional columns in `_filtered_data` files
Files with the `_filtered_data` suffix contain the same columns as the raw version, plus the following derived time decomposition fields appended at the end:
| Column | Description |
|---|---|
| `Weekday` | Day of the week (e.g., `Friday`) |
| `Hour` | Hour of the day (0–23) |
| `Day` | Day of the month (1–31) |
| `Month` | Month (1–12) |
| `Year` | Year |
| `Month_day` | Day of the year (1–366) |
### File inventory
| File | Period | Scenario | Notes |
|---|---|---|---|
| `ESHOM_2023-03-01_2024-09-04.csv` | Mar 2023 – Sep 2024 | Homes | Raw |
| `ESHOM_2023-03-01_2024-09-04_filtered_data.csv` | Mar 2023 – Sep 2024 | Homes | Filtered + time columns |
| `ESHOM_2023-03-01_2025-06-20.csv` | Mar 2023 – Jun 2025 | Homes | Raw |
| `ESHOM_2023-10-01_2025-01-13.csv` | Oct 2023 – Jan 2025 | Homes | Raw |
| `ESHOM_2023-10-01_2025-01-13_filtered_data.csv` | Oct 2023 – Jan 2025 | Homes | Filtered + time columns |
| `ESHOS_2023-03-01_2024-03-13.csv` | Mar 2023 – Mar 2024 | Hospital | Raw |
| `ESHOS_2023-03-01_2024-04-24.csv` | Mar 2023 – Apr 2024 | Hospital | Raw |
| `ESHOS_2023-10-01_2024-06-06.csv` | Oct 2023 – Jun 2024 | Hospital | Raw |
| `ESHOS_2024-01-01_2024-11-01.csv` | Jan–Nov 2024 | Hospital | Raw |
| `ESHOS_2024-01-01_2024-11-01_filtered_data.csv` | Jan–Nov 2024 | Hospital | Filtered + time columns |
| `ESMKT_2024-01-01_2024-11-01.csv` | Jan–Nov 2024 | Market | Raw |
| `ESMKT_2024-07-26_2025-02-12.csv` | Jul 2024 – Feb 2025 | Market | Raw |
Multiple overlapping files for the same scenario represent different extraction windows used at different stages of analysis; they are not exact duplicates.
---
## Requirements
Python 3.10+. Main dependencies:
```
pandas, numpy, matplotlib, seaborn, scipy, scikit-learn,
statsmodels, tensorflow, openpyxl
```
---
## License
Copyright (C) 2021–2026 Advanced Computing Spain SL – BULL.
Released under the **GNU General Public License v3.0**.
See <https://www.gnu.org/licenses/> for the full text.
---
## Acknowledgements
This work was carried out within the K-HEALTHinAIR project, funded by the European Union. Views expressed are those of the authors only and do not necessarily reflect those of the European Union or the funding agency.
Files
Spanish pilot.zip
Additional details
Funding
Software
- Programming language
- Python