AI and ML with TensorFlow & PyTorch

Chapter 9
Sequence Learning and Time-Series Analytics

Bachelors Program in AI & ML
AI and ML with TensorFlow & PyTorch   •   Bachelor

Sequence Learning and Time-Series Analytics

Introduction and Context

Many important data sources are ordered in time or position. Sentences consist of words arranged in sequence; industrial sensors produce streams of measurements; financial markets generate timestamped observations; and user interactions form behavioural histories. In such settings, the order of observations contains information that is lost when data are treated as independent rows.

Sequence learning develops models that use this order. Time-series analytics applies sequence-learning principles to observations indexed by time, with additional concerns such as seasonality, trends, autocorrelation, delayed effects, missing timestamps, and changing data-generating processes. Modern deep-learning systems support forecasting, sequence classification, language modelling, speech recognition, predictive maintenance, and anomaly detection.

This chapter examines embeddings, recurrent neural networks (RNNs), long short-term memory networks (LSTMs), gated recurrent units (GRUs), temporal convolutional networks, attention-based architectures, and practical workflows in TensorFlow and PyTorch. It also emphasizes temporal validation and concept drift, because a model that performs well under random shuffling may fail when deployed in the future.

Learning Objectives

By the end of this chapter, you should be able to:

1. Explain why sequence and time-series data require specialized representations and validation procedures.

2. Construct embeddings and recurrent architectures for text, signals, and temporal records.

3. Distinguish the mechanisms and trade-offs of RNNs, LSTMs, GRUs, temporal convolutions, and attention.

4. Design workflows for forecasting, sequence classification, and anomaly detection.

5. Apply suitable loss functions and evaluation metrics without introducing temporal leakage.

6. Diagnose vanishing gradients, overfitting, irregular sampling, missing data, and concept drift.

7. Implement basic sequence models using TensorFlow or PyTorch.

1. The Nature of Sequential Data

A sequence is an ordered collection of observations, commonly written as

\[

\mathbf{x}_{1:T}=(\mathbf{x}_1,\mathbf{x}_2,\ldots,\mathbf{x}_T),

\]

where \(T\) is the sequence length and \(\mathbf{x}_t\) is the observation at position or time \(t\). For a univariate time series, \(\mathbf{x}_t\) may be a scalar; for a multivariate series it may contain temperature, pressure, vibration, and other measurements.

A central property is dependence. The conditional distribution of a future value may depend on previous observations:

\[

P(y_{t+1}\mid \mathbf{x}_{1:t})

\]

rather than only on \(\mathbf{x}_t\). The notation does not claim that every past observation is equally useful. It expresses the modelling problem: learn which historical information helps predict the target.

Important characteristics include:

  • Trend: a persistent long-term increase or decrease.
  • Seasonality: a repeating pattern associated with a known period, such as day, week, or year.
  • Autocorrelation: dependence between observations separated by a lag.
  • Stationarity: broadly, stability of relevant distributional properties over time. Strict stationarity requires the joint distribution to remain unchanged under time shifts; practical analyses often use the weaker idea of stable means, variances, and dependence structures.
  • Irregular sampling: observations arrive at unequal time intervals.
  • Multiscale dependence: both short-term fluctuations and long-term relationships may matter.
  • Concept drift: the relationship between inputs and targets changes after deployment.

A sequence model must therefore represent both the current input and useful historical context.

2. Representing Text and Temporal Observations

2.1 Tokenization and embeddings

Text is usually converted into tokens such as words, subwords, or characters. A vocabulary maps each token to an integer index. The index itself has no meaningful numerical distance, so it is transformed into a dense embedding vector. If the vocabulary size is \(V\) and embedding dimension is \(d\), an embedding matrix has shape \(V\times d\). A token index selects one row of this matrix.

Embeddings can be learned jointly with the task or initialized from pretrained representations. A learned embedding is useful because tokens occurring in similar contexts may acquire similar vectors. Padding tokens are used to create batches with a common length, while masks prevent padding from affecting losses or hidden-state computations.

For a categorical event stream, such as product IDs or machine states, the same embedding principle applies. Continuous variables should generally be normalized using statistics computed from the training period only. A common standardization is

\[

z_t=\frac{x_t-\mu_{train}}{\sigma_{train}},

\]

where \(\mu_{train}\) and \(\sigma_{train}>0\) are training-set mean and standard deviation. These values must not be recomputed using future validation or test observations.

2.2 Windows, horizons, and targets

A forecasting dataset can be formed with an input window of length \(L\) and forecast horizon \(H\). A window beginning at time \(t\) contains \(\mathbf{x}_{t:t+L-1}\), and the target may be the next value, the next \(H\) values, or an aggregate over the horizon. Overlapping windows increase the number of training examples, but neighbouring examples are not independent. This affects validation design and uncertainty interpretation.

For one-step forecasting, mean squared error (MSE) is

\[

\mathrm{MSE}=\frac{1}{n}\sum_{i=1}^{n}(y_i-\hat y_i)^2,

\]

where \(y_i\) is the observed target and \(\hat y_i\) is the prediction. MSE has squared target units and penalizes large errors strongly. Mean absolute error (MAE), \(n^{-1}\sum_i|y_i-\hat y_i|\), has the original target units and is less sensitive to extreme errors. For intermittent or scale-varying series, metrics such as MASE or suitable percentage metrics may be preferable, but percentage errors are problematic when actual values are zero or near zero.

3. Recurrent Neural Networks

An RNN processes one item at a time while maintaining a hidden state. A basic formulation is

\[

\mathbf{h}_t=\tanh(\mathbf{W}_x\mathbf{x}_t+\mathbf{W}_h\mathbf{h}_{t-1}+\mathbf{b}),

\]

\[

\hat{\mathbf{y}}_t=g(\mathbf{W}_y\mathbf{h}_t+\mathbf{b}_y),

\]

where \(\mathbf{h}_t\) is the hidden state, \(\mathbf{h}_0\) is an initial state, \(g\) is an output activation appropriate to the task, and the matrices and biases are learned parameters. For regression, the final output is often linear; for binary classification, a sigmoid may be used; for multiclass classification, a softmax produces class probabilities.

The same parameters are reused at every time step. This makes an RNN applicable to variable-length sequences and gives it a compact representation of history. During training, the network is conceptually unrolled through time and optimized by backpropagation through time (BPTT).

3.1 Vanishing and exploding gradients

Repeated multiplication by recurrent Jacobian matrices can make gradients shrink toward zero or grow excessively as the sequence becomes longer. Vanishing gradients make early events difficult to learn; exploding gradients can cause unstable updates. Gradient clipping limits the norm of an update or gradient, but it does not by itself solve long-term memory loss. Gated architectures address this issue by creating controlled paths for information and gradients.

3.2 Bidirectional recurrence

A bidirectional RNN reads a sequence from both directions and combines the two hidden representations. It is useful when the entire sequence is available, for example in offline text classification or speech segmentation. It is unsuitable for causal forecasting if the backward direction would use information that was not available at prediction time.

4. LSTMs and GRUs

4.1 Long short-term memory

An LSTM maintains a cell state \(\mathbf{c}_t\) and hidden state \(\mathbf{h}_t\). A standard LSTM is described by

\[

\mathbf{i}_t=\sigma(\mathbf{W}_i\mathbf{x}_t+\mathbf{U}_i\mathbf{h}_{t-1}+\mathbf{b}_i),

\]

\[

\mathbf{f}_t=\sigma(\mathbf{W}_f\mathbf{x}_t+\mathbf{U}_f\mathbf{h}_{t-1}+\mathbf{b}_f),

\]

\[

\mathbf{o}_t=\sigma(\mathbf{W}_o\mathbf{x}_t+\mathbf{U}_o\mathbf{h}_{t-1}+\mathbf{b}_o),

\]

\[

\tilde{\mathbf{c}}_t=\tanh(\mathbf{W}_c\mathbf{x}_t+\mathbf{U}_c\mathbf{h}_{t-1}+\mathbf{b}_c),

\]

\[

\mathbf{c}_t=\mathbf{f}_t\odot\mathbf{c}_{t-1}+\mathbf{i}_t\odot\tilde{\mathbf{c}}_t,

\qquad

\mathbf{h}_t=\mathbf{o}_t\odot\tanh(\mathbf{c}_t).

\]

Here \(\sigma\) is the sigmoid function, \(\odot\) denotes element-wise multiplication, \(\mathbf{i}_t\), \(\mathbf{f}_t\), and \(\mathbf{o}_t\) are input, forget, and output gates, and \(\tilde{\mathbf{c}}_t\) is a candidate cell update. Gates take values between zero and one and regulate information flow. The additive cell-state update can preserve information more effectively than a simple recurrent transformation.

4.2 Gated recurrent units

A GRU combines the cell and hidden state and generally uses fewer gates and parameters. One common formulation is

\[

\mathbf{z}_t=\sigma(\mathbf{W}_z\mathbf{x}_t+\mathbf{U}_z\mathbf{h}_{t-1}),

\quad

\mathbf{r}_t=\sigma(\mathbf{W}_r\mathbf{x}_t+\mathbf{U}_r\mathbf{h}_{t-1}),

\]

\[

\tilde{\mathbf{h}}_t=\tanh(\mathbf{W}_h\mathbf{x}_t+\mathbf{U}_h(\mathbf{r}_t\odot\mathbf{h}_{t-1})),

\]

\[

\mathbf{h}_t=(1-\mathbf{z}_t)\odot\mathbf{h}_{t-1}+\mathbf{z}_t\odot\tilde{\mathbf{h}}_t.

\]

Conventions differ regarding whether \(\mathbf{z}_t\) weights the old or candidate state, so implementations should be interpreted according to their documentation. GRUs are often faster and may perform similarly to LSTMs, but neither architecture is universally superior. The choice should be tested using a temporally valid validation procedure.

5. Alternatives to Recurrent Architectures

5.1 Temporal convolutional networks

A one-dimensional causal convolution computes each output using current and earlier inputs only. Dilated convolutions skip input positions at increasing intervals, expanding the receptive field without processing every recurrent state. Residual connections and normalization can improve optimization. Temporal convolutional networks offer parallel training and predictable receptive fields, but the receptive field must be large enough for the dependencies of interest.

5.2 Attention and transformers

Attention assigns data-dependent weights to elements of a sequence. Given query, key, and value matrices, scaled dot-product attention is

\[

\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V,

\]

where \(d_k\) is the key dimension. The scaling reduces extreme dot products before the softmax. Transformers use multiple attention heads, feed-forward layers, residual connections, and positional information. They can model long-range relationships and train in parallel, but standard full attention has quadratic memory and computation in sequence length. Causal masks are essential for autoregressive forecasting so that a position cannot attend to future targets.

Hybrid systems combine convolutional layers for local patterns with recurrent or attention layers for longer dependencies. Architecture selection should reflect sequence length, latency, data volume, interpretability requirements, and available computing resources rather than fashion alone.

6. Main Sequence-Learning Tasks

6.1 Forecasting

Forecasting predicts future numerical values. Strategies include:

  • Direct forecasting: separate output models predict each future horizon.
  • Recursive forecasting: a one-step model feeds its prediction back as input for later steps; errors can accumulate.
  • Multi-output forecasting: one model predicts the complete horizon simultaneously.
  • Probabilistic forecasting: the model predicts a distribution or quantiles rather than a single point.

A useful baseline may be a persistence forecast, \(\hat y_{t+1}=y_t\), or a seasonal persistence forecast. A neural model should demonstrate improvement over an appropriate baseline. Teacher forcing, in which the true previous value is supplied during training, can create a discrepancy when the model must consume its own predictions at inference. Scheduled sampling and direct multi-horizon designs are possible responses, but each introduces design trade-offs.

6.2 Sequence classification

Sequence classification assigns one label to an entire sequence, such as identifying an activity from wearable-sensor data or classifying a document by topic. A recurrent or attention encoder produces a summary representation, often the final hidden state, a masked pooling operation, or a designated classification token. A classification head then produces logits. Cross-entropy is commonly used for mutually exclusive classes; class weighting or resampling may be required for imbalance.

For time-point labelling, such as detecting the precise start of a machine fault, the model produces an output at each time step. Evaluation must distinguish event-level performance from pointwise accuracy.

6.3 Anomaly detection

An anomaly is an observation or pattern that is unusual relative to a defined reference population. The definition must be operational: unusual sensor behaviour, unexpected transactions, or a violation of a known process.

An autoencoder learns to reconstruct normal windows. If \(\mathbf{x}\) is a window and \(D(E(\mathbf{x}))\) its reconstruction, an anomaly score can be

\[

s(\mathbf{x})=\frac{1}{m}\sum_{j=1}^{m}(x_j-\hat x_j)^2,

\]

where \(m\) is the number of scalar elements and \(\hat x_j\) is the reconstruction. A threshold should be selected using a validation period or an explicit false-alarm budget, not chosen after inspecting the test set. Prediction-based detection compares an observation with a forecast interval or forecast error. High reconstruction error is not automatically evidence of a meaningful anomaly: sensor faults, regime changes, and normal rare events can produce the same signal.

7. Temporal Validation and Concept Drift

Random train-test splitting is usually inappropriate for forecasting because training examples may contain information from after the validation examples. A chronological split trains on earlier data and evaluates on later data. A stronger method is rolling-origin evaluation: train on an initial interval, validate on the next interval, expand or move the training window, and repeat.

All preprocessing, feature construction, and hyperparameter selection must respect the information boundary. Examples of leakage include scaling with the full dataset, using future rolling averages, randomly splitting overlapping windows from the same event across train and test, and allowing revisions or labels created after the prediction timestamp into the input.

Suppose a system predicts demand at 09:00. Features must be those available by 09:00, not the final daily total or a corrected sensor reading issued at noon. This requirement is a deployment contract, not merely a modelling preference.

Concept drift occurs when the joint distribution of inputs and targets, or the conditional relationship between them, changes. Causes include new customer behaviour, sensor replacement, policy changes, climate shifts, and adversarial adaptation. Monitoring should track input distributions, missingness, prediction distributions, residuals, and delayed ground-truth performance. Responses include retraining on recent data, weighted losses, adaptive windows, recalibration, champion-challenger testing, and temporary human review. Drift detectors are indicators rather than proof; an alert must be investigated for data-quality problems and operational causes.

8. Practical Implementation with TensorFlow and PyTorch

A robust implementation follows a reproducible pipeline:

1. Define the prediction timestamp, target, horizon, and allowed features.

2. Sort records by entity and time; resolve duplicates and document missingness.

3. Split chronologically before fitting scalers, token vocabularies, or feature transformations that could use future information.

4. Create windows, masks, and labels, preserving entity boundaries.

5. Establish a naïve or classical baseline.

6. Train a small model before increasing depth, hidden size, or context length.

7. Use early stopping based on a chronological validation set and save the best checkpoint.

8. Evaluate on a final untouched period and report uncertainty or variation across rolling origins.

9. Log data versions, feature availability, random seeds, model configuration, and evaluation dates.

In TensorFlow, `tf.keras.layers.Embedding`, `LSTM`, `GRU`, `Conv1D`, and masking utilities provide standard components. In PyTorch, `nn.Embedding`, `nn.RNN`, `nn.LSTM`, `nn.GRU`, packed sequences, and `DataLoader` support equivalent workflows. Tensor shapes must be checked carefully. A common batch-first convention is `(batch, time, features)`, although some APIs default to `(time, batch, features)`. For variable-length sequences, padding and masks must be handled consistently in the model and loss.

For a PyTorch training loop, the conceptual order is: move a batch to the device, clear gradients, perform the forward pass, compute the masked loss, call `backward()`, optionally clip gradients, update the optimizer, and record metrics. Evaluation uses `model.eval()` and a no-gradient context. TensorFlow training may use `model.fit` with a custom data pipeline or a custom gradient-tape loop when masking, multiple losses, or specialised schedules are required.

9. Worked Example: Multi-Sensor Machine-Failure Prediction

Consider an illustrative manufacturing system with vibration, temperature, pressure, and motor-current measurements sampled every minute. The objective is to predict whether a failure will occur within the next 30 minutes.

Background. Failures are rare, and maintenance records contain the event time. Sensor values have different units and occasional gaps.

Problem formulation. For each machine and prediction time \(t\), use the previous 120 minutes as input. The label is one if a verified failure begins in \((t,t+30\text{ minutes}]\), and zero otherwise. Windows crossing machine boundaries are prohibited. The task is sequence classification, not ordinary row-wise classification.

Analysis. A random split could place windows from the same failure episode in both training and test sets. This would inflate performance. Instead, the first 70% of calendar time is used for training, the next 15% for validation, and the final 15% for testing. Scaling parameters are fitted only on the training period. Missing values are imputed using a method available at prediction time, and a missingness indicator is added because missingness itself may signal a sensor problem.

Approach. A baseline uses threshold features and logistic regression. A GRU encoder receives the 120-step multivariate sequence; its final representation feeds a sigmoid classification head. Because failures are rare, the team reports precision, recall, area under the precision-recall curve, and false alarms per machine-day, rather than accuracy alone. The decision threshold is selected on validation data to satisfy a maintenance team’s maximum false-alarm budget.

Outcome. Suppose the GRU achieves higher recall than the baseline at the same validation false-alarm rate, but performance falls on the final period. Investigation shows that a sensor firmware update changed vibration scale. The model is not simply “worse”; the input distribution and calibration changed. The team adds firmware version as metadata, recalibrates, and establishes drift monitoring. A champion-challenger process compares the existing model with a recently retrained model before replacement.

Learning points. The case illustrates that temporal boundaries, label timing, class imbalance, threshold selection, sensor governance, and post-deployment monitoring are as important as the neural architecture. A technically sophisticated model cannot compensate for an invalid evaluation design.

10. Challenges, Ethics, and Governance

Sequence models can amplify privacy risks because histories reveal habits, locations, health conditions, and relationships. Text and behavioural sequences may contain personal or sensitive information. Data minimization, access controls, retention limits, encryption, and purpose limitation are therefore essential. Identifiers should be separated from modelling features where possible.

A model used for credit, employment, healthcare, or safety decisions may affect individuals over time. Historical sequences can encode earlier discrimination, while concept drift can cause unequal deterioration across groups. Evaluation should examine subgroup performance, calibration, false-positive burden, and the consequences of errors. Human oversight should be meaningful rather than a nominal approval step.

Forecasts and anomaly alerts are not facts. Operators need explanations appropriate to the application, including the time interval, influential signals, confidence or uncertainty, and known limitations. Audit logs should preserve model version, input timestamp, output, threshold, and action taken. Regulatory duties vary by sector and jurisdiction, so legal and compliance review must accompany technical development.

11. Best Practices and Contemporary Directions

Effective sequence projects generally follow these principles:

  • define causality and feature availability before selecting an architecture;
  • compare against simple, seasonal, and domain-specific baselines;
  • use chronological or rolling validation;
  • preserve masks and entity boundaries;
  • monitor both predictive performance and data quality;
  • use regularization, dropout, weight decay, and early stopping cautiously;
  • tune context length and forecast horizon as modelling choices;
  • separate point accuracy from probabilistic calibration;
  • document retraining triggers and rollback procedures.

Current developments include efficient attention for long contexts, state-space sequence models, self-supervised pretraining on unlabelled sensor streams, foundation models for time series, neural forecasting with probabilistic outputs, and physics-informed or constraint-aware models. These approaches may improve transfer and long-range modelling, but their benefits depend on data quality, computational cost, interpretability, and appropriate evaluation. Larger models do not remove the need for temporal discipline.

Chapter Summary

Sequence learning models ordered observations rather than treating records as independent. Embeddings convert discrete tokens or events into trainable dense vectors, while normalization and masking support stable computation. Basic RNNs maintain hidden states but may suffer from vanishing or exploding gradients. LSTMs use cell states and gates to regulate memory; GRUs offer a simpler gated alternative. Temporal convolutions provide parallel local-to-long-range processing, and attention models data-dependent relationships but require causal masks for forecasting.

Forecasting may be recursive, direct, multi-output, or probabilistic. Sequence classification summarises an entire sequence or labels individual time points. Anomaly detection can use reconstruction or prediction errors, but thresholds must reflect operational costs and validation evidence. Chronological and rolling-origin evaluation prevent temporal leakage. Concept drift requires monitoring, investigation, recalibration, and controlled retraining. Successful professional systems combine sound formulation, baselines, architecture selection, governance, and post-deployment monitoring.

Key Terms

Sequence: An ordered collection of observations.

Time series: Observations indexed by time.

Embedding: A learned dense vector representation of a discrete item.

Autocorrelation: Dependence between values separated by a time lag.

Seasonality: A repeating pattern associated with a calendar or operating period.

Stationarity: Stability of relevant distributional properties under time shifts.

Window: A fixed historical segment used as a model input.

Horizon: The future interval or number of steps being predicted.

RNN: A neural network that updates a hidden state sequentially.

BPTT: Backpropagation through time for training recurrent models.

LSTM: A gated recurrent architecture with hidden and cell states.

GRU: A gated recurrent architecture with a combined state and fewer gates.

Causal convolution: A convolution using current and past inputs only.

Attention: A mechanism that weights sequence elements according to learned relevance.

Teacher forcing: Training a decoder using the true previous value rather than its prediction.

Temporal leakage: Use of information unavailable at prediction time.

Concept drift: Change in the data distribution or input-target relationship.

Anomaly: An observation or pattern unusual under a defined reference process.

Calibration: Agreement between predicted probabilities or intervals and observed frequencies.

Rolling-origin evaluation: Repeated evaluation using successive future forecast origins.

Review Questions

Short Answer Questions

1. Why is random train-test splitting often invalid for time-series forecasting?

2. What roles do the input, forget, and output gates play in an LSTM?

3. Distinguish recursive forecasting from direct multi-horizon forecasting.

4. Why are masks needed when padded sequences are used?

5. What is concept drift, and name one possible response to it?

Long Answer Questions

1. Explain the architecture and training challenges of a basic RNN, then compare it with an LSTM and a GRU.

2. Discuss how embeddings, normalization, windows, and horizons are used to prepare text or sensor sequences.

3. Compare RNNs, temporal convolutional networks, and transformers for long-sequence modelling.

4. Explain how to design a leakage-resistant workflow for forecasting and evaluate it using rolling-origin validation.

5. Discuss ethical, privacy, and governance issues in deploying sequence models for behavioural or industrial monitoring.

Analytical / Application Questions

1. Design a sequence-classification system for detecting machine faults from four sensors. Specify the window, label timing, validation split, metrics, and drift-monitoring plan.

2. A forecasting model performs well on a random test split but poorly on the next month of data. Diagnose at least three possible causes and propose a corrected evaluation procedure.

3. An anomaly detector generates too many alerts after a sensor firmware update. Analyse possible technical explanations and recommend a safe operational response.

Multiple Choice Questions with Answers

Question 1

Which practice best prevents future information from entering a time-series training pipeline?

A. Randomly shuffle all windows before splitting

B. Fit preprocessing statistics using the complete dataset

C. Split chronologically before fitting preprocessing transformations

D. Use a bidirectional encoder for causal forecasting

Correct Answer: C. Split chronologically before fitting preprocessing transformations

Question 2

What is the primary purpose of the forget gate in a standard LSTM?

A. To choose how much previous cell-state information is retained

B. To convert class logits into probabilities

C. To determine the sequence sampling frequency

D. To remove all recurrent connections

Correct Answer: A. To choose how much previous cell-state information is retained

Question 3

Which architecture uses data-dependent weighted interactions between sequence positions?

A. Linear regression

B. Attention

C. One-hot encoding

D. Persistence forecasting

Correct Answer: B. Attention

Question 4

Why can recursive multi-step forecasting accumulate errors?

A. It always uses future ground-truth values

B. It feeds earlier predictions into later prediction steps

C. It cannot use historical observations

D. It requires a bidirectional network

Correct Answer: B. It feeds earlier predictions into later prediction steps

Question 5

Which metric is expressed in the original units of the target variable?

A. Mean absolute error

B. Mean squared error

C. Squared-error variance

D. Attention score

Correct Answer: A. Mean absolute error

Question 6

What is concept drift?

A. A change in model parameter datatype

B. A change in the data distribution or input-target relationship

C. A method for padding sequences

D. A way to initialize an embedding matrix

Correct Answer: B. A change in the data distribution or input-target relationship

Question 7

For causal forecasting with a transformer, what is required to prevent use of future positions?

A. A causal attention mask

B. A bidirectional backward pass

C. Random labels

D. Removal of positional information

Correct Answer: A. A causal attention mask

Question 8

Which is an appropriate baseline for a persistence forecast?

A. Predict the previous observed value as the next value

B. Predict the global maximum for every time step

C. Shuffle the target sequence

D. Use the future mean computed from the test period

Correct Answer: A. Predict the previous observed value as the next value

Question 9

Why are missingness indicators sometimes added to sensor inputs?

A. They guarantee that all missing values are correct

B. Missingness itself may contain useful operational information

C. They eliminate the need for validation

D. They convert continuous values into tokens

Correct Answer: B. Missingness itself may contain useful operational information

Question 10

Which evaluation design repeatedly trains or updates using earlier data and tests on a subsequent future interval?

A. Random cross-sectional splitting

B. Rolling-origin evaluation

C. Label permutation

D. Static vocabulary indexing

Correct Answer: B. Rolling-origin evaluation

AI and ML with TensorFlow & PyTorch
Chapter 9 of 15