Eillac1 / Stock-Price-Classification-Prediction

This code is about LSTM model, LSTM-GRU model, LSTM-GRU-Transformer model in the application of stock price prediction
MIT License
1 stars 2 forks source link

About this model #1

Open Eillac1 opened 2 months ago

Eillac1 commented 2 months ago

At present, this code is the model I used in the study of stock price regression prediction. The current accuracy is not high, the code still has bugs, and the documentation is not well written. I hope to get your help and solutions

yyf100 commented 1 month ago

Hello! Let me explain my group contribution. Summary of Transformer-LSTM-GRU model improvements Data processing The data were manually adjusted due to the unbalanced distribution of some of the data.

Data preprocessing Classification functions were written to implement the triple classification prediction model. The target variables were classified and used one-hot coding and change_percent_class. A sliding window function was created to enable the model to predict the value on the n+1st day using data from the past n days. The processed features were normalised to improve training efficiency. Model tuning Shifted the self-attention mechanism from processing the next step of the GRU output to processing time series data. Since the model only needs to process the final output of the time step, the original mechanism is no longer applicable. Changed the activation function of the original model to a softmax function for classification models. Updated the loss function to use categorical_crossentropy, which is commonly used in classification models. The number of output units in the Dense layer is changed to 3 to meet the requirements of the triple classification task. Model Evaluation Confusion matrix, ROC curve and accuracy are defined to evaluate the model performance.

Results Final Results We finally improved the accuracy to 90.95%.

Eillac1 commented 1 month ago

Thank you very much for your response! I have thoroughly reviewed your improvements and optimizations to the project. In fact, you have made very effective enhancements based on my initial ideas! Some of your ideas are particularly interesting, such as using one-hot encoding to assign values to the predicted output. This is a very effective application that simplifies the complex data and significantly improves the efficiency and accuracy of the model training. Additionally, your evaluation methods, model optimizations, and framework adjustments demonstrate a high level of expertise in the field of classification prediction! The current classification results are excellent, and I look forward to continuing our collaboration in the future to tackle more efficient and advanced technologies!