Learn practical skills, build real-world projects, and advance your career

Tackling climate crisis with machine learning: Water temperature prediction using 60 years of oceanographic data

Increasing ocean temperatures severely affect marine species and ecosystems. Rising temperatures can contribute to coral bleaching and the loss of breeding grounds for marine fishes and mammals. Machine learning can be useful to predict what contributes to water temperature increase and to mitigate the rising temperatures in a timely fashion.

For this experiment, I used the California Cooperative Oceanic Fisheries Investigations (CalCOFI) dataset that comprises of 60 years of oceanographic data, hosted on Kaggle: https://www.kaggle.com/sohier/calcofi

The CalCOFI data set represents the longest (1949-present) and most complete (more than 50,000 sampling stations) time series of oceanographic and larval fish data in the world. It includes data on temperature, salinity, oxygen, phosphate, silicate, nitrate and nitrite, chlorophyll, transmissometer, PAR, C14 primary productivity, phytoplankton biodiversity, zooplankton biomass, and zooplankton biodiversity. Here I will focus on what predicts water temperature by using machine learning. Let’s start with importing the libraries and the data!

import torch
import jovian
import torchvision
import torch.nn as nn
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import torch.nn.functional as F
from torch.utils.data import DataLoader, TensorDataset, random_split
import jupyter_to_medium
dataframe_raw = pd.read_csv('bottle.csv')
dataframe_raw.head()
dataframe_raw.describe()

I will be focusing on some of the variables for now, so lets slice the dataframe.