In this project, we'll predict the weather using the Facebook prophet algorithm. Prophet uses an additive model to add up seasonal effects and trends to make a prediction. The advantage of prophet is that it automatically identifies seasonality in the data - and weather data has strong seasonal effects. So without any feature engineering, you can get good baseline accuracy. It can also scale to multiple time series (think data from adjacent weather stations) easily.
By the end, we'll have a model that predicts the weather, and can be extended to improve accuracy.
Project Steps
- Load in and clean data
- Define targets and predictors
- Train model
- Scale model to entire dataset using cv
- Make future predictions
You can find the code for this project here
File overview:
predict.ipynb
- notebook to make predictions
To complete this project, you'll need to have a good understanding of:
- Python syntax, including functions, if statements, and data structures
- Data cleaning
- Pandas syntax
- Using Jupyter notebook
- APIs
- The basics of machine learning.
Please make sure you've completed these Dataquest courses (or know the material) before trying this project:
- Python Introduction
- For Loops and If Statements
- Dictionaries In Python
- Functions and Jupyter Notebook
- Python Intermediate
- Pandas and NumPy Fundamentals
- Data Cleaning
- Machine Learning Fundamentals
- APIs and Web Scraping
To follow this project, please install the following locally:
- Python 3.8+
- The packages defined in
requirements.txt
- It's recommended to use JupyterLab.
You can find the data for this project in the weather.csv
file. You can download the file here. Just click file -> save as in your browser to save the file.
If you want to download different data for your area, you can follow these instructions:
- Go to NOAA
- Enter the years you want data for (I recommend starting with 1970), and search for the closest airport to you
- Click add to cart on the airport you want
- Search for additional airports or cities and select them if you want additional data sources
- Go to the cart at https://www.ncdc.noaa.gov/cdo-web/cart
- Select the csv format and click continue
- Select all of the checkboxes for data types
- Enter your email and click continue
- You'll get an email with a link to download the data
- Make sure to take a look at the data documentation as well