Jump to main content

Can Machine Learning Forecast Future Sea Levels?

Abstract

Global sea levels are rising, but modeling and predicting them can be challenging with more and more extreme weather events. Can we use machine learning to track and predict sea level changes? In this science project, you will use previously collected data and machine learning to see if you can predict future relative sea level changes. 

Summary

Areas of Science
Difficulty
Method
Time Required
Very Short (≤ 1 day)
Prerequisites

None

Material Availability

Readily available

Cost
Very Low (under $20)
Safety

No issues

Credits
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

To use a machine learning algorithm to predict future sea level changes.

Introduction

The world is constantly changing! In fact, there are large global changes that impact our environment, even though we may not always see or notice them directly. The large tectonic plates of the world are constantly shifting, and sometimes, when these plates slide by one another, we feel them as earthquakes when this occurs on land. Abnormal changes to our oceans are also taking place. Over land, extremely large glaciers and ice sheets are melting, and the water runs off into the ocean. Additionally, the water in the ocean is thermally expanding due to global warming. This increase in ocean levels significantly impacts coastlines. In fact, these changes can drastically change our coastal environments due to increased flooding, erosion, and destruction of wetland habitats. 

This image displays a dramatic comparison of the Antarctic landscape, showing significant ice melt between January and February 2020. The top panel, dated January 13, 2020, reveals a large section of snow and ice along a rocky coastline. The bottom panel, dated February 12, 2020, shows a noticeable reduction in the snow and ice cover, revealing more of the dark, rocky terrain and creating melt ponds on the ice sheet. This stark visual highlights the effects of a record heatwave on the region.Image Credit: European Union, Copernicus Sentinel-2 imagery / Creative Commons Attribution-Share Alike 4.0 International

A satellite image contrasts the effects of extreme temperatures on Antarctica. The two panels show the same coastal area one month apart. In the top panel (January 13, 2020), the land is largely covered by a thick layer of bright white snow and ice. In the bottom panel (February 12, 2020), the landscape is significantly different. The white ice has receded, exposing large areas of dark land. A clear increase in meltwater is also visible, appearing as vibrant blue patches on the remaining ice. The image serves as a powerful visual record of the rapid melting caused by a record heatwave.

Figure 1. Glacier ice in Antarctica is melting after a record heatwave, showing how ice cap melting impacts the oceans. 

Scientists are observing that most local relative sea levels (RSL) – the sea level measured relative to the land surface – are rising, and at the same time, there is a global increase in overall sea levels. How do we know that sea levels are rising? Scientists use instruments like satellite altimeters, which send radar signals to measure ocean height, and they also collect ocean temperature readings. These physical measurements can then be combined with physics-based models. If you've taken a physics class, you've probably seen how equations can be used to predict motion–like figuring out the path of a thrown ball or the speed of an accelerating car. In a similar way, scientists can write equations that describe how oceans and the atmosphere behave, and then use those equations to try to predict complex things like weather or sea level changes. However, predicting something as complicated as the entire ocean system is much harder than predicting where a ball will land!

That’s where machine learning can offer a different approach. Instead of relying on equations that describe the physics of the ocean, machine learning algorithms look at large amounts of past data (such as recorded sea levels and temperatures) and try to find patterns. Then they use those patterns to make predictions about the future. In other words, physics-based models explain why the system behaves the way it does, while machine learning models focus on making predictions directly from the data–even if they don’t explain the underlying physics of how the ocean is changing. 

In this science project, you will use a machine learning algorithm, the Prophet model, to predict future local relative sea level (RSL) changes at a specific U.S. tide gauge station. You will test whether the model can identify complex patterns in the historical data that are difficult to capture with physics-based equations, and explore how well it can make predictions of local sea level changes.

Watch this video to learn more about the Prophet model:




Terms and Concepts

Questions

Bibliography

To learn more about sea level trends:

To learn more about the Prophet model:

Materials and Equipment

Experimental Procedure

This project follows the Scientific Method. Review the steps before you begin.

Setting Up the Google Colab Environment

  1. You will need a Google account. If you do not have one, make one when prompted.
  2. Download the sea_level_prediction.ipynb file from Science Buddies. This is the code you will need to process your data. 
  3. Within your Google Drive, click on ‘MyDrive,’ then create a new folder and rename it sea_level_prediction. Inside the folder, upload the sea_level_prediction.ipynb file.
  4. Double-click on the sea_level_prediction.ipynb file. This should automatically open in Google Colab.
    1. Read the Troubleshooting Tips and How to Use This Notebook sections. Follow the instructions you find in that section.
    2. Run the block under Importing Libraries to ensure you have access to all the functions we will use for this project.

Collecting the Data

  1. Navigate to the NOAA Sea Level Trends page.
  2. Browse the table and choose a location you would like to use for your sea level prediction.
    1. Some locations have longer data records than others – for best results, pick one with at least 100 years of data. 
  3. Click the Station ID number (in the left column) for the location you selected. 
  4. On the station’s page, click “Export to CSV” under the graph to download the data file.
    1. Open the .csv file in Microsoft Excel or Google Sheets (the steps are the same for both).
    2. Select the first five cells by clicking on the first cell, holding shift on your keyboard, then clicking on the fifth cell (just before the column names). Right-click and choose Delete.
    3. Review the column headers and make sure there are no extra spaces before or after each column name. If you find any, remove them.
    4. Save the updated file.
  5. Rename the downloaded file to sea_level_predicton.csv.
  6. Upload this file to your sea_level_prediction folder in Google Drive.

Loading the Data into a Pandas DataFrame

  1. (Code Block 1A) Run this code block to create a DataFrame, like a table, that will be used to load and manipulate the data in the notebook. The data from your .csv file will populate a table below the code block.

Preprocessing

  1. (Code Block 2A) This code block creates a new column ds by combining the Month and Year columns, converting them into proper datetime objects. The Prophet model requires the input data to follow a specific format: the ds column must contain datestamps (time information). The ds column tells Prophet when each observation occurred, which is essential for building and projecting the time series model. Run this code block.
    1. Note: Since Month and Year are stored as integers, they must be converted to strings before forming a valid date string.
  2. (Code Block 2B) This code block sets the ds column as the DataFrame index for easier date-based operations and removes the now redundant Month and Year columns. Run this code block.

Visualizing the Data

Plotting the data before modeling with the Prophet model is important because it lets you visually inspect trends, seasonality, and anomalies in the time series. For example, you can see if the sea level generally rises over time, detect any recurring seasonal patterns, or spot outliers that might need cleaning. Understanding these characteristics helps you choose the right model settings in the Prophet model and anticipate how well the model may perform.

  1. (Code Block 3A) This code block creates a scatter plot of the Monthly_MSL column to visualize monthly sea level measurements over time. The plot allows you to quickly observe trends, seasonal patterns, and potential outliers, which is useful for understanding the data before building a time series model.
    1. Has the rate of sea level rise changed over the years? Does it seem to accelerate, slow down, or stay constant?
    2. Do you see any points that stand out as unusually high or low compared to the rest of the data? What might cause these anomalies?
    3. Based on what you see, what do you think might happen to sea levels in the next few decades?
  2. (Code Block 3B) This code block defines a function plot_msl_by_year_range that plots monthly sea level (Monthly_MSL) data for a chosen year range and overlays a 12-month rolling average to highlight long-term trends. Run this code block.
    1. A rolling average (or moving average) smooths the data by calculating the mean over a fixed window–in this case, 12 months–so short-term fluctuations are reduced, and underlying patterns become clearer.
  3. (Code Block 3C) Under the #TODO comment, you can choose the time range you want to analyze by setting values for start_year and end_year. This code block will generate a plot showing monthly sea level values within the chosen years, using the function defined in Code Block 3B.
    1. Example: start_year = 1900 and end_year = 1910 will display data from 1900 through 1910. 
  4. (Code Block 3D) This code block defines a function plot_msl_by_year that creates a line graph of monthly sea level (Montly_MSL) data for a single year. This lets you zoom in on the seasonal variation of sea level within one specific year. Run this code block.
  5. (Code Block 3E) Under the #TODO comment, you can choose a single year you want to analyze by setting the value of year.
    1. Example: year = 2010 will show sea level data for the year 2010 only.

Splitting the Data into Train and Test

  1. (Code Block 4A) Separating the Dataset into Inputs and Target: This code block separates the dataset into two parts:
    1. X contains all the feature columns except Monthly_MSL.
    2. y contains the Monthly_MSL column, which we will predict based on the other features.
  2. (Code Block 4B) Splitting the Training and Test Data: This code block splits the sea level dataset into training and testing sets based on a chosen date range. You can update the dates under the #TODO comment to control how much data is used for training and how far ahead you want to test.
    1. start_date: The first date to include in the training set.
    2. split_date: The cutoff date that separates training and testing. All data from start_date up to and including this date will be in the training set.
    3. end_date: The last date to include in the testing set. All data after the split_date up to and including this date will be in the testing set.
    4. By default, the training set will include all data from 1975-01-01 through 2000-01-01, and the testing set will include all data from 2000-01-01 through 2025-01-01.
    5. Important: When changing the dates, always use the format ‘YYYY-MM-DD’ (for example ‘2015-07-01’).

Training the Model

  1. (Code Block 5A) We have provided the code to train the Prophet model. Run this code block.
    1. Note: The %%time command prints the time it takes to run the entire cell. This is useful for estimating the time it takes to train a model.
  2. (Code Block 5B) This code block uses the trained Prophet model to forecast sea levels for the test dates, producing predicted values (yhat) with lower and upper bounds (yhat_lower and yhat_upper). The .head() function shows the first few rows for a quick inspection.

Evaluating the Model

  1. (Code Block 6A) This code block displays the Prophet model forecast plot, which shows the predicted monthly sea levels over time. The main blue line represents the model’s predictions, while the shaded area around it shows the uncertainty interval, meaning the range where the true sea level values are likely to fall. This helps you see both the expected trend and how confident the model is in its predictions.
    Example of the Prophet forecast. The black dots represent historical data points, showing the monthly sea levels over time from 1975 through 2025 (x-axis). The blue shaded region represents the forecast for the future, with the darker blue line indicating the predicted trend and the lighter blue area showing the uncertainty range of the prediction.Image Credit: Science Buddies

    Example of the Prophet forecast. The black dots represent historical data points, showing the monthly sea levels over time from 1975 through 2025 (x-axis). The blue shaded region represents the forecast for the future, with the darker blue line indicating the predicted trend and the lighter blue area showing the uncertainty range of the prediction.

    Figure 2. Example of the Prophet forecast. The black dots represent historical data points, showing the monthly sea levels over time from 1975 through 2025 (x-axis). The blue shaded region represents the forecast for the future, with the darker blue line indicating the predicted trend and the lighter blue area showing the uncertainty range of the prediction. 
    1. How does the forecasted trend compare to the historical data? Does it follow the same pattern?
    2. What factors could cause the actual sea levels to differ from the predictions shown in the graph?
  2. (Code Block 6B) This code block plots the actual sea levels for the test data against Prophet model forecasts, including a 12-month rolling average and a shaded confidence interval.
    1. How closely do the forecasted values match the actual sea levels? Are there periods where the model over- or under-predicts?
    2. Based on the forecast, what might you expect for future sea level trends?
  3. (Code Block 6C) This code block calculates the Mean Absolute Error (MAE) to assess the accuracy of the model’s predictions. 
    1. The MAE shows how close predictions are to actual values by averaging the size of errors. A lower MAE means better prediction accuracy.
    2. For example, an MAE of 0.05 indicates that, on average, the model’s predictions differ from the actual values by 0.05 units. That means that if the model predicts the mean sea level to be 0.10, the actual sea level may be anywhere between 0.05 and 0.15.
  4. (Code Block 6D) This code block calculates the Symmetric Mean Absolute Percentage Error (SMAPE) to evaluate the accuracy of the model’s predictions. 
    1. The SMAPE measures the average percentage difference between predicted and actual values in a symmetric way, accounting for both over- and under-predictions. A lower SMAPE indicates that the model’s predictions are closer to the true values relative to their magnitude.
    2. For instance, an SMAPE of 50% means that, on average, the model’s predictions differ from the actual values by 50% of their combined average size.
  5. (Code Block 6E) This code block generates a long-term sea level forecast up to 2100 using the trained Prophet model. It plots the historical sea levels as well as the predicted values from the specified split_date defined in Code Block 4B onward.
    1. From the NOAA Sea Level Trends page you visited earlier, on your selected region, click on the “Regional Scenarios” option. A graph will appear showing different scientists' projections for future sea level rise. Compare your model's predictions to these projections: How closely do they align, and where do they differ?

Experimenting with the Prophet Model

  1. Experiment with Time Interval Sizes: Change the dates in Code Block 4B.
    1. 25-year rolling windows: For example, train from 1975-2000 and test on 2000-2025. Then move backward: train on 1950-1975, test on 1975-2000, and so on.
    2. Varying training lengths: Compare performance when training with longer histories vs. shorter ones. For example:
      1. Train from 1900-2000, then test on 2000-2025 (long history).
      2. Train on just 10 years of data (e.g., 1990-2000), then predict into the present (2000-2025).
    3. By experimenting this way, you can see whether the model is more accurate with more historical data, or if shorter windows can capture recent trends better.
  2. Questions for Analysis:
    1. How does the model’s accuracy change when you use more historical data compared to less?
    2. Does the model tend to underpredict, overpredict, or stay flat when forecasting far into the future?
    3. Do shorter training windows capture sudden changes better, or do they miss longer-term trends?
    4. If you were tasked with making real-world sea level predictions, which training strategy would you trust more–long history or recent trends? Why?
    5. What might be some limitations of the Prophet model when predicting far into the future?
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Climate Action: Take urgent action to combat climate change and its impacts.

Variations

  • Experiment with changing parameters in the model to see if it could follow the trend better or potentially match the other scientists projections. You can see more information about the different parameters for the Prophet model on the Prophet documentation here.
  • Instead of the Prophet model, try models like ARIMA, LSTM (a type of neural network), or Random Forest regression. How do their predictions compare to the Prophet model and to NOAA’s scientific projections?
  • Use data from multiple NOAA stations (e.g., east coast vs. west coast). Do some areas show faster sea level rise than others? Can the model capture regional differences?
  • Check if the model can capture recurring seasonal variations, such as higher sea levels during certain months, changes with the tides, or astronomical effects (for example, the location of the moon or Jupiter). Compare predictions with and without seasonality components.

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Many aspects of peoples' daily lives can be summarized using data, from what is the most popular new video game to where people like to go for a summer vacation. Data scientists (sometimes called data analysts) are experts at organizing and analyzing large sets of data (often called "big data"). By doing this, data scientists make conclusions that help other people or companies. For example, data scientists could help a video game company make a more profitable video game based on players'… Read more
Career Profile
How is climate change affecting Earth? What will the changes mean for society? If these are questions that peak your curiosity, then you might be interested in a job as a climate change analyst. Climate change analysts evaluate climate data and research to determine how shifts in the climate will affect natural resources, animals, and civilizations. They use this information to make suggestions about what individuals and governments can do to ensure a higher-quality life for everyone in the… Read more
Career Profile
Have you ever noticed that for people with asthma it can sometimes be especially hard to breathe in the middle of a busy city? One reason for this is the exhaust from vehicles. Cars, buses, and motorcycles add pollution to our air, which affects our health. But can pollution impact more than our health? Cutting down trees, or deforestation, can contribute to erosion, which carries off valuable topsoil. But can erosion alter more than the condition of the soil? How does an oil spill harm fish… Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Ngo, Tracey, and Laura Ohl. "Can Machine Learning Forecast Future Sea Levels?" Science Buddies, 22 Oct. 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/ArtificialIntelligence_p031/artificial-intelligence/sea_level?from=Blog. Accessed 7 June 2026.

APA Style

Ngo, T., & Ohl, L. (2025, October 22). Can Machine Learning Forecast Future Sea Levels? Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/ArtificialIntelligence_p031/artificial-intelligence/sea_level?from=Blog


Last edit date: 2025-10-22
Top
Free science fair projects.