Authors: Molly Kessler, Daisy Zhou, Ojasv Issar, Jacob Cann
This project applies a regression algorithm to a data set of daily average land temperature of the Earth from January 1800 through July 2022 to predict the daily average land temperature of the Earth in the near future.
This project has four code components. First, we read in the data from the online source and applied appropriate formatting to get the data into a table (i.e. removed the extensive metadata header). Second, we preprocessed the data, including setting data for the years 2013-2022 aside to be our test dataset. Third, we performed exploratory data analysis on the training data. We observed a clear increasing trend in the mean daily land temperature from 1880 to 2012, suggesting that a linear model could generalize to future unseen years. To ensure that the trend was not seasonal or isolated to specific months (i.e. only the summers were increasing, while winters were staying the same), we created faceted plots by month which confirmed that the increasing pattern persisted across all months. Lastly, the density plots at selected time points (1880, 1960, 2012) show a clear shift towards a higher mean daily land temperatures over time, with very little overlap between the daily mean land temperatures of 1880 and those of 2012.
Lastly, using our training data (1880 - 2012), we further preprocessed our data and trained our model. As part of our model preprocessing, we converted daily temperature anomalies into yearly averages to capture long-term trends and remove noise from short-term and seasonal fluctuations. First, we compared Linear Regression, Random Forest, and Support Vector Regressor (SVR) models on the following metrics: RMSE, MAE and R². The SVR model performed the best out of the three, so we proceeded with SVR with default hyperparameters. Lastly, we used our model to forecast the global land-average temperature in 2030, which our model predicted will be about 10.56 °C., 2 °C warmer than average of the baseline period (1951 and 1980) and a clear continuation of the observed warming trend.
The data set for this project was published by Berkeley Earth under a Creative Commons BY-NC 4.0 International license, free for non-commercial use, and accessed by our team compliant with the conditions in this license on November 18, 2025. The raw data can be found here.
The data set contains 5 columns with time series information, and one column representing the temperature difference relative to the average temperature between January 1951 and December 1980, which they calculated as 8.59 +/- 0.05. For our analysis, we preprocessed the data to get the raw temperature readings back by adding 8.59 to each entry in the Anomaly column. All temperatures are in Celcius.
All software dependencies for this project are managed using Docker. You can build and run the project directly inside the Docker container. This ensures a consistent and reproducible environmenyt across all systems. To install the relevant dependencies, follow the instructions in the Setup Environment section below.
This section describes how to set up the environment, run the full analysis pipeline, execute tests, and render the final report.
-
Ensure Docker and Docker Compose are installed on your machine.
-
Clone this GitHub repository to your local machine.
-
Open a command line interface (e.g., Terminal) and navigate to the root of this repository.
Start the multi-container application using Docker Compose:
docker compose upAfter the Docker image is built and the container starts, look for a URL in the terminal that looks like:
http://127.0.0.1:8888/lab?token=...
This appears after the line:
Or copy and paste one of these URLs
Copy and paste this URL into your browser to launch JupyterLab.
If the page asks for a password or token, port 8888 may already be in use.
To fix this:
- Stop and remove the current Docker instance:
docker compose rm- Open
docker-compose.ymland change the port to an available one (e.g., 8887 or 8889):
ports:
- "{8888}:8888"- Restart Docker:
docker compose upThen open the updated URL:
http://127.0.0.1:{8888}/lab?token=...
(Replace {8888} with the port you selected.)
Once Docker launches successfully, you will be in a local JupyterLab instance.
Navigate to:
global_daily_land_temperature_prediction.qmd
to explore the interactive analysis.
This project uses a Makefile to run the full analysis pipeline and generate all required intermediate files.
To reset the project to a clean state (i.e., remove all generated files), run:
make cleanTo run the full analysis from start to finish, run:
make allIf you prefer to run the analysis step-by-step, ensure you are in the project root:
pwdThen run the scripts in the following order.
python scripts/read_data.py \
"https://berkeley-earth-temperature.s3.us-west-1.amazonaws.com/Global/Complete_TAVG_daily.txt" \
"data/global_temp_anomaly_raw.csv"Arguments:
- input path (URL or local file)
- output path for the raw data
python scripts/data_preprocessing.py \
--read_path="data/global_temp_anomaly_raw.csv" \
--write_path="data/global_temp_anomaly_cleaned" \
--plots_path="images" \
--logs_path="logs"Arguments:
- path to raw data
- output path for cleaned and split data
- directory for plots
- directory for logs
python scripts/abstract_eda.py \
data/global_temp_anomaly_cleaned_train.csv \
images/eda.pngArguments:
- cleaned training data
- output path for figures and tables
python scripts/ml_modelling.py \
--input_path data/global_temp_anomaly_cleaned_full.csv \
--output_dir results \
--cutoff_year 2012Arguments:
- cleaned full dataset
- output directory for results
- cutoff year for train/test split
make all before running pytest.
Some tests depend on files generated during the make all step.
make all
pytestRunning:
make clean
pytestwill cause tests to fail because required generated files are missing.
After cleaning, always run:
make all
pytestTo render the Quarto document as an HTML file, run the following command from the reports/ folder:
quarto render global_daily_land_temperature_prediction.qmdThe rendered file will appear as:
global_daily_land_temperature_prediction.html
To view the report:
- Exit Docker
- Navigate to the local repository
- Open the HTML file in your preferred browser
Note: Viewing the HTML inside Docker may cause formatting issues. To generate a PDF, render to HTML first, open it locally, and save the page as a PDF.
When finished:
- Return to the Terminal running Docker
- Press
CTRL + Cto stop JupyterLab - Remove the Docker instance:
docker compose rmconda(version 25.9.1)conda-lock(version 3.0.4)
- Create and switch to a new GitHub branch by running the following command in the terminal
git checkout -b new-branch-name-
Open the
environment.ymlfile and add the new dependencies -
To update the
conda-linux-64.lockfile, run the following command in the terminal
conda-lock -k explicit --file environment.yml -p linux-64- Remember to rebuild the Docker image locally and make sure it runs locally with
docker compose up-
To make sure the Docker image builds properly, check GitHub Actions on GitHub.com. Ensure the latest Docker image published sucessfully with a green check icon (note: it will take up to 10 minutes for the Docker image to build).
-
Run
git add modified_file_nameto add all of the files with edits (e.g. environment.yml). Next, run
git commit -m 'add new dependencies'to commit your changes with a meaningful commit message. Lastly, run
git push -u origin new-branch-nameto push your local changes to the GitHub repo.
- Create a new pull request in GitHub and merge the changes to the
mainbranch after review.
The Predicting Daily Land Average Earth Temperature report contained herein are licensed under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License. See the license file for more information. If re-using/re-mixing please provide attribution and link to this webpage. The software code contained within this repository is licensed under the MIT license. See the license file for more information.