Skip to content

ajegetina/temperature-predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌦️ London Weather Predictor

This project predicts London’s daily temperature using machine learning.
It follows a structured ML workflow with EDA, data cleaning, model training, and experiment tracking with MLflow.


📂 Project Structure


london-weather-predictor/
├── data/
│   ├── raw/                # Original datasets
│   │   └── london\_weather.csv
│   ├── clean/              # Processed/clean datasets
│   │   └── london\_weather\_clean.csv
│   └── mlruns/             # MLflow experiment logs
├── notebooks/
│   ├── eda.ipynb           # Data exploration and cleaning
│   └── train.ipynb         # Model training & evaluation
├── src/
│   └── data/
│       └── clean.py        # Data cleaning script
└── README.md


⚙️ Setup

  1. Clone this repo:

    git clone https://github.com/joseph-ajegetina/london-weather-predictor.git
    cd london-weather-predictor```
    
  2. Create a virtual environment and install dependencies:

    python -m venv venv
    source venv/bin/activate   # On Linux/Mac
    venv\Scripts\activate      # On Windows
    
    pip install -r requirements.txt
  3. Make sure the dataset is in data/raw/london_weather.csv.


🧹 Data Cleaning

Run the cleaning script to generate the processed dataset:


📊 Notebooks

  • EDA: explore dataset, visualize trends, and verify missing values

    jupyter notebook notebooks/eda.ipynb
  • Training: train and evaluate models with MLflow tracking

    jupyter notebook notebooks/train.ipynb

🧪 Experiment Tracking (MLflow)

MLflow logs are stored in:

data/mlruns/

Start MLflow UI

mlflow ui --backend-store-uri file:data/mlruns

Open http://127.0.0.1:5000 to browse experiments.


🚀 Workflow

  1. EDA (eda.ipynb)

    • Explore dataset (trends, correlations, missing values)
    • Feature selection & preprocessing
  2. Training (train.ipynb)

    • Train multiple models:
      • Linear Regression
      • Decision Tree Regressor
      • Random Forest Regressor
    • Evaluate using RMSE, MAE, R²
    • Log experiments with MLflow

📊 Example Outputs

Correlation Heatmap

Shows relationships between weather variables and mean temperature.

heatmap

Temperature Trend

Monthly average temperatures across years.

trend

ML Comparison

Metric value for the various models Metrics


🔧 Tech Stack

  • Python (pandas, numpy, matplotlib, seaborn, scikit-learn)
  • MLflow for experiment tracking
  • Jupyter Notebooks for development

📈 Next Steps

  • Add hyperparameter tuning (Grid/Random Search)
  • Try Gradient Boosting / XGBoost / LightGBM
  • Deploy best model as an API (FastAPI/Flask)

About

This project predicts London’s daily temperature using machine learning. It follows a structured ML workflow with EDA, data cleaning, model training, and experiment tracking with MLflow.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors