https://github.com/sreejabethu/forecasting-weather
Weather Forecasting using OpenWeatherMap API and Random Forest Regressor in Python. Converts temperature data to Fahrenheit, and provides visualizations for actual vs predicted temperatures.
https://github.com/sreejabethu/forecasting-weather
api matplotlib openweathermap-api plotly-python python random-forest regression-analysis visualization weather-forecast
Last synced: 24 days ago
JSON representation
Weather Forecasting using OpenWeatherMap API and Random Forest Regressor in Python. Converts temperature data to Fahrenheit, and provides visualizations for actual vs predicted temperatures.
- Host: GitHub
- URL: https://github.com/sreejabethu/forecasting-weather
- Owner: SreejaBethu
- License: mit
- Created: 2024-07-13T23:06:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T18:16:45.000Z (over 1 year ago)
- Last Synced: 2025-03-21T12:57:35.784Z (about 1 year ago)
- Topics: api, matplotlib, openweathermap-api, plotly-python, python, random-forest, regression-analysis, visualization, weather-forecast
- Language: Python
- Homepage:
- Size: 110 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Forecasting-Weather
This project leverages the OpenWeatherMap API and machine-learning techniques to forecast weather temperatures. The project uses historical weather data to train a Random Forest Regressor model, which predicts future temperatures. The forecasted temperatures are converted to Fahrenheit for ease of understanding. The project also provides visualizations to compare actual vs predicted temperatures, allowing for model evaluation and improvement.
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Project Structure](#project-structure)
- [License](#license)
### Features
**Weather Data Retrieval:** Retrieves historical weather data from the OpenWeatherMap API.
**Temperature Conversion:** Converts temperature data from Celsius to Fahrenheit for ease of understanding.
**Random Forest Regressor:** Trains a Random Forest Regressor model on historical weather data to predict future temperatures.
**Visualization:** Provides visualizations to compare actual vs predicted temperatures, allowing for model evaluation and improvement.

## Installation
Prerequisites
Python 3.x
Pip (Python package installer)
Libraries
**You will need the following Python libraries:**
requests
pandas
numpy
scikit-learn
matplotlib
## Project Structure
**data**: Contains the historical weather data retrieved from the OpenWeatherMap API
**models**: Holds the trained Random Forest Regressor model
**src**: Contains the source code for the weather forecasting system
**utils**: Holds utility functions for data preprocessing, feature engineering, and visualization
**visualizations**: Contains the visualizations comparing actual vs predicted temperatures
You can install these libraries using pip: **pip install requests pandas numpy scikit-learn matplotlib**
## Run the script
You can run the script from the command line or terminal: python weather_forecast.py
## Set up your environment
Make sure you have Python installed on your machine. You can download it from **python.org**.
- Get your OpenWeatherMap API key
- Sign up at OpenWeatherMap to get a free API key.
- Update the script
- Open the weather_forecast.py file and replace 'your_api_key' and 'your_city' with your actual OpenWeatherMap API key and city name.
## License