Skip to content

DanielWill-1/bayesian-network-project

Repository files navigation

🌦️ Weather Prediction using Bayesian Networks and PyTorch

This project predicts weather parameters (like humidity, rainfall, etc.) using both Bayesian Networks (pgmpy) and Neural Networks (PyTorch). It includes MLflow for experiment tracking and Prometheus for monitoring.


📁 Dataset


📌 Features Used

  • MinTemp, MaxTemp, Rainfall, WindGustSpeed, WindSpeed9am, WindSpeed3pm
  • Humidity9am, Humidity3pm, Pressure9am, Pressure3pm
  • Temp9am, Temp3pm, RainToday, RainTomorrow

🧠 Models Implemented

1. Bayesian Network (via pgmpy)

  • Learns structure using HillClimbSearch
  • Parameters via MaximumLikelihoodEstimator
  • Predicts missing values

2. PyTorch Neural Network

  • Multi-layer Feedforward Network
  • Hyperparameter tuning using K-Fold Cross-Validation
  • Tracks best hyperparameters and MSE

🚀 How to Run

pip install -r requirements.txt

python newBayesian.py

mlflow ui --port 5000

Visualizations

Correlation Matrix

Feature Distributions

Prediction vs Actual Plots

Error Histograms


Tech Stack

Python 🐍

PyTorch 🔥

pgmpy 📊

MLflow 🧪

Prometheus 📡

Pandas, NumPy, Seaborn, Scikit-Learn


Fork

feel free to fork and made changes to this code


About

small project on bayesian network for weather prediction project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published