Next Article in Journal
Lossless Thumbnail Preservation Encryption Based on Reversible Information Hiding
Next Article in Special Issue
A Blockchain-Based Framework for Secure Data Stream Dissemination in Federated IoT Environments
Previous Article in Journal
Modeling and Analysis in the Industrial Internet with Dual Delay and Nonlinear Infection Rate
Previous Article in Special Issue
Personalized Federated Transfer Learning for Building Energy Forecasting via Model Ensemble with Multi-Level Masking in Heterogeneous Sensing Environment
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Multi-Feature Stock Index Forecasting Approach Based on LASSO Feature Selection and Non-Stationary Autoformer

1
College of Mathematics and Computer Science, Zhejiang A & F University, Hangzhou 311300, China
2
Institute of Informatics, Georg-August-Universität Göttingen, 37073 Göttingen, Germany
*
Authors to whom correspondence should be addressed.
Electronics 2025, 14(10), 2059; https://doi.org/10.3390/electronics14102059
Submission received: 3 April 2025 / Revised: 15 May 2025 / Accepted: 15 May 2025 / Published: 19 May 2025
(This article belongs to the Special Issue Feature Papers in "Computer Science & Engineering", 2nd Edition)

Abstract

:
The Chinese stock market, one of the largest and most dynamic emerging markets, is characterized by individual investor dominance and strong policy influence, resulting in high volatility and complex dynamics. These distinctive features pose substantial challenges for accurate forecasting. Existing models like RNNs, LSTMs, and Transformers often struggle with non-stationary data and long-term dependencies, limiting their forecasting effectiveness. This study proposes a hybrid forecasting framework integrating the Non-stationary Autoformer (NSAutoformer), LASSO feature selection, and financial sentiment analysis. LASSO selects key features from diverse structured variables, mitigating multicollinearity and enhancing interpretability. Sentiment indices are extracted from investor comments and news articles using an expanded Chinese financial sentiment dictionary, capturing psychological drivers of market behavior. Experimental evaluations on the Shanghai Stock Exchange Composite Index show that LASSO-NSAutoformer outperforms the NSAutoformer, reducing MAE by 8.75%. Additional multi-step forecasting and time-window analyses confirm the method’s effectiveness and stability. By integrating multi-source data, feature selection, and sentiment analysis, this framework offers a reliable forecasting approach for investors and researchers in complex financial environments.

1. Introduction

The Chinese stock market has grown rapidly, attracting investors seeking to anticipate trends for financial gain. However, stock price volatility complicates forecasting and amplifies investment risks. Accurate predictions are essential for both individuals and organizations, guiding investment decisions and risk management. For investors, forecasts support decisions on buying, selling, or applying stop-loss strategies. For organizations, reliable forecasts support trading, asset allocation, and portfolio management [1]. Yet, stock price movements are inherently complex and nonlinear [2].
As financial time series data, stock prices are highly volatile and subject to random noise, making prediction particularly challenging [3]. Over the years, researchers have explored various forecasting approaches. Traditional statistical models, such as Moving Average (MA) [4], Auto-Regressive Moving Average (ARMA) [5], and Auto-Regressive Integrated Moving Average (ARIMA) [6], as well as volatility models like Auto-Regressive Conditional Heteroskedasticity (ARCH) [7] and Generalized Auto-Regressive Conditional Heteroskedasticity (GARCH) [8], have been widely applied. Among them, ARIMA performs well on time series with clear trends and seasonality. However, ARIMA assumes smooth data, limiting its ability to model highly volatile stock prices [9]. These models depend on predefined variable selection and linear assumptions, making it difficult to capture complex, nonlinear patterns in large-scale, high-dimensional financial data. Traditional econometric methods cannot effectively handle unstructured alternative data, leading to a growing shift toward machine learning approaches.
Machine learning methods such as K-Nearest Neighbor (KNN) [10], Support Vector Machine (SVM) [11], and random forests [12] have shown promise in modeling nonlinear relationships and complex market dynamics. Nevertheless, these approaches often encounter challenges such as feature selection and overfitting. To further improve forecasting performance and autonomously extract intricate patterns from financial time series, researchers have turned to deep learning techniques. Models such as Artificial Neural Networks (ANNs), Convolutional Neural Networks (CNNs) [13], Recurrent Neural Networks (RNNs) [14], Long Short-Term Memory (LSTM) networks [15], and Gated Recurrent Units (GRUs) [16] have been widely explored. While RNNs capture temporal dependencies, they suffer from gradient instability. LSTM and GRU alleviate this issue but still face challenges such as overfitting and high training complexity.
Since Vaswani et al. introduced the Transformer in 2017 [17,18], Transformer-based models have been widely used in time series forecasting with notable success. Based on attention mechanisms, the Transformer effectively captures long-term dependencies in sequential data, addressing the limitations of traditional RNN-based models. In 2021, Zhou et al. proposed the Informer model, which optimized the attention mechanism, mitigating long-term information loss [19]. Following these advancements, researchers have further refined Transformer-based architectures and applied them to stock price prediction [20].
The non-stationary and highly volatile nature of financial markets poses considerable challenges for accurate forecasting. Traditional models often fail to capture the complex, nonlinear structures embedded in stock price movements. To address this, we propose the Non-stationary Autoformer (NSAutoformer), which extends the Non-stationary Transformers framework to the Autoformer [21,22], enhancing adaptability to evolving financial data. The model enhances adaptability by decomposing time series into trend and seasonal components and adjusting to distributional shifts. To further improve forecasting, we incorporate the LASSO algorithm and sentiment analysis, forming a multi-source data approach. The LASSO-NSAutoformer is empirically validated on the Chinese stock market index, showing stable, reliable, and superior predictive performance.
The Chinese stock market is one of the largest and most dynamic emerging markets, with a high proportion of individual investors, making it highly sensitive to sentiment. Compared to developed markets, Chinese individual investors are generally less experienced and prone to herd behavior, often reacting to media reports and peer suggestions with panic buying or selling. Moreover, government policies exert strong influence on the market. The active online environment, including financial social media and investor forums, provides a wealth of sentiment-rich data, supporting broad coverage for this study. These characteristics offer a unique opportunity to evaluate our proposed approach in a complex, sentiment-sensitive market.
The proposed framework comprises three main stages. First, the LASSO algorithm selects relevant features from 49 structured variables, including historical prices, trading data, technical indicators, composite indices, and other market information. Second, a Chinese financial sentiment dictionary is used to analyze investor comments and news, producing two sentiment indices incorporated into the forecasting model. Finally, hyperparameters are tuned using Optuna to improve model performance. Comparative experiments show that the proposed method outperforms traditional models, including RNN, GRU, LSTM, and Transformer-based architectures. Notably, LASSO-based feature selection enhances accuracy by identifying key predictors, reducing overfitting and computational complexity. Additionally, the sentiment indices capture investor psychology, which correlates with market fluctuations. By analyzing key factor interactions, this study provides deeper insight into market dynamics. Combining fundamental and sentiment-driven variables allows the model to more accurately reflect real-world market behavior and improve forecasting performance.
The main work accomplished in the article is as follows:
1.
This study incorporates multiple factors, including trading data, technical indicators, geopolitical events, epidemics, public sentiment, and cross-market influences, with a focus on sentiment analysis. A Chinese financial sentiment dictionary is constructed to extract sentiment from investor comments and news articles.
2.
We propose NSAutoformer by extending the Non-stationary Transformers framework to the Autoformer architecture. This architecture retains the series decomposition mechanism and improves the ability to model non-stationary patterns in financial time series.
3.
We further propose LASSO-NSAutoformer, a hybrid model that integrates LASSO-based feature selection and financial sentiment analysis. Comparative experiments demonstrate that it outperforms existing methods across various Chinese stock market indices.
The remainder of this paper is organized as follows. Section 2 provides a comprehensive literature review on the topic. Section 3 introduces the relevant models and algorithms, and elaborates on the structure of our proposed framework. Section 4 outlines the procedure of the experiment, including data collection, preprocessing, and parameter setting. Section 5 shows the results and analysis of a series of experiments in detail. Section 6 concludes the study and provides an assessment of possible future work.

2. Related Works

Stock price forecasting is a complex task, typically approached through three perspectives: fundamental analysis, technical analysis, and market sentiment. Fundamental analysis focuses on a company’s financial health, operational performance, industry standing, and macroeconomic environment. Technical analysis leverages historical stock prices, trading volumes, and technical indicators to predict future price movements. Sentiment analysis captures investor attitudes and emotions, which often influence market trends. For these different perspectives, researchers have explored various deep learning-based methods.

2.1. Fundamental Analysis

Fundamental analysis assesses a company’s intrinsic value to forecast stock prices. It relies on financial statements, profitability, price-to-earnings (P/E) ratio, and dividend yield. For market indices, relevant factors include exchange rates, commodity prices, and interest rates. This approach is widely applied in trading and portfolio management. Recent studies have incorporated advanced computational techniques into fundamental analysis. For instance, Nourbakhsh and Habibi proposed a hybrid model combining LSTM, CNN, and fundamental indicators (e.g., P/E ratio, profitability), achieving low prediction error in stock trend forecasting [23]. Similarly, Quadir et al. introduced a multi-layer sequential LSTM (MLS-LSTM) optimized with the Adam algorithm, achieving 98.1% accuracy on test data by analyzing historical trends and patterns [24]. Xu and Liu employed a Bi-LSTM Attention model to examine how major events, such as COVID-19 and the Russia–Ukraine conflict, influenced the volatility of crude oil futures, revealing dynamic market responses [25].

2.2. Technical Analysis

Technical analysis uses historical price data and technical indicators to identify trends and trading opportunities. Traditionally, stock forecasting relies on core price and volume indicators, including open, high, low, close, and volume (OHLCV) [26]. These indicators capture key market dynamics and are widely used in academic research [27]. Li et al. proposed MSFCE, a Transformer-based model designed for stock trend prediction. It integrates multi-scale feature encoding and graph attention to capture interactions among technical indicators [28]. Lin et al. examined technical and online sentiment measures for forecasting stock volatility, confirming that technical indicators remain the more reliable predictor [29].
Feature selection improves machine learning performance by identifying key variables and reducing multicollinearity. Htun et al. surveyed feature selection and extraction techniques used in stock market prediction [30]. They identified correlation analysis, random forests, principal component analysis (PCA), and autoencoders as the most effective and commonly used techniques. Feature selection is critical in stock prediction, as it removes irrelevant variables, reduces computation, mitigates overfitting, and enhances model accuracy.

2.3. Market Sentiment Analysis

Sentiment analysis is vital in stock forecasting as it captures investor emotions and identifies irrational behavior. Emotions like panic, greed, and optimism can significantly affect market movements. Quantifying these emotions helps interpret stock price fluctuations. Many studies have confirmed the effectiveness of sentiment analysis in financial forecasting. For example, De Oliveira Carosia et al. optimized ANN structures for analyzing sentiment in Brazilian Portuguese financial news and developed sentiment-based investment strategies [31]. Ji et al. developed an attention-based LSTM (ALSTM) model, incorporating price data, technical indicators, and social media sentiment. Results showed that combining sentiment features with technical indicators improved accuracy, with a 5-day input window performing best [32]. Liu et al. introduced SA-TrellisNet, which integrates news sentiment analysis and a sentiment attention mechanism into a TrellisNet-based model, demonstrating strong performance in index forecasting [33].

3. Methodology

This section introduces NSAutoformer, which extends the Non-stationary Transformers framework to the Autoformer architecture. In addition, we present a forecasting framework that integrates sentiment analysis and LASSO-based feature selection.

3.1. LASSO

LASSO (Least Absolute Shrinkage and Selection Operator) [34] is a regression method designed to enhance model interpretability, particularly in high-dimensional settings. It introduces L 1 regularization to shrink coefficients and perform feature selection simultaneously.
First, define X n × k to be the matrix of explanatory variables that characterize the model inputs. Y n × 1 is the response variable that characterizes the model outputs. Its mathematical form can be expressed as follows:
Y = X β + ϵ
where β is a vector of coefficients to be estimated, each corresponding to an input feature. ϵ is an error term, accounting for random noise unexplained by the model.
Conventional linear regression fits the data by minimizing the residual sum of squares (RSS). However, in high-dimensional settings, it often results in overfitting and poor interpretability due to the inclusion of irrelevant features. To mitigate this, LASSO adds an L 1 -norm penalty to the loss function, encouraging sparsity in the model coefficients.
min β i = 1 n y i j = 1 k x i j β j 2 subject to j = 1 k β j < t
where t is a pre-set threshold to control the complexity of the model. This constraint motivates the model to fit the data while limiting the size of the coefficients, thus avoiding overfitting.
The problem can be reduced to the following vector:
min β 1 n Y X β 2 2 subject to j = 1 k | β j | < t
To simplify computation and unify the objective, LASSO introduces a penalty term λ , transforming the constrained problem into an unconstrained one.
β ^ ( λ ) = arg min β 1 n Y X β 2 2 + λ j = 1 k β j
In this formula, 1 n Y X β 2 2 denotes the standardized residual sum of squares, indicating model fit. λ j = 1 k β j is the L 1 regularization term and λ is the hyperparameter that controls the strength of the regularization. By adjusting λ , LASSO can find an optimal balance between model complexity and fitting effectiveness. A larger λ increases regularization, shrinking more coefficients to zero and enabling feature selection; a smaller λ prioritizes data fit.
Therefore, LASSO is a commonly used and effective method for feature selection. In the context of economic and financial data, it helps identify key indicators and variables for constructing forecasting models.

3.2. Non-Stationary Transformers

Transformers have been widely used in time series forecasting due to their ability to capture long-range temporal dependencies [35,36,37,38,39]. However, real-world time series are often non-stationary, exhibiting time-varying means and variances, which can degrade the performance of standard attention mechanisms. Although traditional smoothing techniques such as differencing and moving averages can alleviate this issue, they often compromise the model’s ability to retain structural information. To address these limitations, we introduce the Non-stationary Transformers framework [22], a lightweight and generalizable architecture for modeling non-stationary time series. This framework forms the theoretical basis for our method, which extends its core mechanisms to the Autoformer architecture.

3.2.1. Series Stationarization

As shown in Figure 1, a normalization module and a de-normalization module perform the processing of the input and output data, respectively. By transforming the sequence data with these two modules, the model maintains better predictability. It is assumed that the input data x = [ x 1 , x 2 , , x L ] R L × N are processed as x = [ x 1 , x 2 , , x L ] R L × N , where L and N denote the input data length and number of variables. The formula can be expressed as follows:
μ x = 1 L i = 1 L x i , σ x 2 = 1 L i = 1 L ( x i μ x ) 2 , x i = 1 σ x ( x i μ x )
where μ x , σ x R N × 1 , 1 σ x denotes the element-wise division, and ⊙ denotes the element-wise product.
It is assumed that the length of the prediction is S and the output data y = [ y 1 , y 2 , , y S ] R S × N . Processing through the de-normalization module results in y ^ = [ y ^ 1 , y ^ 2 , , y ^ S ] . The formula can be expressed as follows:
y = model ( x ) , y ^ i = σ x ( y i + μ x )

3.2.2. De-Stationary Attention

This section introduces an improved attention mechanism to better capture temporal dependencies in non-stationary time series data. The architecture of the modified attention mechanism is illustrated in Figure 2.
The model receives the normalized input x = ( x 1 μ x ) / σ x and subsequently computes the new Q , K , V . The query is represented as Q = [ f ( x 1 ) , , f ( x L ) ] = ( Q 1 μ Q ) / σ x , where f ( x i ) denotes feedforward layer, and 1 R L × 1 is an all-one vector. The transformations of K and V are similar to Q . Then, a multilayer perceptron is used to learn the de-stationary factors τ , Δ from the statistics μ x , and σ x of the unstationarized original time series x . Finally, the new formula for attention is as follows:
log τ = MLP ( σ x , x ) , Δ = MLP ( μ x , x )
Attention ( Q , K , V , τ , Δ ) = Softmax τ Q K + 1 Δ d k V
where τ = σ x 2 R + and Δ = K μ Q R L × 1 represent the positive scale scalar and shifting vector. Now, the attention mechanism combines the information of the original series with the attention information of the stationarized series. It can improve the predictability of the non-stationary series while maintaining the temporal dependencies of the original series.

3.3. Autoformer

The Autoformer enhances the Transformer architecture by introducing a novel self-attention mechanism, improving both computational efficiency and forecasting accuracy [21]. It employs an Auto-Correlation mechanism to identify dependencies across series and effectively aggregate information, capturing both local and global patterns. It integrates time series decomposition with a progressive decomposition module to overcome limitations of traditional preprocessing-based methods. The model consists of three core components: Decomposition Block, Auto-Correlation Mechanism, and Encoder–Decoder Architecture. Its structure is illustrated in Figure 3.

3.3.1. Decomposition Block

The Autoformer model’s series decomposition block splits time series into trend and seasonal components. The block maintains time series length with padding and extracts seasonal terms by subtracting trend terms. To effectively extract the trend information, a moving average method is used. For series X R L × d of length L, the processing results in the following series:
X t = AvgPool ( Padding ( X ) )
X s = X X t
where X s , X t R L × d denote the seasonal part and the extracted trend part, respectively. The equation is summarized by X s , X t = SeriesDecomp ( X ) .
The inputs to the encoder are series X en R I × d of length I time steps in the past, and the input to the decoder consists of a seasonal part X des R ( I 2 + O ) × d and a trend part X det R ( I 2 + O ) × d , O denotes the padding length serving as a placeholder for future predictions.
X ens , X ent = SeriesDecomp X en I 2 : I
X des = Concat ( X ens , X 0 )
X det = Concat ( X ent , X Mean )
where X ens and X ent R I 2 × d represent the seasonal and trend-cyclical components of X en respectively. The matrices X 0 and X Mean R O × d are placeholder sequences filled with zeros and the mean value of X en respectively.

3.3.2. Encoder and Decoder

The encoder module is concerned with the modeling of the seasonal part, and the output contains the past seasonal information, which will be used as mutual information to help the decoder adjust the forecasting results. Assuming we have N encoder layers, the l-th encoder layer X en l = Encoder ( X en l 1 ) has the following internal structure:
S en l , 1 , = SeriesDecomp Auto Correlation ( X en l 1 ) + X en l 1
S en l , 2 , = SeriesDecomp FeedForward ( S en l , 1 ) + S en l , 1
where “−” is the portion of the trend that was excluded. X en l = S en l , 2 , l { 1 , , N } denotes the output of the l-th encoder layer, and X en 0 is the embedded X en . S en l , i , i { 1 ,   2 } denotes the seasonal component after the i-th series of the decomposition block in the l-th layer. Finally, Auto Correlation ( · ) here replaces self-attention.
The decoder consists of two parts: a cumulative operation for trend components and a stacked autocorrelation mechanism for seasonal components. Assuming that there are M decoding layers, using the latent variables X en N from the encoder, the equations for the l-th decoder layer can be summarized as X de l = Decoder X de l 1 , X en N . The internal details are as follows:
S de l , 1 , T de l , 1 = SeriesDecomp Auto Correlation ( X de l 1 ) + X de l 1
S de l , 2 , T de l , 2 = SeriesDecomp Auto Correlation ( S de l , 1 , X en N ) + S de l , 1
S de l , 3 , T de l , 3 = SeriesDecomp FeedForward ( S de l , 2 ) + S de l , 2
T de l = T de l 1 + W l , 1 T de l , 1 + W l , 2 T de l , 2 + W l , 3 T de l , 3
where X de l = S de l , 3 , l { 1 , , M } denotes the output of the l-th decoder layer. X de 0 embedding from X des is used for deep transform and T de 0 = X det is used for accumulation. S de l , i , T de l , i , i { 1 , 2 , 3 } denote the seasonal component and the trend component following the i-th series of decomposition block in l-th layer, respectively. W l , i , i { 1 , 2 , 3 } denotes the i-th extracted trend T de l , i of the projection layer. Finally, the predicted value, as W S X de M + T de M , is obtained from the sum of the two decomposition components, where W S projects the seasonal component X de M of the deep transformation to the target dimension.

3.3.3. Autocorrelation Mechanism

The autocorrelation module, as demonstrated in Figure 4, is designed to identify period-based dependencies. It achieves this by calculating the autocorrelation coefficients of the series. Then, it rolls the series to perform time-delay aggregation of similar sub-series. The correlation between the original series and its lagged series is calculated. This helps identify periodically similar sub-series.
R X X ( τ ) = lim L 1 L t = 1 L X t X t τ
For a real discrete-time process { X t } , the autocorrelation R X X ( τ ) can be obtained by the equation. It quantifies the time-delay similarity between { X t } and its lagged counterpart { X t τ } . By selecting the top-k delays with the highest autocorrelation scores, dominant periodic patterns in the sequence can be identified. To utilize these patterns, a time-delay aggregation mechanism is used to aligns sub-series at the same phase positions across the estimated periods. Unlike conventional dot-product attention, this method explicitly captures periodic dependencies and performs weighted aggregation using softmax-normalized autocorrelation scores.
For the single-head case and time series X of length L, after the projection layer (projector), the query Q , the key K , and the value V can be obtained. Thus, it can seamlessly replace the self-attention mechanism.
τ 1 , , τ k = arg Topk τ { 1 , , L } ( R Q , K ( τ ) )
R ^ Q , K ( τ 1 ) , , R ^ Q , K ( τ k ) = SoftMax ( R Q , K ( τ 1 ) , , R Q , K ( τ k ) )
Auto Correlation ( Q , K , V ) = i = 1 k Roll ( V , τ i ) R ^ Q , K ( τ i )
where k = c × log L in the arg Topk ( · ) operator, and c is the hyperparameter. The autocorrelation between the series Q and K is denoted as R Q , K . Roll ( X , τ ) is an operation on X with time delay τ , and the element moved out of the first position will be reintroduced in the last position. In the encoder–decoder autocorrelation, K and V come from the encoder X en N and are resized to length O. Q is from the previous block of the decoder.
In order to improve the computational efficiency, the model is based on the Winer–Khinchin theory and the autocorrelation coefficients are computed using the Fast Fourier Transform (FFT):
S X X ( f ) = F X t F * X t = X t e i 2 π t f d t X t e i 2 π t f d t ¯
R X X ( τ ) = F 1 S X X ( f ) = S X X ( f ) e i 2 π f τ d f
where τ { 1 , , L } , F denotes the FFT, and * denotes the conjugate operation. This is achieved by converting the signal to frequency S X X ( f ) and then calculating R X X ( τ ) through the frequency domain.

3.4. Non-Stationary Autoformer

Non-stationary Autoformer is a novel architecture designed for non-stationary time series forecasting. It extends the Autoformer backbone by incorporating key components from the Non-stationary Transformers framework.
Compared to Autoformer, NSAutoformer introduces a normalization-based preprocessing module. This module stabilizes the input distribution by extracting the mean and standard deviation of the input sequence. These statistics are subsequently fed into multilayer perceptrons to produce two learnable de-stationary factors: a global scaling factor ( τ ) and a temporal shifting vector ( Δ ). These de-stationary factors are then injected into the autocorrelation mechanism to modulate temporal dependency modeling.
Instead of directly relying on raw autocorrelation values, De-stationary autocorrelation modulates the correlation scores using these adjustment factors. This design allows the model to better capture evolving patterns and distributional shifts over time. The time-delay aggregation process follows that of Autoformer. NSAutoformer integrates non-stationary-aware attention with the efficient autocorrelation structure. At the same time, it significantly improves robustness to time-varying distributions.
By integrating these modules, NSAutoformer enhances the adaptability of the baseline to non-stationary environments. It retains the ability to model trend and seasonal components through decomposition. As a result, the model can better capture complex, time-varying dynamics in real-world time series. It ensures stable and accurate forecasting of non-stationary data across domains such as finance, energy, and macroeconomics.

3.5. Sentiment Analysis

In finance, sentiment analysis is primarily conducted using sentiment dictionaries, machine learning, and deep learning [40,41]. Sentiment dictionaries offer a straightforward and efficient method for analyzing financial texts rich in domain-specific terms. As our experiments used unlabeled social media texts, sentiment dictionaries were a suitable choice. They do not require labeled data, thus reducing both time and cost. Moreover, investor comments tended to be consistent and repetitive, allowing a fixed vocabulary list to classify sentiments effectively with low computational cost.
To improve sentiment analysis, we developed a financial sentiment dictionary by extending an existing lexicon to better capture financial terms and sentiment nuances. The processes of sentiment categorization and feature construction are illustrated in Figure 5.

3.5.1. Construction of Financial Sentiment Dictionary

We integrated two Chinese financial sentiment dictionaries developed by Jiang Fuwei and Yao Jiaquan to construct an enhanced lexicon [42,43,44]. Their original dictionaries were built using data mining and deep learning techniques to analyze both formal sources (e.g., annual reports) and informal sources (e.g., social media data). The formal sentiment dictionary categorized annual reports as positive or negative based on cumulative stock returns within three trading days of release. Investor posts from A-share companies on Xueqiu and Eastmoney were analyzed to extract market sentiment from informal sources.

3.5.2. Sentiment Index Calculation

In this study, investor posts from social platforms were transformed into sentiment scores using the constructed dictionary. The computation process begins with segmentation and lexical labeling of Chinese sentences, followed by sentiment word extraction. Sentiment words such as increase, bullish, and optimistic are assigned a score of +1, whereas negative words like decline, bearish, and pessimistic are assigned a score of –1. If a sentiment word is preceded by a degree adverb or a negation, its score is multiplied by the corresponding weight. Degree adverbs are weighted as follows: extreme = 4, very = 3, more = 2, and ish = 1. A negation word, such as not or never, is assigned a weight of −1. This process continues sequentially until the entire text is processed. Finally, the scores for all words in a sentence are summed to generate the final sentiment score.
Example 1
(Positive Comment). “The market is very bullish today and expected to rise further”.
  • The word bullish is a positive sentiment word ( + 1 ), preceded by the degree adverb very: (weight = 3) → score = 3 × 1 = + 3 .
  • The word rise is a positive sentiment word ( + 1 ), with no modifier → score = + 1 .
  • Final sentiment score: + 3 + 1 = + 4 .
Example 2 
(Negative Comment). “The outlook is not optimistic and prices may slightly decline”.
  • The word optimistic is a positive sentiment word ( + 1 ), but is preceded by the negation not: (weight = 1 ) → score = 1 × 1 = 1 .
  • The word decline is a negative sentiment word ( 1 ), preceded by the degree adverb slightly: (weight = 1) → score = 1 × ( 1 ) = 1 .
  • Final sentiment score: 1 + ( 1 ) = 2 .
The daily sentiment index, serving as a proxy for investor sentiment, is computed as the average sentiment score across all posts on a given day, where i represents the i-th post, and n denotes the total number of posts.
S e n t i m e n t i n v e s t o r = 1 n i = 1 n s c o r e i
The same method was applied to compute sentiment scores for financial news. Long articles were split into sentences, which were analyzed sequentially and aggregated into an overall sentiment score. Due to their length, news articles may exhibit inflated sentiment scores. To mitigate this effect, each article was classified as positive, negative, or neutral based on its aggregated score. The calculation formula is as follows:
S e n t i m e n t n e w s = N p o s N n e g N p o s + N n e g
where N p o s and N n e g denote the number of positive and negative news articles for the day, respectively.

3.6. Forecasting Framework

To capture complex market behaviors, we designed LASSO-NSAutoformer, a hybrid model integrating feature selection, sentiment analysis, and deep learning. It combines filtered structured features and sentiment signals from unstructured text to form a unified forecasting input. This integration enables a comprehensive representation of market dynamics. As illustrated in Figure 6, the proposed method consisted of three main stages: data collection, data processing, and empirical forecasting.
Step 1: Data collection. Factors were collected from various domains and categorized into structured and unstructured sources. Structured data included historical price series, trading data, technical indicators, composite indices, and other financial market variables. Unstructured data consisted of investor comments and financial news.
Step 2: Data processing. Structured variables were preprocessed, and LASSO was applied to select key features, reducing redundancy. For unstructured text, sentiment scores were computed using a domain-specific financial sentiment dictionary, yielding investor and news sentiment indices. These indices were combined with LASSO-selected features to form the final model input.
Step 3: Empirical forecasting. The combined input was fed into NSAutoformer. Several comparative experiments were conducted across different feature sets, selection methods, and forecasting models to evaluate the robustness and accuracy of the proposed approach. Additionally, sensitivity tests on time window lengths and forecast horizons were performed to assess stability.

3.7. Evaluation Metrics

To evaluate the model’s forecasting accuracy, we used four standard regression metrics: MAE, RMSE, MAPE, and R2:
MAE = 1 n i = 1 n | y ^ i y i |
RMSE = 1 n i = 1 n ( y ^ i y i ) 2
MAPE = 1 n i = 1 n | y ^ i y i | y i × 100 %
R 2 = 1 i = 1 n ( y i y ^ i ) 2 i = 1 n ( y i y ¯ i ) 2
where y ^ i is the predicted value, y i is the true value, y ¯ is the average of y i , and n is the sample size. MAE measures the average absolute error, while RMSE reflects error magnitude in the same units as the target. MAPE expresses the average percentage error, and R2 quantifies the proportion of variance explained by the model.

4. Experiments

4.1. Data Preparation

In experiments, we found that individual stocks are more volatile due to firm-specific or industry factors, while market indices are better suited for research [45]. To ensure representativeness, we selected the Shanghai Securities Exchange Composite Index (SSECI), which includes all A-share stocks on the Shanghai Stock Exchange (SSE) and covers a wide range of industries, making it the most comprehensive stock index in China’s financial market. Table 1 shows a sample of SSECI price and trading data, obtained using the efinance package in Python 3.13.2 [46]. The dataset spans from 2 January 2019 to 8 February 2024. Figure 7 illustrates an exploratory analysis of SSECI price trends.
We used TA-Lib (Technical Analysis Library) to calculate 28 commonly used technical indicators based on price and trading data. Details are listed in Table 2. Trend indicators identify market direction—uptrend, downtrend, or consolidation [47]. Momentum indicators measure price movement speed, detecting overbought or oversold conditions. Volume indicators assess trend strength and market interest through trading volume changes.
In addition, we selected 12 variables categorized into two groups: (1) Composite indices: Daily Geopolitical Risk Index (GPRD), Daily Infectious Disease Equity Market Volatility Index (IDEMVI), search volume on Google Trends (GT), and Baidu Index (BI). (2) Other financial markets: COMEX gold futures closing price (GC), West Texas Intermediate (WTI), Dow Jones Industrial Average (DJIA), NASDAQ Composite Index (NASDAQ), S&P 500 Index (S&P), USD to CNY Exchange Rate (USDCNY), U.S. Dollar Index (DXY), and HANG SENG INDEX (HSI). Table 3 summarizes the details of these two categories.
In the composite index, we considered the impact of geopolitics and COVID-19 on the stock market. The GPRD [48] reflects a measure of geopolitical events and associated risks, based on newspaper statistics. Prior studies have shown that wars and crises typically reduce investment, depress stock prices, and lower employment, indicating a strong link between geopolitical risks and economic performance. The IDEMVI [49] captures the relationship between infectious disease outbreaks and equity market volatility, particularly during the COVID-19 period. GT [50] and BI [51] represent search activity on Google and Baidu, the largest search engines globally and in China, respectively. These indices reflect keyword search volumes and serve as proxies for market attention and interest preferences.
In recent years, globalization and financial integration have strengthened linkages among regional markets. Correlations and risk spillovers across markets have attracted significant scholarly attention, particularly during crises when such linkages intensify. Asset price movements often propagate across markets, forming a complex network of interdependencies. All variables related to other financial markets were obtained using the efinance package.
In summary, 49 candidate variables were collected for structured data. Regarding unstructured text data, investor comments were collected from the Eastmoney Guba forum [52] as shown in Table 4. Financial news was sourced from China News [53] (A-share section) and macro/news finance columns on China.com.cn [54]. Additional policy-related content, including current affairs, key events, press conferences, and policy interpretations, was collected from the official website of the China Securities Regulatory Commission (CSRC) [55]. All text data were obtained using the Bazhuayu web crawler [56], covering the period from 2 January 2019 to 8 February 2024 [57].

4.2. Data Preprocessing

The dataset was divided into training (70%), validation (10%), and test sets (20%). Prior to experimentation, data normalization was applied to ensure numerical stability and feature comparability. Each feature was standardized by computing its mean and variance independently. The formula is as follows:
X s c o r e = X o r g X m e a n X s t d
where X o r g denotes the original data, X m e a n denotes the mean of the data, X s t d denotes the standard deviation of the input data, and X s c o r e denotes the standardized result.
Excessive features can hinder model efficiency and forecasting accuracy, so LASSO was applied for feature selection by compressing some coefficients to zero. The LASSO model was optimized using grid search and 10-fold cross-validation, resulting in features with thresholds greater than zero, as shown in Table 5. Spearman correlations among the selected features are shown in Figure 8.
For text data, we applied the constructed Chinese financial sentiment dictionary after preprocessing to extract investor and news sentiment indices. To minimize the impact of extreme values, obvious outliers were removed. In total, 4,529,650 valid comments were retained. Figure 9 illustrates the complete data processing pipeline, from raw data acquisition to the construction of model input features.

4.3. Hyperparameters Setting

Hyperparameter tuning was performed using Optuna, which applies Bayesian optimization with a Tree-structured Parzen Estimator (TPE) to efficiently search the parameter space. The framework minimizes validation loss across multiple trials and selects the best configuration accordingly. Table 6 defines the search space and Table 7 reports the optimal hyperparameters for each model. Mean absolute error (MAE) was used as the loss function. Training was conducted for up to 50 epochs with early stopping to prevent overfitting and ensure convergence.

5. Results and Analysis

We adopted the moving window approach, a common method in time series forecasting. This approach uses a sliding window over the data, allowing the model to generate predictions at each time step. In our experiment, features from the trading day T were used to predict the price on the following day, T + 1 .

5.1. Feature Set Evaluation

Given the inclusion of multiple data sources, we conducted an experiment to evaluate the predictive performance of different feature sets. Table 8 presents the results of five candidate variable sets using the proposed NSAutoformer. The results show that adding technical indicators, composite indices, and financial market data to the base set reduces forecasting errors and improves accuracy. This indicates that incorporating a wider range of relevant features can enhance price forecasting capability. Notably, the lowest MAE was observed in Set 2 , which includes price, trading, and technical indicators, confirming the positive impact of technical factors. However, when all variables are included ( Set 5 ), performance declines, indicating that excessive features may introduce noise and increase overfitting risk. To mitigate this, we apply the LASSO algorithm for feature selection.
Subsequently, we constructed new feature sets by combining the LASSO-filtered variables with sentiment indices. As shown in Table 9, Set 6 , which contains only the filtered features, outperforms all raw feature sets (Sets 1–5), indicating that LASSO improves model accuracy by removing irrelevant or noisy variables. Compared to the best raw set ( Set 2 ), Set 6 reduces MAE from 20.718376 to 20.350271 and increases R2 from 0.967436 to 0.970052.
Furthermore, incorporating sentiment indices (Sets 7–9) improved model performance. The best result occurred when both investor and news sentiment were included, yielding the lowest MAE (19.253584) and highest R2 (0.972357). These findings confirm the complementary benefits of feature selection and sentiment integration. LASSO reduces redundancy, while sentiment indices capture psychological factors often missing from traditional financial features.
The consistent improvement suggests that psychological factors significantly influence market dynamics. Integrating sentiment from multiple sources improves index prediction, with broader group sentiment yielding better results. Investor sentiment reflects short-term fluctuations driven by individual behavior, while news sentiment captures broader market tone and policy direction. Together, these two sentiment sources provide complementary information. These findings further support integrating sentiment analysis into the forecasting framework, allowing the model to adapt to dynamic market conditions.
We also compared several feature selection algorithms, including XGBoost, Random Forest, CatBoost, and AdaBoost, which are widely used in machine learning. To ensure fairness, model structures and hyperparameter tuning followed settings from relevant studies. As shown in Table 10, all algorithms improved forecasting accuracy, with LASSO achieving the lowest error and best overall fit.
Among the feature selection methods compared, LASSO-filtered features achieved the best forecasting accuracy. Unlike ensemble-based methods like Random Forest or XGBoost, which tend to produce dense feature sets requiring extra tuning, LASSO yields sparse and interpretable models with fewer variables. This aligns with the goals of economic and financial forecasting, where transparency and stability are essential. Moreover, its simplicity, computational efficiency, and robustness to multicollinearity make LASSO well suited for high-dimensional financial time series.

5.2. Forecasting Results

This section presents comparative experiments evaluating different forecasting models on the SSECI dataset. The evaluation focuses on one-step forecasting, with results reported using MAE, RMSE, MAPE, and R2, as shown in Table 11. The results reveal a clear pattern: advanced model architectures generally yield better predictive performance. In particular, Transformer-based models consistently outperform RNN-based models, with NSAutoformer delivering the most accurate results overall.
The performance of the basic RNN model is the weakest, underscoring its limitations in capturing long-range dependencies and handling high-dimensional feature inputs. Although GRU (MAE: 34.960663, RMSE: 47.148529, MAPE: 0.011468, R2: 0.905338) and LSTM (MAE: 35.166011, RMSE: 47.015923, MAPE: 0.011536, R2: 0.905870) improve upon RNN, they remain inferior to their bidirectional versions and Transformer-based models.
The vanilla Transformer (MAE: 35.786094, RMSE: 43.768764, MAPE: 0.011411, R2: 0.918423), while more effective than RNN-based models, was surpassed by its enhanced variants. Informer (MAE: 33.746243, RMSE: 43.102985, MAPE: 0.010937, R2: 0.920886) improved accuracy through the ProbSparse self-attention mechanism, which reduces computational cost by focusing on dominant queries. Autoformer further improved forecasting by decomposing time series into trend and seasonal components.
Among Transformer-based models, the proposed NSAutoformer is built on the Autoformer architecture. It incorporates non-stationary modeling to improve adaptability to dynamic data distributions. It adapts the autocorrelation mechanism to handle distributional shifts, improving ability to represent complex, evolving temporal patterns. Without relying on feature selection or sentiment inputs, NSAutoformer already achieved the best results across all metrics (MAE: 21.098995, RMSE: 27.456692, MAPE: 0.006787, R2: 0.967898). These results demonstrate NSAutoformer’s architectural advantage in capturing both structural and statistical complexity, highlighting the importance of models tailored to non-stationary time series forecasting.
Building on the single-model results, we evaluated a hybrid forecasting framework that integrates LASSO-based feature selection and sentiment analysis. As shown in Table 12 and Figure 10, incorporating filtered features and sentiment indices significantly reduced MAE, RMSE, and MAPE values, while consistently improving R2. These results highlight the benefit of combining data-driven feature selection with sentiment inputs, which together enrich the input space.
Notably, the hybrid model reduced MAE by 58.28%, 38.82%, 28.31%, 35.42%, 35.71%, 24.65%, 21.44%, 2.57%, 6.75%, and 8.75% relative to individual baseline models. These results clearly demonstrate the advantage of the proposed framework over individual models. Figure 11 further illustrates forecasting performance across all metrics, highlighting the superiority of the hybrid approach.
However, within the hybrid models, Transformer and Informer underperformed compared to RNN. This may be due to their architectural complexity: although effective in high-dimensional settings, they require large datasets and rich feature representations to perform optimally. In contrast, LASSO reduces dimensionality, potentially limiting these models’ capacity to capture nonlinear interactions. As a result, they become less effective than RNN-based models when inputs are simplified. This finding aligns with machine learning theory, which suggests simpler models often generalize better with limited input spaces.
Among all hybrid configurations, LASSO-NSAutoformer achieved the best performance (MAE: 19.253584, RMSE: 25.478617, MAPE: 0.006189, R2: 0.972357). These results provide strong empirical support for the proposed framework, highlighting both its architectural advantage and its effectiveness in integrating heterogeneous data sources to enhance predictive accuracy.

5.3. Multi-Step Forecasting Evaluation

To assess the model’s temporal scalability, we conducted multi-step forecasting using a moving window across horizons of 3, 5, 7, 10, and 12 steps. This setup enables comprehensive evaluation across short-, medium-, and long-term forecasting tasks. Table 13 presents the error metrics for each forecast horizon, followed by an analysis of performance variation across temporal scales. Figure 12 visually compares the prediction results of different models across various forecasting horizons.
The multi-step forecasting results provide strong evidence for the effectiveness of LASSO-NSAutoformer, particularly in terms of accuracy and stability across different horizons. Specifically, it achieved the lowest MAE and MAPE in short-term (three-step: MAE 28.095316, MAPE 0.009050) and medium-term forecasts (five-step: MAE 37.026203, MAPE 0.011978), significantly outperforming other models. These results confirm the model’s strong ability to capture market dynamics, which is essential for financial forecasting.
As the forecasting horizon increased to 7, 10, and 12 steps, all models showed reduced accuracy. However, LASSO-NSAutoformer consistently maintained the lowest errors and showed slower performance degradation than other models. This stability across longer horizons highlights the model’s adaptability to evolving market dynamics and supports its application in long-term forecasting. In practice, reliable multi-step forecasts help investors and portfolio managers anticipate future trends across various time horizons, enabling more informed decisions and effective risk management.

5.4. Time Window Analysis

The moving window approach is widely used in stock price forecasting, where window length is a critical parameter. It structures historical data into a format suitable for neural networks, directly influencing model performance. Generally, shorter windows capture short-term volatility but may miss long-term trends, while longer windows reduce noise but are less responsive to rapid changes. Thus, balancing short-term and long-term effects is key. Prior studies commonly use window lengths ranging from 5 to 30 days.
Table 14 shows model performance across window lengths from 5 to 30 days, evaluated using MAE, RMSE, MAPE, and R2. The results indicate that longer windows generally lead to higher error values and reduced model performance. Since the experiments focus on single-step forecasting, a window length of 5 to 15 days is optimal, with most models performing best at 10 days.
As shown in Figure 13, LASSO-NSAutoformer consistently outperformed all other models across window lengths, with minimal performance degradation as the window increased. Its stable accuracy over longer historical spans suggests an effective balance between short-term fluctuations and long-term dependencies. This adaptability enhances the model’s practicality, enabling it to accommodate varying historical lengths common in real-world financial forecasting. Overall, the results confirm the framework’s strength in predictive stability and generalizability.

5.5. Further Verification

To further validate the generalizability of our proposed forecasting approach, we conducted additional experiments on three Chinese stock indices: the Shenzhen Stock Exchange Composite Index (SZSECI), the Growth Enterprise Index (GEI), and the CSI 300 Index. Following the same methodology, structured variables and investor sentiment data were collected and processed. Sentiment indices were derived from 323,764 (SZSECI), 624,311 (GEI), and 39,488 (CSI 300) valid investor comments from related forums. These sentiment indices were combined with LASSO-selected variables to form the final input for model forecasting. The corresponding results are presented in Table 15.
The proposed model showed stable and accurate performance across all three structurally distinct indices, rather than being effective in only one market condition. This consistency highlights the model’s ability to capture diverse market dynamics: SZSECI reflects overall market trends, GEI emphasizes volatile, growth-oriented stocks, and CSI 300 tracks stable, blue-chip firms. These indices differ in volatility, investor composition, and information sensitivity, offering a robust test for model adaptability. The model’s strong performance across all indices confirms its adaptability to varied financial environments.
Once again, integrating LASSO-selected features with sentiment analysis significantly improved forecasting performance across all models and indices. For instance, in the SZSECI, the MAE decreased from 98.346413 in the single Autoformer model to 94.025230 in the LASSO-enhanced Autoformer, eventually reaching an optimal value of 88.166016 in the LASSO-NSAutoformer. Similar improvements were observed for both GEI and CSI 300.
Overall, these findings demonstrate that the proposed framework is not only effective in a single setting, but also generalizes well to multiple market environments. Its consistent performance across structurally different markets suggests potential for broader application in financial forecasting tasks.

6. Conclusions

Stock market forecasting is a critical yet challenging task, primarily due to the volatility and non-stationarity of financial time series. This study proposes LASSO-NSAutoformer, a hybrid forecasting model for Chinese stock index that integrates multi-source data, LASSO feature selection, and deep learning. The framework consists of three components: (1) collecting 49 structured financial variables, with LASSO used to remove redundancy and retain key predictors; (2) constructing a Chinese financial sentiment dictionary to quantify market sentiment from investor comments and financial news; (3) integrating structured and sentiment-based features into a deep learning model that extends Autoformer to better capture non-stationary patterns.
This study conducts comparative experiments to evaluate the proposed framework. First, we examined the contributions of trading data, technical indicators, composite indices, and other market-related variables. Results showed that these variables contribute unevenly to prediction accuracy, highlighting the need to retain informative features and eliminate redundancy. Next, we evaluated the impact of sentiment by incorporating investor and news sentiment indices. These indices were derived from a domain-specific Chinese financial sentiment dictionary. Incorporating sentiment significantly improved forecasting accuracy, indicating that behavioral signals offer valuable information beyond traditional financial metrics. To optimize input features, we compared five selection algorithms (CatBoost, AdaBoost, XGBoost, Random Forest, and LASSO) and found LASSO consistently yielded the best results, supporting its use in the proposed framework.
To evaluate model effectiveness, we applied NSAutoformer to four major Chinese stock indices: SSECI, SZSECI, GEI, and CSI 300. In benchmark comparisons with nine deep learning models, NSAutoformer consistently achieved the best predictive performance, confirming its ability to capture complex temporal dependencies in financial time series. Building on this foundation, we developed LASSO-NSAutoformer, a hybrid model that integrates LASSO-based feature selection, sentiment analysis, and NSAutoformer. Compared to both single and hybrid baseline models, LASSO-NSAutoformer achieved superior results across all evaluation metrics. It also showed lower error growth and more stable performance across different forecast horizons and input window lengths. These findings demonstrate the model’s adaptability to dynamic and evolving market patterns, which is essential for practical stock index forecasting.
In summary, this study proposes and systematically validates a deep learning-based forecasting framework, demonstrating its effectiveness across multiple dimensions. First, the use of multi-source data provides a diverse set of predictors, enabling the model to capture complex market dynamics. Second, the integration of sentiment analysis allows the model to reflect investor responses and market tone. Third, LASSO-based feature selection enhances interpretability by identifying key predictors and reducing redundancy. Finally, the introduction of NSAutoformer yields superior predictive performance compared to existing models, confirming the reliability of deep learning in stock index forecasting.
By extracting sentiment from news, investor comments, and social media, the method helps assess market expectations and investor psychology. This approach is useful for individual investors, asset managers, and financial institutions. It shows the value of combining deep learning with sentiment analysis in financial forecasting and points to future directions for both research and practice.
Despite improved forecasting accuracy, several limitations remain. First, although the model integrates fundamentals, technical indicators, and sentiment, it excludes macroeconomic variables such as GDP growth, interest rates, and inflation expectations. Including these in future work may help capture macroeconomic cycles and enhance model interpretability. Second, the model is only validated on the Chinese stock market. Future research should extend it to developed markets and other asset classes (e.g., futures, bonds, foreign exchange). Third, the integration of feature selection, sentiment analysis, and deep neural networks may incur high computational costs, especially in large-scale applications. Future work should evaluate training and inference efficiency, and explore lightweight alternatives or model pruning. Finally, as stock indices are heavily influenced by a few high-weighted constituents, constructing features based on these components may enhance index-level forecasting accuracy.

Author Contributions

Conceptualization, Z.S.; methodology, Z.S.; software, Z.S.; validation, Z.S. and Q.L.; formal analysis, Z.S.; investigation, Z.S.; resources, Z.S.; data curation, Z.S.; writing—original draft, Z.S.; writing—review and editing, Z.S., Q.L., Y.H. and H.L.; visualization, Z.S.; supervision, Y.H. and H.L.; project administration, Z.S.; funding acquisition, H.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Humanity and Social Science Foundation of the Ministry of Education of China (No. 18YJA630037, 21YJA630054), and the Zhejiang Province Soft Science Research Program Project (No. 2024C350470).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

All data used in this study were obtained from publicly available sources, as detailed in the manuscript. The financial market data (including stock prices and trading data) are available from the efinance package (https://github.com/Micro-sheep/efinance, accessed on 14 May 2025) and Eastmoney (https://www.eastmoney.com/, accessed on 14 May 2025). The composite indices data were taken from https://www.matteoiacoviello.com/gpr.htm (accessed on 14 May 2025), https://www.policyuncertainty.com/infectious_EMV.html (accessed on 14 May 2025), https://trends.google.com/trends/ (accessed on 14 May 2025), and https://index.baidu.com/v2/index.html (accessed on 14 May 2025). The text data were taken from https://guba.eastmoney.com/ (accessed on 14 May 2025), https://www.chinanews.com/ (accessed on 14 May 2025), http://www.china.com.cn/ (accessed on 14 May 2025), and http://www.csrc.gov.cn/csrc/xwfb/index.shtml (accessed on 14 May 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Chen, Y.; Wu, J.; Wu, Z. China’s commercial bank stock price prediction using a novel K-means-LSTM hybrid approach. Expert Syst. Appl. 2022, 202, 117370. [Google Scholar] [CrossRef]
  2. Ayyappa, Y.; Kumar, A.P.S. Stock market prediction with political data Analysis (SP-PDA) model for handling big data. Multimed. Tools Appl. 2024, 83, 80583–80611. [Google Scholar] [CrossRef]
  3. Zhang, Q.; Qin, C.; Zhang, Y.; Bao, F.; Zhang, C.; Liu, P. Transformer-based attention network for stock movement prediction. Expert Syst. Appl. 2022, 202, 117239. [Google Scholar] [CrossRef]
  4. Billah, M.M.; Sultana, A.; Bhuiyan, F.; Kaosar, M.G. Stock price prediction: Comparison of different moving average techniques using deep learning model. Neural Comput. Appl. 2024, 36, 5861–5871. [Google Scholar] [CrossRef]
  5. An, Y.; Wang, D.; Chen, L.; Zhang, X. TCP-ARMA: A Tensor-Variate Time Series Forecasting Method. IEEE Trans. Autom. Sci. Eng. 2024, 21, 2251–2263. [Google Scholar] [CrossRef]
  6. Behera, J.; Kumar, P. An approach to portfolio optimization with time series forecasting algorithms and machine learning techniques. Appl. Soft Comput. 2025, 170, 112741. [Google Scholar] [CrossRef]
  7. Setoudehtazangi, F.; Manouchehri, T.; Nematollahi, A.; Caporin, M. Time series clustering based on latent volatility mixture modeling with applications in finance. Math. Comput. Simul. 2024, 223, 543–564. [Google Scholar] [CrossRef]
  8. Zolfaghari, M.; Gholami, S. A hybrid approach of adaptive wavelet transform, long short-term memory and ARIMA-GARCH family models for the stock index prediction. Expert Syst. Appl. 2021, 182, 115149. [Google Scholar] [CrossRef]
  9. Singh, S.; Parmar, K.S.; Kumar, J. Development of multi-forecasting model using Monte Carlo simulation coupled with wavelet denoising-ARIMA model. Math. Comput. Simul. 2025, 230, 517–540. [Google Scholar] [CrossRef]
  10. Behera, J.; Pasayat, A.K.; Behera, H.; Kumar, P. Prediction based mean-value-at-risk portfolio optimization using machine learning regression algorithms for multi-national stock markets. Eng. Appl. Artif. Intell. 2023, 120, 105843. [Google Scholar] [CrossRef]
  11. Kuo, R.; Chiu, T.H. Hybrid of jellyfish and particle swarm optimization algorithm-based support vector machine for stock market trend prediction. Appl. Soft Comput. 2024, 154, 111394. [Google Scholar] [CrossRef]
  12. Xu, Y.; Dai, Y.; Guo, L.; Chen, J. Leveraging machine learning to forecast carbon returns: Factors from energy markets. Appl. Energy 2024, 357, 122515. [Google Scholar] [CrossRef]
  13. Beniwal, M.; Singh, A.; Kumar, N. Forecasting multistep daily stock prices for long-term investment decisions: A study of deep learning models on global indices. Eng. Appl. Artif. Intell. 2024, 129, 107617. [Google Scholar] [CrossRef]
  14. Aydogan-Kilic, D.; Selcuk-Kestel, A.S. Modification of hybrid RNN-HMM model in asset pricing: Univariate and multivariate cases. Appl. Intell. 2023, 53, 23812–23833. [Google Scholar] [CrossRef]
  15. Zhang, Z.; Liu, Q.; Hu, Y.; Liu, H. Multi-feature stock price prediction by LSTM networks based on VMD and TMFG. J. Big Data 2025, 12, 74. [Google Scholar] [CrossRef]
  16. Gupta, U.; Bhattacharjee, V.; Bishnu, P.S. StockNet—GRU based stock index prediction. Expert Syst. Appl. 2022, 207, 117986. [Google Scholar] [CrossRef]
  17. Liu, Z.; Duan, P.; Xue, X.; Zhang, C.; Yue, W.; Zhang, B. A dynamic hypergraph attention network: Capturing market-wide spatiotemporal dependencies for stock selection. Appl. Soft Comput. 2025, 169, 112524. [Google Scholar] [CrossRef]
  18. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.u.; Polosukhin, I. Attention is All you Need. In Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
  19. Zhou, H.; Zhang, S.; Peng, J.; Zhang, S.; Li, J.; Xiong, H.; Zhang, W. Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting. Proc. AAAI Conf. Artif. Intell. 2021, 35, 11106–11115. [Google Scholar] [CrossRef]
  20. Ren, S.; Wang, X.; Zhou, X.; Zhou, Y. A novel hybrid model for stock price forecasting integrating Encoder Forest and Informer. Expert Syst. Appl. 2023, 234, 121080. [Google Scholar] [CrossRef]
  21. Wu, H.; Xu, J.; Wang, J.; Long, M. Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting. In Proceedings of the Advances in Neural Information Processing Systems, Virtual, 6–14 December 2021; Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., Vaughan, J.W., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2021; Volume 34, pp. 22419–22430. [Google Scholar]
  22. Liu, Y.; Wu, H.; Wang, J.; Long, M. Non-stationary Transformers: Exploring the Stationarity in Time Series Forecasting. In Proceedings of the Advances in Neural Information Processing Systems, New Orleans, LA, USA, 28 November–9 December 2022; Koyejo, S., Mohamed, S., Agarwal, A., Belgrave, D., Cho, K., Oh, A., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2022; Volume 35, pp. 9881–9893. [Google Scholar]
  23. Nourbakhsh, Z.; Habibi, N. Combining LSTM and CNN methods and fundamental analysis for stock price trend prediction. Multimed. Tools Appl. 2023, 82, 17769–17799. [Google Scholar] [CrossRef]
  24. Md, A.Q.; Kapoor, S.; A.V., C.J.; Sivaraman, A.K.; Tee, K.F.; H., S.; N., J. Novel optimization approach for stock price forecasting using multi-layered sequential LSTM. Appl. Soft Comput. 2023, 134, 109830. [Google Scholar] [CrossRef]
  25. Xu, Y.; Liu, T.; Du, P. Volatility forecasting of crude oil futures based on Bi-LSTM-Attention model: The dynamic role of the COVID-19 pandemic and the Russian-Ukrainian conflict. Resour. Policy 2024, 88, 104319. [Google Scholar] [CrossRef]
  26. Tao, Z.; Wu, W.; Wang, J. Series decomposition Transformer with period-correlation for stock market index prediction. Expert Syst. Appl. 2024, 237, 121424. [Google Scholar] [CrossRef]
  27. Liu, Q.; Yahyapour, R. Nonlinear parsimonious modeling based on Copula–LoGo. Expert Syst. Appl. 2024, 255, 124774. [Google Scholar] [CrossRef]
  28. Li, Y.; Zhuang, M.; Wang, J.; Zhou, J. Leveraging multi-time-span sequences and feature correlations for improved stock trend prediction. Neurocomputing 2025, 620, 129218. [Google Scholar] [CrossRef]
  29. Lin, P.; Ma, S.; Fildes, R. The extra value of online investor sentiment measures on forecasting stock return volatility: A large-scale longitudinal evaluation based on Chinese stock market. Expert Syst. Appl. 2024, 238, 121927. [Google Scholar] [CrossRef]
  30. Htun, H.H.; Biehl, M.; Petkov, N. Survey of feature selection and extraction techniques for stock market prediction. Financ. Innov. 2023, 9, 26. [Google Scholar] [CrossRef]
  31. de Oliveira Carosia, A.E.; Coelho, G.P.; da Silva, A.E.A. Investment strategies applied to the Brazilian stock market: A methodology based on Sentiment Analysis with deep learning. Expert Syst. Appl. 2021, 184, 115470. [Google Scholar] [CrossRef]
  32. Ji, Z.; Wu, P.; Ling, C.; Zhu, P. Exploring the impact of investor’s sentiment tendency in varying input window length for stock price prediction. Multimed. Tools Appl. 2023, 82, 27415–27449. [Google Scholar] [CrossRef]
  33. Liu, W.J.; Ge, Y.B.; Gu, Y.C. News-driven stock market index prediction based on trellis network and sentiment attention mechanism. Expert Syst. Appl. 2024, 250, 123966. [Google Scholar] [CrossRef]
  34. Tibshirani, R. Regression Shrinkage and Selection Via the Lasso. J. R. Stat. Soc. Ser. B (Methodol.) 2018, 58, 267–288. [Google Scholar] [CrossRef]
  35. Fischer, T.; Sterling, M.; Lessmann, S. Fx-spot predictions with state-of-the-art transformer and time embeddings. Expert Syst. Appl. 2024, 249, 123538. [Google Scholar] [CrossRef]
  36. Cho, K.; van Merrienboer, B.; Bahdanau, D.; Bengio, Y. On the Properties of Neural Machine Translation: Encoder-Decoder Approaches. arXiv 2014, arXiv:1409.1259. [Google Scholar]
  37. Mnih, V.; Heess, N.; Graves, A.; Kavukcuoglu, K. Recurrent Models of Visual Attention. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; Ghahramani, Z., Welling, M., Cortes, C., Lawrence, N., Weinberger, K., Eds.; Curran Associates, Inc.: Red Hook, NY, USA, 2014; Volume 27. [Google Scholar]
  38. Kitaev, N.; Łukasz, K.; Levskaya, A. Reformer: The Efficient Transformer. arXiv 2020, arXiv:2001.04451. [Google Scholar]
  39. Zhou, T.; Ma, Z.; Wen, Q.; Wang, X.; Sun, L.; Jin, R. FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series Forecasting. In Proceedings of the 39th International Conference on Machine Learning, Baltimore, MD, USA, 17–23 July 2022; Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., Sabato, S., Eds.; PMLR: Cambridge, MA, USA, 2022. Proceedings of Machine Learning Research. Volume 162, pp. 27268–27286. [Google Scholar]
  40. Obaid, K.; Pukthuanthong, K. A picture is worth a thousand words: Measuring investor sentiment by combining machine learning and photos from news. J. Financ. Econ. 2022, 144, 273–297. [Google Scholar] [CrossRef]
  41. Yang, K.; Cheng, Z.; Li, M.; Wang, S.; Wei, Y. Fortify the investment performance of crude oil market by integrating sentiment analysis and an interval-based trading strategy. Appl. Energy 2024, 353, 122102. [Google Scholar] [CrossRef]
  42. Yao, G.; Feng, X.; Wang, Z.; Ji, R.; Zhang, W. Tone, sentiment and market impact: Based on financial sentiment dictionary. J. Manag. Sci. China 2021, 24, 26–46. [Google Scholar] [CrossRef]
  43. Jiang, F.; Meng, L.; Tang, G. Media Text Sentiment and Stock Return Forecasts. China Econ. Q. 2021, 21, 1323–1344. [Google Scholar] [CrossRef]
  44. Xu, Y.; Liang, C.; Li, Y.; Huynh, T.L. News sentiment and stock return: Evidence from managers’ news coverages. Financ. Res. Lett. 2022, 48, 102959. [Google Scholar] [CrossRef]
  45. Zhang, Y.; Yan, B.; Aasma, M. A novel deep learning framework: Prediction and analysis of financial time series using CEEMD and LSTM. Expert Syst. Appl. 2020, 159, 113609. [Google Scholar] [CrossRef]
  46. eFinance: Python Financial Data Interface Library. Available online: https://github.com/Micro-sheep/efinance (accessed on 14 May 2025).
  47. Ma, C.; Yan, S. Deep learning in the Chinese stock market: The role of technical indicators. Financ. Res. Lett. 2022, 49, 103025. [Google Scholar] [CrossRef]
  48. Geopolitical Risk (GPR) Index. Available online: https://www.matteoiacoviello.com/gpr.htm (accessed on 14 May 2025).
  49. Daily Infectious Disease Equity Market Volatility Tracker. Available online: https://www.policyuncertainty.com/infectious_EMV.html (accessed on 14 May 2025).
  50. Google Trends. Available online: https://trends.google.com/trends/ (accessed on 14 May 2025).
  51. Baidu Index. Available online: https://index.baidu.com/v2/index.html (accessed on 14 May 2025).
  52. Eastmoney Guba. Available online: https://guba.eastmoney.com/ (accessed on 14 May 2025).
  53. ChinaNews. Available online: https://www.chinanews.com/ (accessed on 14 May 2025).
  54. China Internet Information Center. Available online: http://www.china.com.cn/ (accessed on 14 May 2025).
  55. China Securities Regulatory Commission News Releases. Available online: http://www.csrc.gov.cn/csrc/xwfb/index.shtml (accessed on 14 May 2025).
  56. Bazhuayu Web Crawler Software. Available online: https://www.bazhuayu.com/ (accessed on 14 May 2025).
  57. Liu, Q.; Yahyapour, R.; Liu, H.; Hu, Y. A novel combining method of dynamic and static web crawler with parallel computing. Multimed. Tools Appl. 2024, 83, 60343–60364. [Google Scholar] [CrossRef]
Figure 1. The architecture of the Series Stationarization module.
Figure 1. The architecture of the Series Stationarization module.
Electronics 14 02059 g001
Figure 2. The architecture of the De-stationary Attention.
Figure 2. The architecture of the De-stationary Attention.
Electronics 14 02059 g002
Figure 3. The architecture of the Autoformer.
Figure 3. The architecture of the Autoformer.
Electronics 14 02059 g003
Figure 4. Diagram of autocorrelation mechanism.
Figure 4. Diagram of autocorrelation mechanism.
Electronics 14 02059 g004
Figure 5. A dictionary-based method for financial sentiment analysis in Chinese.
Figure 5. A dictionary-based method for financial sentiment analysis in Chinese.
Electronics 14 02059 g005
Figure 6. Hybrid forecasting framework.
Figure 6. Hybrid forecasting framework.
Electronics 14 02059 g006
Figure 7. Data analysis of the SSECI. (a) Distribution of close price. (b) Scatter plot of highest vs. lowest price. (c) Scatter plot of close price over time. (d) Stock price values.
Figure 7. Data analysis of the SSECI. (a) Distribution of close price. (b) Scatter plot of highest vs. lowest price. (c) Scatter plot of close price over time. (d) Stock price values.
Electronics 14 02059 g007
Figure 8. Spearman correlation matrix heatmap.
Figure 8. Spearman correlation matrix heatmap.
Electronics 14 02059 g008
Figure 9. The full pipeline of the proposed forecasting framework.
Figure 9. The full pipeline of the proposed forecasting framework.
Electronics 14 02059 g009
Figure 10. Comparison of fitting curves of different forecasting models. (a) Single model. (b) Hybrid model.
Figure 10. Comparison of fitting curves of different forecasting models. (a) Single model. (b) Hybrid model.
Electronics 14 02059 g010
Figure 11. The forecasting model’s predictive performance is evaluated across four metrics. (a) MAE. (b) RMSE. (c) MAPE. (d) R2.
Figure 11. The forecasting model’s predictive performance is evaluated across four metrics. (a) MAE. (b) RMSE. (c) MAPE. (d) R2.
Electronics 14 02059 g011
Figure 12. Multi-step forecasting performance of different models. (a) Three-step. (b) Five-step. (c) Seven-step. (d) Ten-step. (e) Twelve-step.
Figure 12. Multi-step forecasting performance of different models. (a) Three-step. (b) Five-step. (c) Seven-step. (d) Ten-step. (e) Twelve-step.
Electronics 14 02059 g012
Figure 13. The LASSO-NSAutoformer forecast results for different time window lengths.
Figure 13. The LASSO-NSAutoformer forecast results for different time window lengths.
Electronics 14 02059 g013
Table 1. Data samples of the SSECI.
Table 1. Data samples of the SSECI.
DateOpen
Price
Highest
Price
Lowest
Price
Close
Price
VolumeAmountChangeChange
Rate
Turnover
Rate
2019/1/22497.882500.282456.422465.29109,932,01497,592,573,952−28.61−1.150.24
2019/1/32461.782488.482455.932464.36124,397,496106,922,790,912−0.93−0.040.27
2019/1/42446.022515.322440.912514.87168,877,668139,298,676,73650.512.050.37
2019/1/72528.72536.982515.512533.09177,305,011145,513,242,62418.220.720.39
2019/1/82530.32531.342520.162526.46158,099,182123,379,040,256−6.63−0.260.35
Table 2. Calculated technical indicators.
Table 2. Calculated technical indicators.
TypesTechnical IndicatorsAbbreviation
Trend indicatorsMoving Average (5)MA (5)
Moving Average (10)MA (10)
Moving Average (20)MA (20)
Moving Average (30)MA (30)
Moving Average (60)MA (60)
Exponential Moving Average (5)EMA (5)
Exponential Moving Average (10)EMA (10)
Exponential Moving Average (20)EMA (20)
Exponential Moving Average (30)EMA (30)
Exponential Moving Average (60)EMA (60)
Moving Average Convergence and Divergence (6, 13, 5)MACD (6, 13, 5), MACDsignal (6, 13, 5), MACDhist (6, 13, 5)
Moving Average Convergence and Divergence (12, 26, 9)MACD (12, 26, 9), MACDsignal (12, 26, 9), MACDhist (12, 26, 9)
Moving Average Convergence and Divergence (30, 60, 30)MACD (30, 60, 30), MACDsignal (30, 60, 30), MACDhist (30, 60, 30)
Momentum indicatorsRelative Strength Index (14)RSI (14)
Williams %R (14)WILLR (14)
Momentum Index (14)MOM (14)
Chande Momentum Oscillator (14)CMO (14)
Ultimate Oscillator (7, 14, 28)ULTOSC (14)
Commodity Channel Index (14)CCI (14)
Rate of Change (10)ROC (10)
Volume indicatorsOn Balance VolumeOBV
Chaikin A/D Oscillator (3,10)ADOSC (3,10)
Table 3. Selected variables within two categories.
Table 3. Selected variables within two categories.
CategoryVariables
Composite indexGPRD, IDEMVI, GT, BI
Other financial marketsGC, WTI, DJIA, NASDAQ, S&P, USDCNY, DXY, HSI
Table 4. Sample text data from investor forum.
Table 4. Sample text data from investor forum.
Reading VolumeContentAuthorDate
675Bottom tomorrow, last drop, speculators sad.Shareholder 65853W8Y762020-01-21 18:28
526Digging a hole today for tomorrow’s upward leap.Tao Junjiang2020-01-21 18:30
878Just wondering, why did global stocks plummet today? Any news?YingerJJ2020-01-21 18:33
Table 5. Results of the LASSO feature selection.
Table 5. Results of the LASSO feature selection.
FeaturesCoefficients
Close price0.913147
Highest price0.036236
NASDAQ0.032230
DXY0.005875
Amount0.001701
CCI(14)0.001464
Table 6. Hyperparameter search space.
Table 6. Hyperparameter search space.
Model
HyperparametersTransformer-Based ModelRNN-Based Model
Learning rateLoguniform ( 1 × 10 5 , 1 × 10 1 ) Loguniform ( 1 × 10 5 , 1 × 10 1 )
Dropout rateFloat (0.0, 0.5, step = 0.01)Float (0.0, 0.5, step = 0.01)
Batch size{8, 16, 32, 64, 128, 256}{8, 16, 32, 64, 128, 256}
Number of RNN layers-{1, 2, 3, 4, 5}
Number of hidden-layer neurons-{8, 16, 32, 64, 128, 256}
Number of encoder layers{1, 2, 3, 4}-
Number of decoder layers{1, 2, 3, 4}-
Number of attention heads{4, 8, 16}-
Dimension of model{256, 512, 1024}-
Number of ProbSparse self-attention factors{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}-
Table 7. Optimal parameters for each model.
Table 7. Optimal parameters for each model.
ModelParameter SettingsValue
NSAutoformerLearning rate0.002
Dropout rate0.05
Batch size16
Number of encoder layers1
Number of decoder layers2
Number of attention heads16
Dimension of model256
Non-stationary TransformerLearning rate0.0001
Dropout rate0.07
Batch size32
Number of encoder layers1
Number of decoder layers4
Number of attention heads8
Dimension of model512
AutoformerLearning rate0.0022
Dropout rate0.06
Batch size8
Number of encoder layers2
Number of decoder layers1
Number of attention heads8
Dimension of model256
InformerLearning rate0.0002
Dropout rate0.07
Batch size8
Number of encoder layers2
Number of decoder layers2
Number of attention heads8
Dimension of model256
Number of ProbSparse self-attention factors9
TransformerLearning rate0.0006
Dropout rate0.1
Batch size16
Number of encoder layers4
Number of decoder layers2
Number of attention heads16
Dimension of model512
BiLSTMLearning rate0.0162
Dropout rate0.08
Batch size8
Number of RNN layers1
Number of hidden-layer neurons128
LSTMLearning rate0.003
Dropout rate0.05
Batch size8
Number of RNN layers2
Number of hidden-layer neurons128
BiGRULearning rate0.0006
Dropout rate0.01
Batch size8
Number of RNN layers2
Number of hidden-layer neurons256
GRULearning rate0.0068
Dropout rate0.11
Batch size16
Number of RNN layers1
Number of hidden-layer neurons256
RNNLearning rate0.0013
Dropout rate0.11
Batch size8
Number of RNN layers4
Number of hidden-layer neurons256
Table 8. The prediction performance of different feature sets.
Table 8. The prediction performance of different feature sets.
Feature SetFactorMAERMSEMAPER2
Set 1 Price and trading20.92197827.7913720.0067350.967110
Set 2 Price and trading, technical indicators20.71837627.6535430.0066690.967436
Set 3 Price and trading, composite indices20.75586126.9900230.0066670.968980
Set 4 Price and trading, other financial markets20.77032727.1868780.0066630.968526
Set 5 All factors21.09899527.4566920.0067870.967898
Table 9. The prediction performance of combined filtered features and sentiment factors.
Table 9. The prediction performance of combined filtered features and sentiment factors.
Feature SetFactorMAERMSEMAPER2
Set 6 Filtered features20.35027126.5194230.0065440.970052
Set 7 Filtered features, investor sentiment19.83079525.9672130.0063780.971286
Set 8 Filtered features, news sentiment19.56880825.8961730.0062790.971443
Set 9 Filtered features, investor and news sentiment19.25358425.4786170.0061890.972357
Table 10. Comparative experiment applying different feature selection algorithms.
Table 10. Comparative experiment applying different feature selection algorithms.
FactorMAERMSEMAPER2
All factors21.09899527.4566920.0067870.967898
CatBoost filtered features20.71723727.3760800.0066690.968086
AdaBoost filtered features20.68517327.2605380.0066630.968355
XGBoost filtered features20.63579227.4356960.0066560.967947
Random forest filtered features20.55284726.8625950.0066110.969272
LASSO filtered features20.35027126.5194230.0065440.970052
Table 11. Forecasting error of single models.
Table 11. Forecasting error of single models.
ModelMAERMSEMAPER2
RNN56.66908664.4674380.0183060.823022
GRU34.96066347.1485290.0114680.905338
BiGRU29.44269537.3299600.0096070.940659
LSTM35.16601147.0159230.0115360.905870
BiLSTM33.80148341.9404680.0108840.925096
Transformer35.78609443.7687640.0114110.918423
Informer33.74624343.1029850.0109370.920886
Autoformer22.09363628.6359980.0071380.965081
Non-Stationary Transformer21.61948428.4047450.0069400.965643
NSAutoformer21.09899527.4566920.0067870.967898
Table 12. Forecasting error of hybrid forecasting models.
Table 12. Forecasting error of hybrid forecasting models.
ModelMAERMSEMAPER2
LASSO-RNN23.64441330.8890420.0076250.959370
LASSO-GRU21.38695328.1841660.0068740.966174
LASSO-BiGRU21.10689928.0137620.0067870.966582
LASSO-LSTM22.71328429.0258770.0072900.964124
LASSO-BiLSTM21.72654328.8995880.0069790.964435
LASSO-Transformer26.96060833.9577670.0086800.950896
LASSO-Informer26.51624134.8350220.0085670.948326
LASSO-Autoformer21.52535828.1145880.0069340.966341
LASSO-Non-stationary Transformer20.15809126.5615010.0064900.969957
LASSO-NSAutoformer19.25358425.4786170.0061890.972357
Table 13. Evaluated performance of multi-step forecasting.
Table 13. Evaluated performance of multi-step forecasting.
ModelStepMAERMSEMAPER2
LASSO-RNN343.18899257.1459240.0141260.859717
551.96740769.7423780.0170340.787520
765.74932187.2546770.0216410.660065
1077.670517102.7192200.0253940.515159
1290.754562119.0427600.0296560.338843
LASSO-GRU335.75093846.0923230.0115240.908738
543.45080656.1931110.0139970.862060
751.92923065.7868650.0168430.806760
1068.43500586.3220830.0220390.657595
1273.44890693.4322130.0238530.592721
LASSO-BiGRU335.07817845.3729710.0113070.911564
544.04045158.0650670.0143170.852717
754.00596671.4920270.0175360.771791
1065.16175187.6896740.0211900.646660
1274.452072101.2534900.0241970.521680
LASSO-LSTM336.05444047.4992450.0116650.903082
547.94689262.3737070.0155280.830048
758.61391475.9700550.0190070.742307
1071.95031092.4099500.0233010.607596
1277.85240998.0145800.0250400.551791
LASSO-BiLSTM335.61920547.3161960.0115270.903827
547.03703361.5201420.0152710.834667
754.83915369.4989400.0175770.784338
1068.61528889.6841130.0222840.630404
1274.97769293.5114970.0241490.592030
LASSO-Transformer339.12318449.0772020.0125470.896535
553.26576266.6495670.0172540.805948
762.48135076.8978730.0201890.735974
1069.94492385.2767260.0223500.665838
1280.602280103.7115900.0263830.498174
LASSO-Informer346.15597961.3587380.0150060.838272
551.95213767.8865360.0168680.798678
765.08292483.3300780.0211900.689957
1087.948105116.9281400.0288290.371748
12105.200800136.6984100.0344240.128182
LASSO-Autoformer330.16814439.1174130.0097340.934269
546.56585759.4841880.0150490.845429
752.72078767.0377500.0170320.799342
1068.57167184.2325210.0221860.673972
1271.13179887.7415010.0230800.640823
LASSO-Non-stationary Transformer329.77829439.4008710.0096220.933312
538.53098351.2123300.0124960.885429
742.04081356.0863300.0136680.859547
1049.33115864.1640700.0160330.810818
1259.02013473.2502590.0192200.749668
LASSO-NSAutoformer328.09531637.1115070.0090500.940837
537.02620348.4474790.0119780.897466
740.29305652.0636710.0130540.878972
1048.85267662.3798070.0158470.821193
1256.02973970.1272580.0181640.770558
Table 14. Time window length experiment.
Table 14. Time window length experiment.
ModelStepMAERMSEMAPER2
LASSO-RNN524.48389432.6817170.0079590.954517
1023.64441330.8890420.0076250.959370
1525.24702332.9411160.0081500.953792
2026.47378936.1258350.0086770.944426
2528.96219638.5668220.0094490.936662
3027.24034536.3172260.0088950.943835
LASSO-GRU521.97429828.6046940.0070820.965157
1021.38695328.1841660.0068740.966174
1521.53996128.2255480.0069160.966075
2022.07295828.9984040.0071280.964192
2522.88119329.8850860.0073900.961968
3023.96208831.2570020.0077620.958396
LASSO-BiGRU522.70451229.7101040.0073260.962412
1021.10689928.0137620.0067870.966582
1522.24214029.2762990.0071820.963502
2022.88086730.2918470.0074050.960926
2522.99910930.2695290.0074410.960983
3024.16201231.7375890.0078330.957107
LASSO-LSTM522.73254029.3974740.0073350.963199
1022.71328429.0258770.0072900.964124
1522.64639730.3257080.0073350.960838
2023.42449030.8683700.0075790.959424
2523.96602631.9443550.0077910.956546
3024.93258531.9590230.0080330.956506
LASSO-BiLSTM521.64594528.0106620.0069630.966589
1021.72654328.8995880.0069790.964435
1522.60366429.2737640.0072800.963508
2023.00356329.6508670.0074000.962562
2524.57604432.9139860.0079480.953868
3025.01175532.0830990.0081010.956168
LASSO-Transformer527.37770534.7686350.0087870.948523
1026.96060833.9577670.0086800.950896
1527.61034635.7691690.0088750.945518
2029.93740738.8920060.0096170.935589
2530.96166039.2011600.0099060.934561
3029.89885938.5397800.0096240.936751
LASSO-Informer527.25488336.8310050.0088250.942235
1026.51624134.8350220.0085670.948326
1526.78654336.1767960.0086450.944269
2030.29457538.4177360.0096700.937151
2528.96850436.7176400.0092990.942590
3029.62042039.5246730.0095540.933477
LASSO-Autoformer520.98622127.3771900.0067750.968084
1021.52535828.1145880.0069340.966341
1521.86924928.5490510.0070550.965293
2024.90503532.2152630.0080400.955806
2526.90851835.1758460.0087250.947310
3032.75142741.5523680.0105870.926476
LASSO-Non-stationary Transformer520.72866427.0438820.0066670.968856
1020.15809126.5615010.0064900.969957
1520.25143626.7353440.0065320.969562
2021.92700828.8426990.0070860.964575
2522.15342728.3854960.0071530.965689
3022.48228829.1630880.0072640.963784
LASSO-NSAutoformer519.89864525.8969400.0063860.971442
1019.25358425.4786170.0061890.972357
1520.10059926.3113500.0064870.970520
2020.52798826.6626420.0066090.969728
2521.41512528.0767170.0069060.966432
3022.37666129.4374850.0072450.963099
Table 15. Forecasting errors of models in other stock markets.
Table 15. Forecasting errors of models in other stock markets.
Stock MarketModelMAERMSEMAPER2
SZSECIRNN380.468048473.9196780.0373560.763531
GRU458.067474581.5651860.0470940.643908
BiGRU388.156830460.1886900.0391640.777035
LSTM457.298218580.3257450.0470610.645425
BiLSTM425.774262523.8295290.0431090.711102
Transformer340.938507400.2579350.0329560.831327
Informer297.517700381.0094910.0303060.847160
Autoformer98.346413124.3841780.0096330.983711
Non-stationary Transformer94.279228118.8547590.0092130.985127
NSAutoformer93.363426121.4593960.0091140.984468
LASSO-RNN150.048843203.5354160.0153140.956384
LASSO-GRU99.558372130.4308780.0097330.982089
LASSO-BiGRU98.994049131.4348450.0096750.981812
LASSO-LSTM195.845352267.9266970.0202510.924422
LASSO-BiLSTM189.992401267.0227360.0196590.924931
LASSO-Transformer162.001160215.3513950.0162900.951173
LASSO-Informer149.046051203.4644930.0147060.956414
LASSO-Autoformer94.025230123.9569700.0091720.983823
LASSO-Non-stationary Transformer90.831985118.0119320.0088790.985337
LASSO-NSAutoformer88.166016114.0858230.0086200.986297
GEIRNN153.780304181.7064510.0421340.545588
GRU126.518242149.1244050.0647490.587659
BiGRU79.93439595.8387450.0406350.829689
LSTM145.656662169.9632720.0744410.464364
BiLSTM121.91526135.8098910.0601840.658003
Transformer114.940208134.0013120.0575830.667051
Informer87.232407109.0119480.0436400.779653
Autoformer26.08496332.3279230.0126230.980622
Non-stationary Transformer23.23016929.0553700.0112960.984346
NSAutoformer22.42032128.0048500.0108850.985458
LASSO-RNN28.38054536.4577980.0138890.975354
LASSO-GRU25.11970132.3394620.0122570.980608
LASSO-BiGRU24.55476431.8333400.0118980.981210
LASSO-LSTM25.68118133.3953020.0128140.979321
LASSO-BiLSTM25.37756033.0522770.0124450.979744
LASSO-Transformer40.96177357.1223980.0209930.939498
LASSO-Informer35.36717246.8884320.0176870.959235
LASSO-Autoformer25.02591932.3028070.0121330.980652
LASSO-Non-stationary Transformer21.59668427.3991950.0105280.986080
LASSO-NSAutoformer20.47153926.3184720.0099040.987157
CSI300RNN156.386368217.1385190.0447820.351093
GRU84.334709120.7051540.0240130.799479
BiGRU82.955772106.8183210.0234280.842964
LSTM144.733047174.5165100.0403900.580838
BiLSTM143.489700180.8429870.0403480.549897
Transformer112.041649149.2631530.0318610.693370
Informer73.75455593.1228940.0207400.880650
Autoformer29.52999737.6426470.0079490.980498
Non-stationary Transformer28.71357536.6309780.0077100.981533
NSAutoformer27.88137235.9703900.0074880.982193
LASSO-RNN50.73898368.5132900.0142920.935396
LASSO-GRU32.53364940.6686100.0088750.977237
LASSO-BiGRU30.83292038.6555440.0083300.979435
LASSO-LSTM30.80119938.7817990.0083380.979300
LASSO-BiLSTM30.34275638.9896890.0081700.979078
LASSO-Transformer44.88617356.7858430.0123520.955620
LASSO-Informer39.24599150.7007140.0107730.964622
LASSO-Autoformer29.71724537.7856860.0079580.980350
LASSO-Non-stationary Transformer27.74462135.2825700.0074390.982867
LASSO-NSAutoformer26.97403134.5122570.0072280.983607
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Sheng, Z.; Liu, Q.; Hu, Y.; Liu, H. A Multi-Feature Stock Index Forecasting Approach Based on LASSO Feature Selection and Non-Stationary Autoformer. Electronics 2025, 14, 2059. https://doi.org/10.3390/electronics14102059

AMA Style

Sheng Z, Liu Q, Hu Y, Liu H. A Multi-Feature Stock Index Forecasting Approach Based on LASSO Feature Selection and Non-Stationary Autoformer. Electronics. 2025; 14(10):2059. https://doi.org/10.3390/electronics14102059

Chicago/Turabian Style

Sheng, Zibin, Qingyang Liu, Yanrong Hu, and Hongjiu Liu. 2025. "A Multi-Feature Stock Index Forecasting Approach Based on LASSO Feature Selection and Non-Stationary Autoformer" Electronics 14, no. 10: 2059. https://doi.org/10.3390/electronics14102059

APA Style

Sheng, Z., Liu, Q., Hu, Y., & Liu, H. (2025). A Multi-Feature Stock Index Forecasting Approach Based on LASSO Feature Selection and Non-Stationary Autoformer. Electronics, 14(10), 2059. https://doi.org/10.3390/electronics14102059

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop