Stock price trend prediction method based on genetic algorithm and deep sparse extreme learning machine

By introducing genetic algorithms to optimize input weights and biases in deep sparse extreme learning machines, the problem of performance decay when there is a lot of noise in the data is solved, and higher classification accuracy and stability are achieved.

CN120125334APending Publication Date: 2025-06-10HENAN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510196883.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The prior art shows that when there is a large amount of noise in processing data samples, performance deteriorates and it is difficult to effectively extract valuable information.

Method used

The stock price trend prediction method based on genetic algorithm and deep sparse extreme learning machine is adopted to optimize the input weights and biases in the deep sparse extreme learning machine model through genetic algorithms to reduce the uncertainty caused by randomly generated input weights and biases.

Benefits of technology

Effectively filter the noise in the data, extract more representative features, improve the accuracy and stability of classification, and significantly improve the prediction performance in a more noise environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120125334A_ABST
    Figure CN120125334A_ABST
Patent Text Reader

Abstract

The invention relates to a stock price trend prediction method based on a genetic algorithm and a deep sparse extreme learning machine. The problem that the traditional deep sparse extreme learning machine does not fully consider a large amount of noise existing in stock data in the feature extraction process and then the model performance is reduced is effectively solved. According to the technical scheme, the method comprises the following steps: firstly, preprocessing a data set sample; secondly, providing a new output form according to network characteristics of an extreme learning machine auto-encoder (ELM-AE), and constructing a new sparse extreme learning machine auto-encoder (SELM-AE); secondly, designing a deep sparse extreme learning machine with a deep framework in a stacking mode; and finally, optimizing parameters of the deep sparse extreme learning machine by adopting a genetic algorithm and carrying out classification prediction on test samples so as to improve the performance and generalization ability of the whole model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning, and particularly to a stock price trend prediction method based on a genetic algorithm and a deep sparse extreme learning machine. Background Art

[0002] The extreme learning machine (ELM) is a single-hidden-layer feedforward neural network. Different from other traditional single-hidden-layer feedforward neural network algorithms, ELM has the advantages of few learning parameters, fast training speed, and strong generalization ability. Therefore, it is widely used in pattern recognition, computational science, machine learning, etc. This network has a three-layer network structure, an input layer, a hidden layer, and an output layer. It randomly initializes the input layer parameters and uses the least squares method to obtain the optimal output layer parameters, achieving fast learning and high classification accuracy. However, compared with deep learning, as a single-hidden-layer neural network, the traditional ELM has limitations in feature expression ability and is difficult to effectively process a large amount of complex data. For this reason, an autoencoder is introduced into the extreme learning machine model to construct an extreme learning machine autoencoder structure (ELM-AE), and a deep extreme learning machine (DELM) model is proposed by stacking multiple ELM-AEs. It not only inherits the advantages of fast learning and high accuracy of the traditional extreme learning machine but also can extract more abstract and deeper feature information from the original data, enhancing the feature expression ability of the model. Therefore, it has received wide attention in the fields of image processing, speech recognition, and text classification;

[0003] The deep extreme learning machine will introduce a multi-level autoencoder structure to extract features layer by layer from the original input data through multiple extreme learning machine autoencoders to obtain a higher-level representation, avoiding the impact on classification accuracy caused by insufficient feature expression ability, and there is no need for cumbersome fine-tuning in the multi-layer structure. Compared with the traditional extreme learning machine, it enhances the feature extraction ability and generalization ability of the model and is favored by many scholars;

[0004] However, when there is a large amount of noise in the training samples, the performance of these methods will decline. In real application scenarios, obtaining a large number of high-quality samples is a challenging task. On the one hand, factors such as market fluctuations and trading volume changes may interfere with the accuracy of data; on the other hand, the cost of annotating and analyzing a large amount of stock data is also very high. Therefore, how to extract valuable information in an environment with more noise has become an important issue in research and application;

[0005] In view of the above, the present application provides a stock price trend prediction method based on a genetic algorithm and a deep sparse extreme learning machine to solve the above problems. Summary of the Invention

[0006] In view of the above situation, to overcome the defects of the existing technology, the present invention provides a stock price trend prediction method based on a genetic algorithm and a deep sparse extreme learning machine (GA-DSELM), which is used to process tasks with a large amount of noise in data samples, solves the problem that the DELM does not have the ability to resist a large amount of noise in data, and at the same time optimizes the input weights and biases in the deep sparse extreme learning machine (DSELM) model by introducing a genetic algorithm (GA) to reduce the uncertainty brought by randomly generated input weights and biases.

[0007] A stock price trend prediction method based on a genetic algorithm and a deep sparse extreme learning machine, characterized by comprising the following steps:

[0008] S1: Preprocess the data set samples;

[0009] S2: Construct a deep sparse extreme learning machine with a deep framework to extract more abstract features in the data and filter the noise in the data;

[0010] S3: Optimize the deep sparse extreme learning machine using a genetic algorithm to reduce the uncertainty brought by randomly generated input weights and biases, and at the same time improve the accuracy and stability of classification;

[0011] S4: Predict the test samples.

[0012] The beneficial effects of the above technical solutions are as follows:

[0013] (1) The deep sparse extreme learning machine based on the sparse extreme learning machine effectively filters the noise in the data and extracts more representative features during the feature extraction process;

[0014] (2) By learning sparse features, the deep sparse extreme learning machine can effectively reduce the dimension of the input data, thereby reducing the computational complexity and facilitating subsequent analysis and modeling;

[0015] (3) Introduce a genetic algorithm to optimize the input weights and biases in the deep sparse extreme learning machine model to reduce the uncertainty brought by randomly generated input weights and biases, and at the same time improve the accuracy and stability of classification. Description of the Drawings

[0016] Figure 1 It is the network structure diagram of the deep sparse extreme learning machine of the present invention;

[0017] Figure 2 It is the corresponding relationship diagram between the classification accuracy (Accuracy) and the crossover probability (Crossover) of the present invention;

[0018] Figure 3This is the corresponding relationship diagram between Accuracy and mutation probability of the present invention;

[0019] Figure 4 This is the corresponding relationship diagram between Accuracy and the number of hidden nodes of the present invention;

[0020] Figure 5 This is the corresponding relationship diagram between Accuracy and the size of the sliding window of the present invention. Detailed implementation manners

[0021] Regarding the foregoing and other technical contents, features and effects of the present invention, they will be clearly presented in the following detailed description of the embodiments with reference to the accompanying drawings of this application. The structural contents mentioned in the following embodiments are all referenced to the accompanying drawings of the specification.

[0022] I. The present invention proposes a stock price prediction method based on genetic algorithm and deep sparse extreme learning machine. First, preprocess the dataset samples;

[0023] Secondly, construct a deep sparse extreme learning machine with a deep framework to extract more abstract features in the data and filter the noise in the data;

[0024] Then, use the genetic algorithm to optimize the deep sparse extreme learning machine to reduce the uncertainty brought by randomly generated input weights and biases, and at the same time improve the accuracy and stability of classification;

[0025] Finally, predict the test samples.

[0026] The following combines the attached Figure 1 Make a further detailed description of the technical solution of the present invention.

[0027] As shown in the attached Figure 1 The figure is a flow chart of the method for optimizing a deep sparse extreme learning machine by a genetic algorithm, including the following steps:

[0028] Step 1: Preprocess the dataset and divide it into a training set and a test set;

[0029] Step 2: Construct a sparse extreme learning machine autoencoder (SELM-AE).

[0030] The output of the extreme learning machine autoencoder is obtained as: Therefore, the output of the k-th output node of the extreme learning machine autoencoder can be obtained as:

[0031]

[0032] Where h i represents the output of the hidden layer of the i-th sample, and β k =[β 1k, β 2k , …, β Lk T represents the weight from the hidden layer node to the k-th output node.

[0033] According to Equation (1), a new representation form is proposed:

[0034]

[0035] where c k is a continuous positive real number, s k represents the sign term of β k , ε is the error term, and satisfies the condition 0 < ε ≤ c k . By comparing Equation (1) and Equation (2), it can be seen that the forms of the two equations are basically the same. In order to make the newly proposed Equation (2) effectively replace Equation (1), appropriate c k and s k need to be found such that c k s k is approximately equal to β k . Therefore, this fitting process can be achieved by minimizing the Euclidean distance between c k s k and β k :

[0036] d(β, cs) = ||β jk - (c k + ε)s jk || 2 (3)

[0037] Derive Equation (3) with respect to c k and set it equal to 0. After calculation, the expression of c k can be finally obtained as:

[0038]

[0039] Further analyzing Equation (3), it can be obtained that:

[0040]

[0041] Since c k is a positive real number and 0 < ε ≤ c k , when |β jk | 2 < [|β jk | - (c k + ε)] 2 , s ij = 0 will minimize the Euclidean distance. Therefore, the corresponding value of β jk should be set to 0 at this time. That is ​

[0042] |β jk | 2 ≤(|β jk |-c k ) 2 (6)

[0043]

[0044] Therefore, for all elements s jk ≠ 0, it is judged by Equation (6), that is, if c k +ε ≥ 2·|β jk | is satisfied, then β jk is set to zero to obtain the final β * .

[0045] Step 3: A deep sparse extreme learning machine is constructed by stacking and expanding the sparse extreme learning machine. The specific process is as follows:

[0046] The hidden layer weights of each layer of the deep sparse extreme learning machine can be obtained through the sparse extreme learning machine. Specifically, the output H i of the i-th hidden layer in the deep sparse extreme learning machine is used as the input of the (i + 1)-th sparse extreme learning machine, and the output weight obtained by training through the sparse extreme learning machine is used as the weight of the (i + 1)-th layer. Equation (7) represents this relationship.

[0047]

[0048] where g(x) is the activation function. The final objective function of the deep sparse extreme learning machine can be described as:

[0049]

[0050] The solution of β can be obtained from Equation (9), where N is the number of samples and L is the number of neurons in the last hidden layer.

[0051]

[0052] Step 4: Use the genetic algorithm to optimize the parameters of the deep extreme learning machine:

[0053] The fitness function of the genetic algorithm is as follows:

[0054]

[0055] In the formula, assume there are three categories A, B, and C. When analyzing category A in a three-classification task: the TP refers to the number of samples that actually belong to category A and are correctly predicted as A by the model; the FN refers to those samples that do not actually belong to A but are wrongly predicted as A by the model; the FP refers to those samples that actually belong to A but are wrongly predicted as other categories by the model.

[0056] II. The following demonstrates the specific operation process of the above method:

[0057] Step 1. Divide the dataset into a test set and a training set.

[0058] Step 2. Parameter initialization. Given the population size, the number of iterations, the crossover probability, the mutation probability, and the number of hidden layers of the deep extreme learning machine, determine its topological structure.

[0059] Step 3. Randomly initialize the positions of each individual in the population within a given range. Each individual represents a set of input weights and bias values of each extreme learning machine autoencoder (ELM-AE) model. Substitute the information of each individual into the extreme learning machine autoencoder of each layer for training, and calculate the fitness value of each individual in the population using Equation (10).

[0060] Step 4. Perform selection, crossover, and mutation operations to generate new offspring, calculate the new fitness value, and update the current optimal solution.

[0061] Step 5. Repeat the above optimization steps until the fitness value no longer changes or the maximum iteration period is completed, so as to obtain a deep extreme learning machine with optimal hidden layer input weights and bias values.

[0062] Step 6. Reconstruct the extreme learning machine autoencoder with the obtained optimal solution, and calculate the output weights of the extreme learning machine autoencoder of each layer.

[0063] Step 7. Establish a sign matrix for the output weights β of the extreme learning machine autoencoder of each layer and sparsify it according to Equations (4) and (6). Finally, the obtained sparse output weights β * Construct a deep sparse extreme learning machine.

[0064] Step 8. Read the test set for prediction, and take the average of all classification results obtained from the test set as the final classification result of the genetic algorithm and deep sparse extreme learning machine (GA-DSELM) algorithm.

[0065] III. The following verifies the classification performance of this solution through specific experimental data

[0066] 1. Description of the dataset

[0067] To reflect the credibility and classification performance of the algorithm, relevant experiments were conducted on the real trading data of several representative stocks in the A-share market, as shown in Table 1.

[0068] Table 1 Dataset Statistical Information

[0069]

[0070]

[0071] Table 2 Dataset Features

[0072]

[0073] 2. Problem Definition

[0074] The problem of stock trend prediction is defined as a three-classification problem. The specific definition is as follows: close i+1 is defined as the closing price on the (i + 1)-th day, and close i is defined as the closing price on the i-th day. If is satisfied, then the stock trend on the (i + 1)-th day is defined as rising; if is satisfied, then the stock trend on the (i + 1)-th day is defined as falling; if is satisfied, then the stock trend on the (i + 1)-th day is defined as unchanged. The description is as follows:

[0075]

[0076] Among them, λ 1 and λ 2 are set to λ 1 = 0.55%, and λ 2 = -0.50%.

[0077] 3. Experimental Setup Process

[0078] In the following experiments, the sliding window of all models is set to 20. For the Decision Tree and SVM methods, the parameters are confirmed through grid search. The parameters of other models are shown in Table 3.

[0079] Table 3 Experimental Model Parameters

[0080]

[0081]

[0082] 4. Experimental Results and Analysis

[0083] To verify the effectiveness of the GA-DS-ELM stock prediction model, this study compared its performance with that of a variety of traditional machine learning models and deep models in stock market trend prediction. A series of comparative experiments were conducted. By conducting experiments on multiple A-share market datasets, the performance of each model was systematically analyzed from four evaluation metrics: Accuracy, Precision, Recall, and F1-Score. The results of all stock price trend predictions are shown in Table 4. The optimal results are marked in bold, and the sub-optimal results are underlined.

[0084] As can be seen from Table 4, the stock price trend prediction model proposed in this study has good classification performance. From the average values, it can be seen that compared with the advanced model CNN-BiLSTM, Accuracy, Precision, Recall, and F1-Score increased by 1.29%, 2.33%, 2.73%, and 2.37% respectively. Compared with other benchmark models, these four metrics have significant improvements. This indicates that the method proposed in this paper can extract features more effectively and significantly improve the classification accuracy.

[0085] Through the analysis of the data in Table 4, it is found that compared with deep learning models such as GRU and CNN-BiLSTM, SVM performs better in the Precision and Recall metrics in the sh601857, sh600519, and sh000300 datasets. This phenomenon can be attributed to the large amount of noise in the data, which has a negative impact on the performance of deep models. At the same time, considering that the sh000300 and sz000016 datasets are stock index datasets, and stock index data reflects the overall market trend, thus containing more complex information, which makes it more difficult for the model to extract information during the information extraction process. Therefore, the experimental results of the stock index datasets are slightly inferior to those of the individual stock datasets. In contrast, the stock price prediction model proposed in this paper effectively filters out the noise in the data through sparse feature extraction and better captures the complexity and diversity of the input data, thereby extracting more representative features. Even in complex stock index datasets, the model can still achieve good experimental results, further verifying the advantages of the proposed method in dealing with complex data and improving classification performance. This ability enables the model to maintain high stability and accuracy on different types of datasets, demonstrating good robustness.

[0086] To further verify the robustness of the proposed model, noise was introduced into the data during the experiment to simulate the noise conditions commonly present in actual datasets. The prediction results were compared with the data without noise addition. Four average evaluation values were calculated, as shown in Table 5. It can be seen from Table 5 that although the evaluation indicators decreased due to noise interference, the prediction performance was still satisfactory. This indicates that the stock price trend prediction model proposed in this paper has good robustness to noisy data and can maintain a high prediction accuracy.

[0087] 5. Ablation Experiment Results and Analysis

[0088] To verify the effectiveness of DS-ELM and GA in the proposed GA-DS-ELM stock price prediction model, a series of modifications were also made to the model in the experiment, and multiple ablation experiments were conducted. The sz300498 dataset was used for demonstration in the experiment, and the comparative experiment results of the algorithms are listed in Table 6.

[0089] From the results of the comparative ablation experiments in Table 6, it can be seen that the Accuracy of the basic model ELM is only 0.3662, the Precision is 0.3341, and the Recall and F1-Score are 0.3175 and 0.335 respectively, indicating that it performs poorly in handling the current task. In contrast, DELM has improved in all indicators by introducing deep learning methods, with the Accuracy reaching 0.3938 and the Precision being 0.3840, indicating that it performs better in capturing data patterns. Subsequently, DS-ELM further improves in terms of Precision and Accuracy, which shows that DS-ELM can better extract effective features through the strategy of sparse feature extraction, thus improving the overall performance. The model can filter the noise in the data and better extract effective features, thereby improving the overall performance. And GA-ML-ELM further optimizes the network structure and parameters using the genetic algorithm based on DS-ELM, thus achieving higher prediction accuracy and better generalization performance.

[0090] Table 4 Comparison of Algorithm Prediction Results

[0091]

[0092]

[0093] Table 5 Comparison of Prediction Results for Different Data

[0094] Accuracy Precision Recall F1-Score Data with added noise 0.4351 0.4389 0.4101 0.4105 Original data 0.4387 0.4413 0.4143 0.4159

[0095] Table 6 Comparison of Prediction Results for Different Models

[0096] Model / Metrics Accuracy Precision Recall F1-Score ELM 0.3662 0.3341 0.3175 0.3315 DELM 0.3938 0.3840 0.3410 0.3511 DS-ELM 0.4031 0.4229 0.3469 0.3528 GA-DS-ELM 0.4277 0.4498 0.3779 0.3910

[0097] 6. Experimental Parameter Analysis

[0098] (1) Crossover Probability

[0099] The genetic algorithm is an optimization algorithm based on natural selection and genetic mechanisms, which is widely used in various complex optimization problems. In GA, the crossover operation generates new individuals by exchanging partial gene information of two parent individuals, thus promoting the diversity of the population. The crossover probability is a parameter that controls the occurrence frequency of the crossover operation and directly affects the search ability and convergence speed of the algorithm. To study the influence of the crossover probability on the genetic algorithm and the overall algorithm, we designed a sensitivity analysis experiment for the crossover probability. The experiment selected sz000625 as the dataset and selected multiple different ranges of crossover probability values, from a lower value (such as 0.0001) to a higher value (such as 0.1), and kept other parameters (such as mutation probability, population size, etc.) unchanged.

[0100] Figure 2 Shows the performance of the accuracy, recall, F1-Score, and precision of GA-DS-ELM obtained according to the genetic algorithm at different crossover probabilities. It can be seen that when the crossover probability is in the lower range (such as 0.0001 to 0.005), the performance indicators are relatively stable; as the crossover probability increases, the performance of the algorithm decreases to varying degrees. This indicates that too high a crossover probability will cause the algorithm to overly disturb the structure of the solution, thus affecting the overall performance.

[0101] (2) Mutation Probability

[0102] The mutation operation in the genetic algorithm randomly changes the gene positions of individuals, enabling the algorithm to jump out of local optima and explore the search space more comprehensively. The mutation probability controls the occurrence frequency of the mutation operation and is a key factor affecting the search performance of GA. A higher mutation probability may lead to excessive randomization of individuals and destroy existing good solutions; while a lower mutation probability may not be sufficient to effectively jump out of local optimal solutions. Therefore, the sensitivity analysis of the mutation probability helps to find an appropriate parameter setting to achieve optimal search performance and convergence speed.

[0103] To analyze the influence of the mutation probability on the performance of the genetic algorithm and the overall algorithm, this paper sets a group of mutation probability values ranging from 0.4 to 0.9 and runs the algorithm at each value. To ensure the reliability of the results, other parameters such as crossover probability and population size remain unchanged, and the experiment still selects sz000625 as the dataset.

[0104] Figure 3Shows the performance of Accuracy, Recall, F1-score, and Precision of GA-DS-ELM obtained according to the genetic algorithm at different mutation probabilities. From Figure 3 It can be seen that when the mutation probability is between 0.4 and 0.6, the algorithm performs optimally in terms of accuracy, F1-score, and recall. However, when the mutation probability increases to 0.7 and above, the performance indicators generally decline, especially the significant decline in accuracy and precision. This indicates that too high a mutation probability introduces too much randomness, making it difficult for the algorithm to maintain the stability and quality of the solution.

[0105] (3) Number of hidden nodes

[0106] The number of hidden nodes is a key parameter in the GA-DSELM model, which determines the complexity and generalization ability of the model. To evaluate the impact of different numbers of hidden nodes on the model performance, this study conducted a sensitivity analysis on this parameter. The experiment used the sz000625 stock data as the dataset, set the number of hidden nodes in the range of 50 to 600, and selected a total of 9 values of 50, 100, 150, 200, 256, 300, 400, 500, and 600 for testing. The model performance was measured by evaluation indicators such as Accuracy, Recall, F1-score, and Precision, and the performance under different numbers of hidden nodes was analyzed.

[0107] Figure 4 Shows the impact of the number of hidden nodes on the model performance. As the number of hidden nodes increases from 50 to 600, the accuracy and F1-score of the model show certain fluctuations. Especially when the number of hidden nodes is 300, the accuracy of the model reaches 50.29%, which is the best value; when the number of hidden nodes increases to 400, the accuracy decreases. Although the recall and precision remain relatively stable throughout the node range, when the number of hidden nodes is too large, the recall shows a certain degree of decline.

[0108] From the experimental results, it can be seen that as the number of hidden nodes increases, the prediction accuracy of the model does not show a linear improvement trend, and too large a number of hidden nodes even leads to a decline in performance. This may be due to overfitting of the model caused by too many hidden nodes.

[0109] (4) Sliding window size

[0110] To evaluate the impact of the sliding window parameter on the model performance, the experiment conducted a sensitivity analysis under different sliding window sizes (5, 10, 15, 20, 25, 30). Figure 5 Shows the experimental results of the changes in Accuracy, Recall, F1-score, and Precision with the sliding window parameter on the sz000625 stock data dataset.

[0111] First, in terms of the performance of Accuracy, as the sliding window increases from 5 to 10, the Accuracy of the model increases significantly, rising from 38.36% to 50.56%. However, when the sliding window is further increased to 15, the Accuracy decreases slightly, remaining at around 50.14%. When the window size is further increased to 30, the Accuracy fluctuates slightly and finally drops to 48.99%.

[0112] Overall, as the size of the sliding window increases, the performance of the model does not continue to improve. When the sliding window is greater than 20, the performance of the model shows a slight downward trend. A smaller sliding window may cause the model to fail to fully capture long-term correlations, while a larger window may contain more historical information but may also introduce too much redundant information, resulting in a decline in the model's performance. Therefore, the model is sensitive to the size of the sliding window.

[0113] IV. An embodiment of the present application provides a computer device

[0114] The computer device includes a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the stock trend prediction method of optimizing the deep sparse extreme learning machine by the genetic algorithm in the above embodiment.

[0115] Furthermore, all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by the processor. For this reason, an embodiment of the present application provides a computer-readable storage medium, in which multiple instructions are stored. The instructions can be loaded by the processor to execute the stock trend prediction method of optimizing the deep sparse extreme learning machine by the genetic algorithm provided by the embodiments of the present application.

[0116] The computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

[0117] The above description is only for the purpose of illustrating the present invention. It should be understood that the present invention is not limited to the above embodiments, and various equivalent forms conforming to the idea of the present invention are within the protection scope of the present invention.

Claims

1. A stock price trend prediction method based on genetic algorithm and deep sparse extreme learning machine, comprising the following steps: S1: Preprocess the dataset samples; S2: Construct a deep sparse extreme learning machine with a deep framework to extract more abstract features from the data and filter out noise in the data; S3: Use genetic algorithms to optimize deep sparse extreme learning machines to reduce the uncertainty caused by randomly generated input weights and biases, while improving classification accuracy and stability; S4: Make predictions for the test sample.

2. The method for predicting stock price trends based on genetic algorithm and deep sparse extreme learning machine according to claim 1, characterized in that: The S2 comprises the following steps: S2-1: Divide the dataset into training set and test set; S2-2: Constructing a sparse extreme learning machine autoencoder; S2-3: Constructing deep sparse extreme learning machines by stacking and expanding sparse extreme learning machines.

3. The stock price trend prediction method based on genetic algorithm and deep sparse extreme learning machine according to claim 2, characterized in that: The S2-2 specifically includes: S2-2-1: The output of the extreme learning machine autoencoder is: The output of the kth output node of the extreme learning machine autoencoder is: where h i Represented as the hidden layer output of the i-th sample, β k =[β 1k ,β 2k ,…,β Lk ] T Represents the weight from the hidden layer node to the kth output node; According to formula (1), a new representation is proposed: Among them, c k is a continuous positive real number, s k β k The symbol term indicates that ε is the error term and satisfies the condition 0<ε≤c k ; S2-2-2: By minimizing c k s k and β k The Euclidean distance between them is used to implement the fitting process of formula (1) and formula (2): For c in formula (3), k Taking the derivative and setting it equal to 0, we get c k The expression is: Further analysis of formula (3) yields: Due to c k is a positive real number and 0<ε≤c k , when |β jk | 2 <[|β jk |-(c k +ε)] 2 When ij = 0 will minimize the Euclidean distance, and the corresponding β jk The value of is set to 0; that is |β jk | 2 ≤(|β jk |-c k ) 2 (6) For all s jk ≠0, judged by formula (6), that is, if c k +ε≥2·|β jk |, then β jk Set to zero to get the final β * .

4. The stock price trend prediction method based on genetic algorithm and deep sparse extreme learning machine according to claim 2, characterized in that: The S2-3 specifically includes: The hidden layer weights of each layer of the deep sparse extreme learning machine are obtained through the sparse extreme learning machine; specifically, the output H of the i-th hidden layer in the deep sparse extreme learning machine i As the input of the i+1th sparse extreme learning machine, the output weights trained by the sparse extreme learning machine are As the weight of the i+1th layer, the above relationship is expressed by formula (7): Where g(x) is the activation function; The final objective function of the deep sparse extreme learning machine can be described as: The solution of β can be obtained from formula (9): Where N is the number of samples, L is the number of neurons in the last hidden layer.

5. The stock price trend prediction method based on genetic algorithm and deep sparse extreme learning machine according to claim 1, characterized in that: The S3 specifically includes: First, the genetic algorithm is used to optimize the parameters of the deep extreme learning machine. The fitness function of the genetic algorithm is as follows: S3-1: Initialize the population: Generate the initial solution, representing the parameters of the deep sparse extreme learning machine; S3-2: Evaluate fitness: Evaluate individuals through fitness functions; S3-3: Selection and crossover: Select high fitness individuals for crossover to generate new individuals; S3-4: Mutation: Parameters of some individuals are mutated to increase diversity; S3-5: Update iteration: Repeated iteration until the conditions are met; S3-6: Final selection: Select the best individual as the stock trend prediction model.

6. The method for predicting stock price trends based on genetic algorithm and deep sparse extreme learning machine according to claim 5, characterized in that: Assume that there are three categories A, B, and C. In the three-category task, when analyzing category A: TP refers to the number of samples that actually belong to category A and are correctly predicted as A by the model; FN refers to the number of samples that do not actually belong to A but are incorrectly predicted as A by the model; FP refers to the number of samples that actually belong to A but are incorrectly predicted by the model to be other categories.

7. A computer device, characterized in that: The computer device includes a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the stock trend prediction method of the genetic algorithm optimized deep sparse extreme learning machine as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for predicting stock trends using a genetic algorithm to optimize a deep sparse extreme learning machine as described in any one of claims 1 to 6 is implemented.