Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

FouadElOuafy/air-quality-morocco

Domain:

environment and energy

Record type:

software
Creator:
Fou
Host:
# 🌍 Air Quality Prediction in Moroccan Cities ## 📋 Description Application web Full Stack de prédiction de la qualité de l'air (PM2.5) dans les villes marocaines, utilisant le Machine Learning et des données météo réelles collectées via l'API OpenWeatherMap. ## 🏗️ Architecture Frontend (React) ←→ Backend (Flask API) ←→ Modèles ML (.pkl) ↕ OpenWeatherMap API ## 🛠️ Technologies | Composant | Technologie | |-----------|-------------| | Frontend | React + Vite + Recharts | | Backend | Flask + Flask-CORS | | ML | scikit-learn (Random Forest, Linear Regression) | | Data | pandas, numpy, MinMaxScaler | | API | OpenWeatherMap | ## 📊 Modèles ML | Modèle | MAE | RMSE | R² | |--------|-----|------|----| | Random Forest | 1.09 | 1.62 | 0.45 | | Linear Regression | 1.09 | 1.62 | 0.46 | ## 🗂️ Structure du projet air-quality-project/ ├── data/ │ ├── raw_data.csv # Données brutes (480 lignes) │ └── clean_data.csv # Données nettoyées ├── models/ │ ├── random_forest.pkl │ └── linear_regression.pkl ├── notebooks/ │ └── analysis.ipynb # Analyse exploratoire ├── results/ │ └── graphs.png ├── src/ │ ├── collect_data.py # Collecte API OpenWeatherMap │ ├── preprocess.py # Nettoyage et normalisation │ ├── train_model.py # Entraînement ML │ ├── federated.py # Simulation Federated Learning │ └── app.py # API Flask ├── frontend/ │ └── src/ │ ├── App.jsx │ └── components/ │ ├── PredictionForm.jsx │ ├── ResultCard.jsx │ └── Dashboard.jsx └── README.md ## 🚀 Installation et lancement ### Prérequis - Python 3.11+ - Node.js 18+ ### Backend (Flask) ```bash # Créer environnement virtuel python -m venv venv .\venv\Scripts\Activate.ps1 # Windows source venv/bin/activate # Linux/Mac # Installer dépendances pip install flask flask-cors scikit-learn pandas numpy joblib requests # Lancer l'API python src/app.py ``` ### Frontend (React) ```bash cd frontend npm install …

Visit

github.com