You are tasked with building a predictive model that analyzes historical daily stock prices over the past ten years to forecast future market trends. Which model architecture is designed to capture the temporal dependencies inherent in this time-series dataset?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal: stock prices aren't independent events. Today's price depends heavily on what happened yesterday, last week, and last month. It's a sequence over time. If you use a simple feedforward network, it treats every day's price like an isolated event with no memory of the past—that is a recipe for losing a lot of money! Think of an LSTM (Long Short-Term Memory) network like a diary. It writes down important trends, holds onto them across time steps, and forgets the noise. This temporal memory is exactly what you need to track trends in time-series data. K-Means is for grouping data, not predicting future values. And 2D CNNs are built for spatial patterns in images, not sequential timelines. Stick with LSTMs or RNNs when your data flows over time. Got it? Sweet.
Full explanation below image
Full Explanation
Time-series data, such as historical stock prices, is characterized by temporal dependencies, meaning that sequential order and historical patterns are critical for making predictions. To model such data effectively, an architecture must have the capacity to maintain memory of past inputs and process data sequences of variable lengths. Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks are specifically engineered for sequence modeling. Unlike feedforward architectures, RNNs pass hidden state information from one time step to the next, creating a temporal chain that captures dependencies over time. LSTMs improve on basic RNNs by introducing cell states and gates (forget, input, and output gates) that prevent the vanishing gradient problem, allowing the network to learn both short-term fluctuations and long-term historical trends. Let's look at why the other options are less effective: Option A describes a standard Feedforward Neural Network, which processes inputs in a single forward pass without temporal context or memory, treating sequential inputs as independent. Option B describes K-Means clustering, which is an unsupervised algorithm designed for partitioning data into clusters based on static feature similarity, not for forecasting values in a time series. Option D describes a 2D Convolutional Neural Network (CNN), which is designed for spatial feature extraction in grid-like data such as images, making it unsuitable for processing one-dimensional temporal sequences of stock prices. Therefore, an RNN or LSTM network is the correct architecture for time-series forecasting.