Short-term stock price forecasting system that integrates GRU and XGBoost for advanced time series forecasting
The integration of GRU and XGBoost addresses the challenges of nonlinear and volatile stock market dynamics by enhancing prediction accuracy through a two-stage framework that leverages temporal and nonlinear features.
Patent Information
- Application Number
- DE202025102394
- Authority / Receiving Office
- DE · DE
- Patent Type
- Utility models
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-06-26
- Estimated Expiration
- 2035-04-30
AI Technical Summary
Existing stock price prediction models struggle to accurately capture the complex, nonlinear interactions and sudden fluctuations in financial markets, particularly in short-term forecasts, due to limitations in traditional statistical and deep learning methods.
A hybrid system combining Gated Recurrent Unit (GRU) networks with Extreme Gradient Boosting (XGBoost) to leverage temporal dependencies and nonlinear pattern recognition, utilizing a two-stage prediction pipeline for improved accuracy.
The hybrid model effectively captures both temporal and nonlinear patterns in financial data, resulting in more accurate and robust short-term stock price predictions, validated by performance metrics such as MSE, MAE, and R², and adaptable to various market conditions.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Field of the Invention:The present invention relates generally to the field of financial prediction and machine learning, and more particularly to a hybrid machine learning based short term stock price prediction system. The invention combines the sequential modeling capabilities of gated recurrent unit (GRU) networks with the nonlinear regression strength of extreme gradient boosting (XGBoost) to improve prediction accuracy for advanced time-series predictionsBackground of the Invention:The area of stock market prognosis has long been similarly fascinating researchers, analysts, and investors. Despite the spread of statistical tools and computer-aided techniques, the task remains to predict stock prices accurately, especially in a short-term, a formidable challenge due to the natural volatile, dynamic and non-linear nature of financial markets. The behaviour of the stock prices is influenced by a variety of factors dependent on one another, such as economic indicators, customer mood, corporate performance, macro-economic policies, geopolitic events and even unpredictable global crisis.Historically, linear models such as Autoregressive Integrated Moving Average (ARIMA) and its variants were among the first attempts to model financial time series data. As computational power advances and access to more sophisticated algorithms, machine learning models such as support vector machines (SVM), random forests, and gradient boosting machines (GBM) have been introduced to overcome these limitations.The advent of deep learning introduced a new paradigm in time-series prediction. Recurrent Neural Networks (RNNs), in particular Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) networks, have proven to be powerful tools for modeling sequential data. These architectures have been specially designed to store information over time levels making them well suited for applications in speech modelling, speech recognition and stock market prediction.GRU has a simplified but highly efficient variant of LSTM because of its faster training time and its ability to process longer sequences without the problem of disappearing gradient, Popularity.GRU-based models showed marked improvements in the acquisition of temporal dependencies and trends in stock heading data.One of the greatest challenges is the risk of underfitting or overfitting due to complex model structures and the need for large sets of data.Moreover, deep learning models may sometimes overlook-subtil fluctuations or anomalies not readily detected by the sequential feature extraction alone.This has led to the investigation of hybrid modeling techniques in which two or more models are combined to utilize their individual strengths and mitigate their weaknesses.Extreme Gradient Boosting (XGBoost), a highly optimized implementation of gradient-boosted decision trees, has attracted considerable attention in the area of predictive analytics.XGBoost is distinguished by the handling of nonlinear relationships and can model complex patterns by its ensemble learning mechanism.In contrast to GRU, XGBoost does not take into account the temporal sequence of the input data, but it compensates for this limitation by its ability to learn from complex residual errors and iteratively refine predictions.The robustness, scalability and high prediction accuracy of XGBoost make it a valuable addition to sequential models such as GRU.By first extracting low-order sequential features from normalized input data and then passing them on to the XGBoost model, the system combines the strengths of deep learning and gradient boosting.Researchers have increasingly recognized that no single model is universally optimal in all problem domains or data sets. Therefore, the proposed combination of GRU and XGBoost provides strategic synergy in which the temporal memory of GRU supplements the ability of XGBoost to feature learning.In recent years, several studies have attempted similar integrations, but only a few have been specially optimized for high frequency or intra-pay stock prices, which entails additional challenges such as noise, overfitting and sudden trend changes.The present invention is characterized in that it focuses on hourly stock price data and involves specialist technical indicators such as the rolling standard deviation for quantifying market volatility.These features are not only important predictors for short term trends, but also improve the generalizability and robustness of the model under various market conditions.This sequence aware and pattern enhancing framework has the potential to redefine the short term stock prediction and provides implementable insights for investors, financial institutions, and automated trading systems. The use of stringent rating metrics such as mean square error (MSE), mean absolute error (MAE), mean square error root (RMSE), and certainty measure (R 2) further validates the performance of the model and its superiority over stand alone methods.Therefore, the background of this invention is strongly rooted in overcoming the limitations of existing models by choosing an integrative approach that accommodates temporal sensitivity with non-linear adaptability and results in a more accurate, reliable and interpretable prediction system for financial markets.Object of the invention:This integrative approach aims to overcome the inherent challenges arising from the dynamic and volatile nature of stock markets by combining the sequential processing power of GRU with the high-performance non-linear pattern recognition capabilities of XGBoost.In the analysis of financial time series, it is essential to record both the temporal dependencies and the complex residual patterns in order to make reliable short-term predictions. Traditional deep learning models such as GRU are taught to model time sequences, extract features over multiple time stages to identify underlying trends and dependencies.GRU networks are particularly well suited for such tasks because they are able to efficiently handle long-term dependencies and thereby have relatively low computational costs compared to their more complex counterparts such as LSTM.GRU component is trained on normalized historical stock market data, including features such as final rates, trade volume and rolling standard deviation-an important technical indicator for measuring volatility in market behavior.Historical Intra-Bay Data with Hourly Resolution is first collected and transformed by normalization techniques such as MinMax scaling to ensure consistency and comparison across various features.Time-series samples are then made using a sliding window technique to preserve the sequential order of the data.This ensures that the GRU network receives inputs reflecting the temporal structure required for accurate prediction.Once the GRU model is trained and generates intermediate predictions based on its learned representations, these outputs are passed to the XGBoost regressiver. In contrast to GRU focusing on learning long term dependencies, XGBoost specializes to identify and correct residual errors that the GRU model may have overlook.First, the GRU network processes the raw sequential data and makes a preliminary prediction.This prediction, containing high-rank temporal features, is then fed into the XGBoost model, which further learns and corrects inconsistencies or under-matched patterns, ultimately resulting in the final prediction of stock quote.This integration of the models results in a system that is better able to cope with the complexity of financial time-series data than each model could be independent of one another.The architecture is rigoroously evaluated using several performance metrics, including mean squared error (MSE), mean absolute error (MAE), root mean squared error (RMSE), and R-squared (R 2). These metrics provide a comprehensive survey of model performance by not only detecting the average deviation of the predictions, but also their variance and overall adaptation to the actual data. Comparative studies conducted in the context of the invention have shown that the hybrid GRU-XGBoost system significantly outbreaks the stand-alone GRU or XGBoost models, particularly in scenarios involving short-term predictions of noisy, high frequency data.This invention presents a significant advance in the field of financial predictions.It shows that hybrid architectures combining the strengths of sequential and ensemble learning can generate more accurate and robust prediction models.Moreover, the flexibility of the proposed system enables adaptation to various stock markets, time intervals and technical indicators, making it a versatile tool for dealers, analysts and financial institutions who seek implementable findings.In summary, the invention uses the complementary strengths of GRU and XGBoost in a seamless hybrid framework to offer a powerful solution for the short-term prediction of stock prices.Brief Description of the DrawingsFigure 1 shows a block diagram of the system of the invention.DETAILED DESCRIPTION OF THE INVENTIONThe object of the invention is to improve the prediction accuracy of time-series predictions in the natural volatile and non-linear environment of financial markets.Financial markets operate with considerable uncertainty, often affected by numerous internal and external variables. Traditional statistical models have proven to be less effective in detecting the nuancing patterns and abrupt variations in financial data, especially in short-term predictions. To address these challenges, the present invention utilizes deep learning and ensemble techniques by combining the ability of GRU to process sequential data with the effectiveness of XGBoost to model residual errors and non-linear relationships.This data is collected using the yfinance application programming interface (API) which retrieves a wide range of stock indicators including, but not limited to, heading, trade volume, and other technical indices relevant to market behavior.The most important variables, namely final rates, trade volume and SDV, are normalized using the MinMaxScaler technique.This normalization brings the features to a uniform scale, ensuring that the optimization algorithms of the model are not distorted by differences in size between the input variables.The data are then restructured using a sliding window technique into sequential formats that produce overlapping time sequenced samples with a fixed window size of 20 time steps.Each sample includes a window of past observations, thereby maintaining the time order critical for time-series modeling.The data set is then divided into equally sized training and test partitions, This is to facilitate both model training and subsequent validation.The GRU network, a variant of recurrent neural networks, was chosen because of its proven efficiency in detecting long-term dependencies in sequential data, while mitigating the disappearance of the gradient problem often associated with traditional RNNs. The first layer is configured with 128 units and set to return sequences, thereby providing the subsequent GRU layer with full temporal encoding of the input data.The second GRU layer, consisting of 64 units, is configured to only output the last time stamp and collect the sequence into a fixed-size contextual vector.This representation is then passed through a fully connected single neuron designs layer that generates the preliminary stock price prediction.The GRU model is trained to minimize mean squared error (MSE) using the adam optimizer, a robust and adaptive optimization algorithm, This is widely used in deep learning applications.To overcome this limitation, the invention integrates a second learning phase using XGBoost, a highly efficient and scalable implementation of gradient-boosted decision trees. After the GRU model is trained and its predictions are obtained on the training dataset, these predictions are used together with the original input features to train the XGBoost regressiver, whereby XGBoostcan learn and model the prediction errors of the GRU model. By detecting these residues, the XGBoost model corrects under- and overestimates made during the first prediction phase, thereby improving overall accuracy.The XGBoost model is configured with 100 estimators and a learning rate of 0.1.It uses the quadratic error as its objective function, which matches the optimization objective of the previous GRU model.XGBoost is excellent in processing structured data and discovering complex patterns, such as non-linear dependencies and interactions between features that the GRU may not fully detect due to its sequential nature.This synergy between GRU and XGBoost is the foundation of the proposed hybrid architecture.These predictions are then passed to the trained XGBoost regressiver, which refines them into final predictions taking account of previously observed residual behavior. This two-stage prediction process ensures that both temporal and non-linear features are taken into account, which improves the robustness and accuracy of the prediction.These include the mean square error (MSE) which more severely penalizes larger errors; the mean absolute error (MAE) which measures the mean absolute deviations; the root of the mean square error (RMSE), a normalized variant of the MSE which retains the unit scale of the predicted variables; and the certainty measure (R 2), which quantitates the fraction of variance in the dependent variable which can be predicted from the independent variables.The GRU and XGBoost components may be individually fine tuned or replaced with alternative architectures to accommodate specific use cases or data ranges.For example, the GRU layers may be replaced with long short-term memory (LSTM) layers if long term dependencies in the data are more pronounced, while the XGBoost component may be replaced with LightSM or CatSm to possibly achieve faster execution with similar accuracy.This modularity extends the applicability of the system beyond the financial markets to ranges such as predicting energy consumption, Demand forecast in supply chains, weather forecast and analysis of health data.Moreover, while deep learning models are generally resource intensive, the GRU architecture is leaner than its LSTM counterparts because it requires fewer parameters and thus reduces training time and memory requirements. Similarly, the implementation of XGBoost includes optimizations such as histogram-based decision trees, parallel processing, and regularization techniques that improve both speed and generalization.This includes sentinel scores derived from financial messages or social media, macroeconomic indicators, and inter-market signals such as rentalbyites and exchange rates.In practice, the system may be incorporated into financial trading platforms or decision systems to provide real-time price predictions and uncertainty estimates to dealers, food managers or institution investors.Finally, the invention provides a novel and technically robust solution for short term stock price prediction by combining the time modeling strength of GRU neural networks with the residual learning power of XGBoost. This hybrid architecture not only improves prediction accuracy, but also provides flexibility, scalability, and adaptability in various financial and non-financial prediction applications. Its multi-stage learning pipeline provides a more comprehensive understanding of stock price movements, making it a valuable tool in modern algoritehmic commerce and in financial analysis.List of reference characters100 System 101 Data Acquisition Module 102 Data Preprocessing Module 103 Neural Network Module 104 Gradient Boosting Module 105 Output Module
Claims
A computer-implemented system for short-term stock quote prediction, comprising: • a data acquisition module (101) configured to retrieve historical intra-pay stock data including final quotes, trade volumes, and technical indicators; • a data preprocessing module (102) configured to normalize the data and generate time consecutive samples using a sliding window approach; • a neural network module (103) comprising a gated recurrent unit (GRU) architecture configured to receive the time consecutive samples and output intermediate predictions for stock quotes; • a gradient enhancement module (104) comprising an extreme gradient boosting (XGBoost) regressor configured to receive the output of the GRU module along with associated residual features and refine the predictions by modeling non-linear patterns and residual errors; • and an output module (105) configured to present the final refined stock price prediction, wherein the GRU module is trained to minimize a loss function for the mean square error and the XGBoost module is trained to minimize a target function for the square error, thereby providing improved prediction accuracy for financial time series predictions.The system of claim 1, wherein the historical stock data is retrieved at an hourly resolution using a third party financial data API.The system of claim 1, wherein the technical indicators include a rolling standard deviation calculated over a particular time window to represent price volatility.The system of claim 1, wherein the GRU neural network comprises a first GRU layer having 128 units and a second GRU layer having 64 units, the first layer outputting sequences and the second layer outputting a fixed length context vector.The system of claim 1, wherein the XGBoost model 100 comprises estimators having a learning rate of 0.1 and uses histogram-based optimization for gradient boosting.The system of claim 1, wherein the prediction performance is evaluated using one or more metrics selected from the group consisting of the mean square error (MSE), the mean absolute error (MAE), the mean square root error (RMSE), and the R 2- square (R 2).
Citation Information
Cited By
Shield segment buoyancy lift prediction system and method based on improved hybrid neural network
CN121390145A