liveBook · Manning

Temperature forecasting

As explained in Deep Learning with R, Third Edition

Temperature forecasting is the task of predicting a future temperature value from previous measurements and related observations.

Temperature forecasting predicts a future temperature from recent measurements and related observations. A representative task predicts temperature 24 hours ahead from hourly atmospheric pressure, humidity, and other sensor measurements. Its temporal structure includes daily and yearly periodicity, making it a useful setting for timeseries forecasting and recurrent neural networks. section 13.2 section 13.0

The Jena weather dataset

The example uses weather observations from Jena, Germany, recorded every 10 minutes from 2009 to 2016. The dataset contains 420,451 rows and 15 columns: a timestamp plus 14 measurements including temperature, pressure, humidity, wind direction, and wind speed. Plotting the full range exposes yearly periodicity; plotting the first 10 days exposes daily cycles across 144 observations per day. section 13.2

A practical workflow for the forecasting task includes:

  • Download and decompress the Jena climate data. section 13.2
  • Parse timestamps with the dataset’s fixed Central European Time convention and read weather columns as numeric values. section 13.2
  • Inspect rows, columns, and temporal plots before modeling. section 13.2
  • Split the ordered observations into 50% training, 25% validation, and 25% test data. section 13.2
  • Iterate over sequence length, sampling rate, recurrent-layer units, dropout, optimizer, and feature engineering because performance choices are dataset-dependent. section 13.4
library(tensorflow, exclude = c("shape", "set_random_seed"))
library(tfdatasets, exclude = "shape")
library(dplyr, warn.conflicts = FALSE)
library(keras3)

url <- paste0(
  "https://s3.amazonaws.com/keras-datasets/",
  "jena_climate_2009_2016.csv.zip"
)
get_file(origin = url) |>
  zip::unzip("jena_climate_2009_2016.csv")

Use the listing to obtain the Jena climate archive before inspecting and plotting the forecasting data. section 13.2

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains the task through data loading, inspection, visualization, temporal splitting, and model-selection guidance, while emphasizing empirical iteration.
Examples
Uses the Jena weather dataset, full-range and ten-day temperature plots, and chronological train-validation-test splits.
What you can do after
Evaluate forecasting strategies empirically and assess how input sequences, sampling, architecture, optimization, and features affect performance.
How it connects
Connects temperature forecasting with timeseries forecasting, recurrent neural networks, convolutional networks, feature engineering, and weather predictability.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.