Skip to content

abz-mhd/ai-weather-forecasting

Repository files navigation

🔍 DEEP CODE ANALYSIS

1. Repository Classification

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.

2. Technology Stack Detection

Backend Technologies:

  • Runtime: Python
  • Web Framework: Streamlit (inferred from app.py structure 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 .pkl files for encoders and scalers, and predictor.pkl which is often a traditional ML model like RandomForest or XGBoost)
    • TensorFlow/Keras (explicitly indicated by weather_model.h5)
    • pandas (highly likely for data manipulation within app.py)
    • numpy (highly likely for numerical operations within app.py)
  • Serialization: pickle (for .pkl files)

DevOps & Tools:

  • Scripting: Windows Batch (run_app.bat), PowerShell (run_app.ps1) for local execution.
  • Package Management: pip (from requirements.txt).

3. Project Structure Analysis

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.py appears 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 a LabelEncoder or OneHotEncoder for 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 a StandardScaler or MinMaxScaler for 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.

4. Feature Extraction

  • 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.pkl and district_encoder.pkl.
  • Local Deployment: Designed for straightforward local execution via provided batch and PowerShell scripts.

5. Installation & Setup Detection

  • 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.py directly using streamlit run app.py (if Streamlit) or python 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 .env file). The models are self-contained.

🚀 AI Weather Forecasting

GitHub stars GitHub forks GitHub issues GitHub license

An interactive, AI-powered web application for local weather forecasting.

📖 Overview

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.

✨ Features

  • 🎯 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, .h5 files) for immediate local execution.
  • 🚀 Easy Local Deployment: Designed for quick setup and execution on local machines with simple Python commands and helper scripts.

🖥️ Screenshots

Screenshot of the AI Weather Forecasting application

Screenshot of the AI Weather Forecasting application on mobile

🛠️ Tech Stack

Backend & AI: Python Streamlit scikit-learn TensorFlow Keras Pandas NumPy

🚀 Quick Start

Follow these steps to get the AI Weather Forecasting application up and running on your local machine.

Prerequisites

  • Python 3.x: Ensure you have Python 3.8 or newer installed. You can download it from python.org.

Installation

  1. Clone the repository

    git clone https://github.com/abz-mhd/ai-weather-forecasting.git
    cd ai-weather-forecasting
  2. Install dependencies Use pip to install all required Python packages:

    pip install -r requirements.txt
  3. 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.bat and run_app.ps1 scripts are designed for Windows environments.

  4. 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.

📁 Project Structure

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

⚙️ Configuration

Environment Variables

This project does not currently rely on external environment variables. All configurations and model assets are self-contained within the repository.

Configuration Files

  • requirements.txt: Defines the Python package dependencies for the project.
  • .pkl and .h5 files: Contain the trained machine learning models and data preprocessing objects. These are loaded directly by app.py.

🔧 Development

Available Scripts

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.

Development Workflow

To contribute or modify the application:

  1. Ensure prerequisites are met and dependencies are installed.
  2. Make changes to app.py or update model files.
  3. Run streamlit run app.py to test your changes live. The Streamlit server supports hot-reloading for rapid development.

🚀 Deployment

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.

🤝 Contributing

We welcome contributions! If you have suggestions for improving the weather forecasting models, enhancing the UI, or optimizing the code, please feel free to:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add new feature').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Open a Pull Request.

📄 License

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.

🙏 Acknowledgments

  • 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.

📞 Support & Contact

  • 🐛 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

About

An AI‑powered weather forecasting system that uses machine learning models to predict temperature, humidity, and climate patterns based on historical weather data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages