Skip to content

iareARiES/Rainfall_Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

β˜‚οΈ Rainfall Prediction Using Machine Learning 🌧️

πŸ“– Important Note

For a better understanding of the project, please check the Google Colab file πŸ“„ uploaded in this repository. It contains detailed explanations and execution steps to help you grasp the workflow more effectively.

This repository contains a machine learning model that predicts rainfall based on various weather parameters. The model is built using a Random Forest Classifier and is fine-tuned using GridSearchCV to optimize performance. πŸ‘©β€πŸ’»πŸŒ

🌟 Features

  • πŸ“Š Data preprocessing, including handling missing values and encoding categorical data
  • πŸ“Š Exploratory Data Analysis (EDA) with visualization
  • 🎨 Model training and hyperparameter tuning
  • ⚑️ Downsampling to handle class imbalance
  • πŸ”’ Model evaluation using accuracy, confusion matrix, and classification report
  • πŸ“Š Prediction on new data inputs
  • πŸ“‚ Model serialization using pickle for later use

πŸ› οΈ Requirements

Make sure you have the following dependencies installed:

pip install numpy pandas matplotlib seaborn scikit-learn

πŸ’ͺ Usage

  1. Clone the repository:
    git clone https://github.com/yourusername/rainfall-prediction.git
    cd rainfall-prediction
  2. Run the model training script:
    python rainfall_prediction.py
  3. Load and use the saved model:
    import pickle
    import pandas as pd
    
    with open("rainfall_prediction_model.pkl", "rb") as file:
        model_data = pickle.load(file)
    
    model = model_data["model"]
    feature_names = model_data["feature_names"]
    
    input_data = (1015.9, 19.9, 95, 81, 0.0, 40.0, 13.7)
    input_df = pd.DataFrame([input_data], columns=feature_names)
    prediction = model.predict(input_df)
    print("Prediction result:", "β˜”οΈ Rainfall" if prediction[0] == 1 else "🌞 No Rainfall")

πŸ† License

This project is open-source and available under the MIT License. πŸ’Ž

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published