Logo Lanfrica

AbdellahAjebli/morocco-flood-ai

Domain:

climate

Record type:

software
Creator:
Abd
Host:
# Morocco Flood Prediction AI An AI-powered system for predicting flood risks across Morocco using machine learning and weather data. ## 🎯 Project Overview This project provides a complete machine learning pipeline for: - **Data Collection**: Fetches historical and real-time weather data from Open-Meteo API - **Data Preprocessing**: Feature engineering for flood prediction - **Model Training**: Multiple ML models (Random Forest, XGBoost, LSTM) - **Prediction API**: REST API for real-time flood risk predictions ## 🌦️ Flood Risk Levels | Level | Label | Description | |-------|-------|-------------| | 0 | No Risk | Normal conditions | | 1 | Low Risk | Light precipitation expected | | 2 | Moderate Risk | Significant precipitation | | 3 | High Risk | Heavy rain, potential flooding | | 4 | Extreme Risk | Severe weather, high flood probability | ## πŸ“ Project Structure ``` morocco-flood-ai/ β”œβ”€β”€ configs/ β”‚ └── config.yaml # Configuration file β”œβ”€β”€ data/ β”‚ β”œβ”€β”€ raw/ # Raw weather data β”‚ β”œβ”€β”€ processed/ # Preprocessed data β”‚ └── models/ # Trained models β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ data/ β”‚ β”‚ β”œβ”€β”€ data_collector.py # Data collection module β”‚ β”‚ └── preprocessor.py # Data preprocessing β”‚ β”œβ”€β”€ models/ β”‚ β”‚ └── model.py # ML model definitions β”‚ └── utils/ β”‚ └── config.py # Configuration utilities β”œβ”€β”€ train.py # Training script β”œβ”€β”€ predict.py # Prediction module β”œβ”€β”€ api.py # FastAPI web API β”œβ”€β”€ demo.py # Demonstration script └── requirements.txt # Python dependencies ``` ## πŸš€ Quick Start ### 1. Install Dependencies ```bash cd morocco-flood-ai pip install -r requirements.txt ``` ### 2. Collect Data ```python from src.data.data_collector import MoroccoWeatherDataCollector collector = MoroccoWeatherDataCollector() df = collector.collect_all_historical( start_date="2020-01-01", end_date="2024-01-01", include_flood_z …