This project is classified as an Application/Web App with a significant Data Science/ML Project component. It appears to be an interactive web application built with Python, designed to showcase and serve machine learning models for weather forecasting.
Backend Technologies:
- Runtime: Python
- Web Framework: Streamlit (inferred from
app.pystructure and typical use cases for interactive ML apps, though Flask is also possible. Streamlit is a strong candidate for an interactive ML web application within a single Python file.) - Machine Learning Libraries:
scikit-learn(implied by.pklfiles for encoders and scalers, andpredictor.pklwhich is often a traditional ML model like RandomForest or XGBoost)TensorFlow/Keras(explicitly indicated byweather_model.h5)pandas(highly likely for data manipulation withinapp.py)numpy(highly likely for numerical operations withinapp.py)
- Serialization:
pickle(for.pklfiles)
DevOps & Tools:
- Scripting: Windows Batch (
run_app.bat), PowerShell (run_app.ps1) for local execution. - Package Management:
pip(fromrequirements.txt).
The repository has a flat structure, typical for a standalone Python application or a Streamlit app where all components reside at the root level.
- Entry Points:
app.py: The main Python script that contains the application logic, including the web interface and ML model integration.run_app.bat: A Windows batch script to easily execute the application.run_app.ps1: A PowerShell script to easily execute the application.
- Configuration Files:
requirements.txt: Lists all Python dependencies required to run the application.
- Source Code Organization:
app.pyappears to be a monolithic file containing both application logic and ML model loading/inference.
- ML Model & Data Assets:
district_encoder.pkl: A pickled object, likely aLabelEncoderorOneHotEncoderfor geographical districts.feature_columns.pkl: A pickled list or array defining the expected input features for the models.feature_scaler.pkl: A pickled object, likely aStandardScalerorMinMaxScalerfor preprocessing numerical features.predictor.pkl: A pickled trained machine learning model (e.g., a scikit-learn model like a Gradient Boosting Regressor or RandomForest).weather_model.h5: A trained deep learning model, saved in HDF5 format, typically from Keras/TensorFlow.
- Core Functionality: Provides AI-powered weather forecasting based on pre-trained machine learning models.
- Interactive Web Interface: Presents a user-friendly web interface (inferred, likely powered by Streamlit) for interacting with the forecasting system.
- Multiple ML Models: Utilizes at least two distinct machine learning models: a traditional ML model (
predictor.pkl) and a deep learning model (weather_model.h5), potentially for different aspects or types of predictions. - Automated Data Preprocessing: Incorporates necessary data transformation steps (feature scaling, categorical encoding) using pre-saved
feature_scaler.pklanddistrict_encoder.pkl. - Local Deployment: Designed for straightforward local execution via provided batch and PowerShell scripts.
- Package Manager:
pip(standard for Python). - Installation Commands:
pip install -r requirements.txt. - Build Process: No explicit build process for the application itself, as it's a Python script.
- Development Server Setup: Running
app.pydirectly usingstreamlit run app.py(if Streamlit) orpython app.py(if a generic Python web server). - Environment Requirements: A Python 3.x interpreter.
- Database Setup: No database detected.
- External Service Dependencies: No external API keys or services are explicitly mentioned or implied by the file structure (e.g., no
.envfile). The models are self-contained.
This repository hosts an innovative AI-powered weather forecasting application. Leveraging advanced machine learning and deep learning models, it provides local weather predictions through a user-friendly interface. The project integrates pre-trained models and robust data preprocessing pipelines to deliver accurate and efficient forecasts, making complex AI accessible for everyday use.
- 🎯 AI-Driven Forecasting: Utilizes sophisticated machine learning (e.g., scikit-learn based) and deep learning (Keras/TensorFlow based) models for precise weather predictions.
- ⚡ Interactive Web Interface: Provides a responsive and intuitive web application to input parameters and visualize forecasts instantly.
- ⚙️ Automated Data Preprocessing: Seamlessly handles feature scaling and categorical encoding using pre-trained transformers for consistent model inputs.
- 📦 Self-Contained Models: Includes all necessary pre-trained ML models and data transformers (
.pkl,.h5files) for immediate local execution. - 🚀 Easy Local Deployment: Designed for quick setup and execution on local machines with simple Python commands and helper scripts.
Follow these steps to get the AI Weather Forecasting application up and running on your local machine.
- Python 3.x: Ensure you have Python 3.8 or newer installed. You can download it from python.org.
-
Clone the repository
git clone https://github.com/abz-mhd/ai-weather-forecasting.git cd ai-weather-forecasting -
Install dependencies Use
pipto install all required Python packages:pip install -r requirements.txt
-
Start the application You can start the Streamlit application using one of the following methods:
Recommended (Streamlit):
streamlit run app.py
Using provided scripts (Windows):
# For Command Prompt / PowerShell .\run_app.bat # For PowerShell .\run_app.ps1
Note: The
run_app.batandrun_app.ps1scripts are designed for Windows environments. -
Open your browser Once the application starts, it will typically open in your default web browser at
http://localhost:8501. If it doesn't open automatically, navigate to this URL.
ai-weather-forecasting/
├── app.py # Main Streamlit application script
├── requirements.txt # Python dependencies
├── district_encoder.pkl # Pickled label encoder for districts
├── feature_columns.pkl # Pickled list of feature columns for models
├── feature_scaler.pkl # Pickled scaler for numerical features
├── predictor.pkl # Pickled traditional machine learning model
├── weather_model.h5 # Keras/TensorFlow deep learning model
├── run_app.bat # Windows batch script to run the app
├── run_app.ps1 # PowerShell script to run the app
└── README.md # Project README file
This project does not currently rely on external environment variables. All configurations and model assets are self-contained within the repository.
requirements.txt: Defines the Python package dependencies for the project..pkland.h5files: Contain the trained machine learning models and data preprocessing objects. These are loaded directly byapp.py.
The primary way to run the application for development is:
| Command | Description |
|---|---|
streamlit run app.py |
Starts the Streamlit development server and opens the application in your browser. |
python -m pip install -r requirements.txt |
Installs or updates all project dependencies. |
To contribute or modify the application:
- Ensure prerequisites are met and dependencies are installed.
- Make changes to
app.pyor update model files. - Run
streamlit run app.pyto test your changes live. The Streamlit server supports hot-reloading for rapid development.
The application is designed for local deployment and can be run by simply executing the app.py script via streamlit run or the provided platform-specific helper scripts. For production environments, you might consider containerizing the application with Docker or deploying to a cloud platform that supports Streamlit applications.
We welcome contributions! If you have suggestions for improving the weather forecasting models, enhancing the UI, or optimizing the code, please feel free to:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a Pull Request.
This project currently does not have an explicit license specified. Please add a LICENSE file if you intend to share this project under a specific open-source license.
- Python Community: For the versatile programming language.
- Streamlit: For providing an excellent framework for building interactive data apps.
- scikit-learn: For robust machine learning tools.
- TensorFlow & Keras: For powerful deep learning capabilities.
- Pandas & NumPy: For efficient data manipulation and numerical operations.
- 🐛 Issues: If you find any bugs or have feature requests, please report them on GitHub Issues.
- 👤 Author: abz-mhd
⭐ Star this repo if you find it helpful!
Made with ❤️ by abz-mhd