﻿# Metro traffic forecasting needs an hourly key and available weather

Prepare Metro Interstate Traffic Volume by preserving the hourly traffic target, checking repeated time keys, and separating observed weather from forecast-time information.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-metro-traffic-hour-key-weather-availability/
Language: en

## Identify the quantity being predicted

A developer may treat every weather-enriched record as another independent hour of traffic. The [UCI dataset description](https://archive.ics.uci.edu/dataset/492/metro+interstate+traffic+volume) defines the target as hourly westbound traffic volume at a particular monitoring station. Weather categories describe that observation; they do not create additional vehicles.

Record the station, direction, time key, and target together. This makes it possible to distinguish repeated representations of an hour from genuinely different measured intervals.

## Check time keys before creating a regular grid

Parse `date_time` with an explicit format and retain the source interpretation of local CST time. The [pandas datetime documentation](https://pandas.pydata.org/docs/reference/api/pandas.to_datetime.html) distinguishes parsing and timezone conversion. Assigning UTC without establishing what the source clock means changes temporal relationships.

Check ordering, repeated keys, and missing hours before constructing lags. A row offset becomes an hourly lag only after the prepared sequence actually satisfies that hourly contract.

## Repeated records need a measurement-aware rule

Use the [duplicate detection interface](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.duplicated.html) to inspect candidate key collisions. Compare target values and weather descriptions within each group rather than deleting arbitrary records without inspecting their meaning.

If several rows describe the same hourly count, summing their targets would count that measurement repeatedly. Choose and document a representation for weather categories and conflicting values; preserve an audit table linking retained hours to source rows. This is a validation rule, not a claim that every duplicate has one universal cause.

## Observed weather is not automatically available weather

Temperature is documented in kelvin, while precipitation fields describe the observed hour. A historical explanatory regression can use contemporaneous weather under its stated task. A forecast issued earlier cannot silently consume the actual weather measured during its target hour.

The [temporal availability guide](/journal/data-guide-temporal-split-availability/) helps separate calendar information known ahead from observations requiring a weather forecast or delayed measurement. Keep the issue time and feature availability rule visible in evaluation.

## Verify one forecast from source to score

Select an hour and trace its source rows, chosen target, preceding observations, calendar features, and weather inputs. Confirm that preprocessing uses only the permitted fitting partition and that predictions rejoin the correct hour.

The [data identity guide](/journal/data-guide-coco-instance-caption-identities/) explains why this correspondence matters after aggregation. A clean table supports a clearly defined traffic experiment; it does not by itself demonstrate transfer to other roads, traffic directions, or genuinely unavailable future weather.
