This repository contains a project that predicts global temperatures based on latitude, longitude, year, month, day, latitude direction (north or south), and longitude direction (east or west) using a Logistic Regression model. The project includes data exploration, feature engineering, and a web application for temperature prediction.
- Dataset
- Project Structure
- Getting Started
- Exploratory Data Analysis (EDA)
- Feature Engineering
- Model Training
- Web Application
- Deployment
- Usage
- Contributing
- License
The dataset used in this project can be found on Kaggle: Global Temperature Dataset. The dataset provides historical temperature data for major cities.
- data/
- GlobalLandTemperaturesByMajorCity.csv
- notebooks/
- EDA.ipynb
- FeatureEngineering.ipynb
- src/
- model.py
- app.py
- requirements.txt
- README.md
data/
: Contains the dataset used in the project.notebooks/
: Jupyter notebooks for data exploration and feature engineering.src/
: Source code for the model and web application.requirements.txt
: A list of Python dependencies required for the project.
To run this project locally, follow these steps:
- Clone this repository to your local machine.
- Install the required dependencies listed in
requirements.txt
usingpip install -r requirements.txt
.
The EDA notebook (notebooks/EDA.ipynb
) explores the dataset, visualizes key trends, and identifies patterns in the temperature data.
The Feature Engineering notebook (notebooks/FeatureEngineering.ipynb
) outlines the process of selecting and creating relevant features for the temperature prediction model.
The model for temperature prediction is implemented in src/model.py
. It uses Logistic Regression for prediction. The choice of this model is based on its performance as indicated by the R2 score.
A web application for temperature prediction is created using Streamlit and can be found in src/app.py
. Users can input latitude, longitude, year, month, day, latitude direction (north or south), and longitude direction (east or west) to get a temperature prediction.
The web application is deployed on back4app. You can access it here.
- Visit the deployed website: Global Temperature Prediction.
- Enter the required values (latitude, longitude, year, month, day, latitude direction, and longitude direction).
- Click the "Predict Temperature" button to get the temperature prediction.
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your fork.
- Create a pull request to the
main
branch of this repository.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to customize this README to provide more specific details about your project, its goals, and any additional information you think would be helpful for users and contributors.