# Hyperlocal Temperature and Humidity Prediction Using Supervised Machine Learning

**Authors:** Lyuboslav Gigov (Computer Science Department, American University in Bulgaria, Blagoevgrad, Bulgaria); Narasimha Rao Vajjhala (Computer Science Department, American University in Bulgaria, Blagoevgrad, Bulgaria) — ORCID 0000-0002-8260-2392; Anton Stoilov (Computer Science Department, American University in Bulgaria, Blagoevgrad, Bulgaria)
**Type:** Conference paper
**Source:** 2025 2nd Global AI Summit – International Conference on Artificial Intelligence and Emerging Technology (AI Summit), pp. 940–945, IEEE
**Published:** 2025
**DOI:** https://doi.org/10.1109/AISummit66170.2025.11411099
**Canonical page:** https://www.narasimharao.net/research/hyperlocal-weather-temperature-humidity-prediction-machine-learning/
**Indexing:** Scopus
**Keywords:** artificial intelligence; machine learning; weather prediction; regression analysis; hyperlocal weather forecasting; temperature prediction; humidity prediction

## Summary

**Question.** Which supervised machine learning regression model – linear, polynomial, decision tree or random forest – best predicts daily average temperature and relative humidity at a hyperlocal (city) level, balancing accuracy and computational cost?

**Finding.** Using ten years of daily Open-Meteo data (July 2015–July 2025) for Sofia, Berlin and Tokyo with a chronological 7:3 train/test split, linear regression and random forest were statistically equivalent for temperature (R² > 0.994), but linear regression ran faster (0.001 s vs 0.022–0.040 s). For humidity, linear regression was clearly best (R² 0.940–0.964) ahead of random forest (R² 0.913–0.933), while decision trees performed worst (R² 0.741–0.814).

**Why it matters.** The results challenge the assumption that complex ensemble methods are necessary for accurate weather prediction: model selection should prioritize the relationship structure in the data rather than algorithmic complexity. Fast, accurate linear models suit precision agriculture, smart city infrastructure, event planning and resource-constrained IoT deployments where real-time predictions are essential.

## Key findings

1. The study trained linear, polynomial, decision tree and random forest regression models on ten years of daily weather data (1 July 2015 to 1 July 2025) for Sofia, Berlin and Tokyo, using a chronological 7:3 train/test split.
2. For Sofia temperature prediction, linear regression achieved R² = 0.994, MAE = 0.510 and RMSE = 0.648 on the test set.
3. For Berlin temperature prediction, linear regression (R² = 0.996, RMSE = 0.508) slightly outperformed random forest (R² = 0.995, RMSE = 0.527), while random forest took about 0.021 s versus 0.001 s.
4. For Tokyo temperature prediction, linear regression and random forest both reached R² = 0.997, with linear regression achieving the lowest MAE (0.325) and RMSE (0.445).
5. For relative humidity, linear regression achieved R² of 0.940 (Sofia), 0.959 (Berlin) and 0.964 (Tokyo), outperforming random forest (0.913, 0.933 and 0.923) and decision trees (0.785, 0.814 and 0.741).
6. Polynomial regression reached R² ≥ 0.9 for temperature in all three cities, well above the R² ≈ 0.5 reported in earlier temperature forecasting studies, though Tokyo humidity required a 4th-order polynomial.
7. The authors conclude that ensemble methods do not guarantee improved accuracy and that model selection should prioritize the relationship structure in the data rather than algorithmic complexity.

## Study at a glance

| Item | Detail |
|---|---|
| Research question | Which regression model best predicts hyperlocal average temperature and relative humidity? |
| Design | Comparative experiment of four supervised regression models across three climatically diverse cities |
| Data | Daily historical weather data, 1 July 2015 to 1 July 2025, from Open-Meteo's Historical Weather API for Sofia, Berlin and Tokyo |
| Methods | Linear, polynomial, decision tree and random forest regression; forward fill, Z-score outlier removal, min-max scaling; 7:3 chronological split; grid-search tuning; R², MAE, RMSE and execution time |
| Main result | Linear regression matched random forest for temperature (R² 0.994–0.997) and beat it for humidity (R² 0.940–0.964 vs 0.913–0.933) while running faster |
| Implication | Simpler models can outperform ensembles when relationships are largely linear, favoring efficient real-time deployment |

## Abstract

Machine learning offers computationally efficient alternatives to traditional numerical weather prediction (NWP) models and global forecasting systems (GFS), which struggle with high computational costs and coarse spatial resolution. This study focuses on hyperlocal weather prediction, comparing linear regression (LR), polynomial regression (PR), decision tree regression (DTR), and random forest regression (RFR) for forecasting average temperature and relative humidity. Using ten years of historical data (2015-2025) from Sofia, Berlin, and Tokyo, we achieved substantial predictive accuracy across climatically diverse regions. For temperature prediction, linear regression and random forest demonstrated statistically equivalent performance (R² > 0.994), with linear regression achieving faster execution times (0.001s vs 0.022-0.040s). For humidity prediction, linear regression demonstrated clear superiority (R² > 0.940) over random forest (R² 0.913-0.933), while decision trees showed the poorest performance (R² 0.741-0.814). Decision trees performed competitively for temperature (R² 0.992-0.993) but struggled significantly with humidity's non-linear dynamics. These results demonstrate that model selection should prioritize the relationship structure in data rather than algorithmic complexity, with linear regression offering a balance of accuracy and computational efficiency. The findings of this study challenge the assumption that complex ensemble methods are necessary for accurate weather prediction, offering practical applications in precision agriculture, smart city infrastructure, event planning, and resource-constrained IoT deployments where real-time predictions are essential.

## Key terms

- **Hyperlocal weather prediction:** Forecasting weather conditions at a fine spatial scale such as a city or community, rather than the coarse grids (e.g. 15 km × 15 km) used by global forecasting systems.
- **Random forest regression:** An ensemble of decision trees trained on bootstrapped samples and random feature subsets whose predictions are averaged to give the final prediction.
- **Coefficient of determination (R²):** A measure of how much variance in the target is explained by the model, where values close to 1 indicate a near-perfect fit.

## Limitations

- Models were validated only with a standard 7:3 chronological train/test split; cross-validation (e.g. training on 2015–2018 and testing on 2024–2025) would improve robustness.
- No exploratory data analysis of feature and target distributions was performed to ensure optimal feature selection.
- Only four algorithms were tested; gradient boosted trees, k-nearest neighbors, LSTM and RNNs remain to be explored, along with real-time API-based input and in-depth error analysis by season or extreme events.

## How to cite

Gigov, L., Vajjhala, N. R., & Stoilov, A. (2025). Hyperlocal Temperature and Humidity Prediction Using Supervised Machine Learning. In 2025 2nd Global AI Summit – International Conference on Artificial Intelligence and Emerging Technology (AI Summit) (pp. 940–945). IEEE. https://doi.org/10.1109/AISummit66170.2025.11411099

```bibtex
@inproceedings{gigov2025hyperlocal,
  title = {Hyperlocal Temperature and Humidity Prediction Using Supervised Machine Learning},
  author = {Gigov, Lyuboslav and Vajjhala, Narasimha Rao and Stoilov, Anton},
  booktitle = {2025 2nd Global AI Summit – International Conference on Artificial Intelligence and Emerging Technology (AI Summit)},
  pages = {940--945},
  year = {2025},
  publisher = {IEEE},
  doi = {10.1109/AISummit66170.2025.11411099},
  url = {https://doi.org/10.1109/AISummit66170.2025.11411099}
}
```
