As mentioned in the chapter introduction, many types of data are not just collections of independent measurements; they possess an inherent order or structure where the position of an element provides significant context. This is the essence of sequential data. Formally, we can think of a sequence as an ordered list of elements, x=(x1,x2,...,xT), where xt is the element at time step or position t, and T is the total length of the sequence.
The critical characteristic is that the order matters. Swapping elements changes the meaning or the nature of the data entirely. Let's look at some common examples:
Natural language is perhaps the most intuitive example. Consider the sentence "The quick brown fox jumps over the lazy dog." The meaning is derived from the specific arrangement of words. Changing the order to "Lazy jumps dog the over brown quick fox the" results in gibberish. Each word's position relative to others is fundamental. Applications include:
A simple representation of a text sequence where each word occupies a specific position.
Data points recorded over time form a sequence. Examples include:
In these cases, the temporal order is vital. The value of a stock price today depends on its previous values. Weather patterns emerge from the sequence of temperature, pressure, and humidity readings over time. Predicting future values (forecasting) relies heavily on understanding these past temporal dependencies.
Hourly temperature data exhibits sequential dependency; the reading at one hour is related to the previous hour's reading.
Sound is inherently sequential. An audio waveform is represented as a sequence of amplitude values sampled at regular intervals (e.g., 44,100 times per second for CD-quality audio). The order of these amplitude values defines the frequencies, rhythms, and ultimately the sound we perceive, whether it's speech, music, or environmental noise. Scrambling the samples destroys the audio information.
Video can be seen as a sequence of images (frames). While each frame is a spatial grid of pixels, the sequence of frames over time creates motion and narrative. Tasks like action recognition in videos depend on analyzing how objects or scenes change across consecutive frames.
In bioinformatics, DNA and protein sequences are fundamental. A DNA strand is a sequence of nucleotides (A, C, G, T), and a protein is a sequence of amino acids. The specific order determines the biological function, structure, and properties. Identifying genes or predicting protein folding relies on analyzing these ordered sequences.
In all these examples, the defining feature is that the relationship between elements depends on their position. The value or meaning of an element xt is often influenced by preceding elements (x1,...,xt−1) and may influence subsequent elements (xt+1,...,xT). This contrasts sharply with datasets where each sample is independent, like classifying images based solely on their pixel values without considering any temporal order or context from other images (unless it's a video!).
Recognizing whether your data has this sequential property is the first step towards choosing appropriate modeling techniques. As we'll see later, standard feedforward neural networks struggle with this ordered structure, necessitating models like RNNs that are specifically designed to process information sequentially.
© 2025 ApX Machine Learning