Back to Portfolio
Project Image

Predicting Next-Day Rainfall Using 10 Years of Weather Data

Developed a machine learning model to predict next-day rainfall using 10 years of historical weather data and supervised learning techniques. Performed data cleaning, preprocessing, feature engineering, and exploratory data analysis (EDA) to improve data quality and model performance. Trained and evaluated multiple classification models using Scikit-learn, comparing performance with Accuracy, Precision, Recall, F1-Score, and ROC-AUC.

Project Overview

Developed a machine learning model to predict whether it will rain the next day using 10 years of historical weather data. Collected and worked with weather data containing temperature, humidity, rainfall, wind speed, and pressure. Cleaned the dataset by handling missing values and removing duplicate records. Performed Exploratory Data Analysis (EDA) to understand the data and identify important weather patterns. Selected the most useful features for building the prediction model. Split the dataset into training and testing data for model evaluation. Built a Logistic Regression model to classify whether it will rain the next day. Trained the model using historical weather data and tested it on unseen data. Evaluated the model using Accuracy, Precision, Recall, F1-Score, and Confusion Matrix. Used Matplotlib and Seaborn to visualize the data and model results. Improved the model by tuning parameters and checking feature importance. Successfully predicted next-day rainfall and demonstrated how machine learning can support weather forecasting.

Technologies Used

Features

Sample Code



# find outliers for WindSpeed3pm variable

IQR = df.WindSpeed3pm.quantile(0.75) - df.WindSpeed3pm.quantile(0.25)
Lower_fence = df.WindSpeed3pm.quantile(0.25) - (IQR * 3)
Upper_fence = df.WindSpeed3pm.quantile(0.75) + (IQR * 3)
print('WindSpeed3pm outliers are values < {lowerboundary} or > {upperboundary}'.format(lowerboundary=Lower_fence, upperboundary=Upper_fence))

GitHub Link