Universal LSTM Stock Prediction Model
Model Description
This is a Universal LSTM model trained for stock price prediction with sentiment analysis integration. The model can predict stock prices for multiple stocks using technical indicators and sentiment features.
Model Details
- Model Type: LSTM (Long Short-Term Memory) Neural Network
- Framework: TensorFlow/Keras
- Task: Time Series Prediction / Stock Price Forecasting
- Training Date: July 5, 2025
- Input Features: Technical indicators + Sentiment scores
- Output: Next-day stock price prediction
Architecture
- Input Shape: (None, 60, 6)
- Output Shape: (None, 1)
- Parameters: 31,651
The model uses a multi-layer LSTM architecture optimized for financial time series prediction.
Training Data
- Stocks: Multiple stocks including AAPL, MSFT, GOOGL, AMZN, TSLA, META, NVDA
- Features:
- Technical indicators (Open, High, Low, Close, Volume)
- Sentiment scores from financial news analysis
- Moving averages and other derived features
- Time Period: Historical stock data with corresponding news sentiment
- Preprocessing: StandardScaler normalization
Performance
The model has been evaluated on multiple stocks with varying performance metrics. Best performance achieved:
- RMSE: Varies by stock (typically 5-15 points)
- Architecture: Optimized through hyperparameter tuning
Usage
import tensorflow as tf
import pickle
import numpy as np
# Load the model
model = tf.keras.models.load_model('stage2_universal_lstm_20250705_170829.keras')
# Load the scaler
with open('stage2_scalers_20250705_170829.pkl', 'rb') as f:
scalers = pickle.load(f)
# Prepare your data (X should be scaled using the same scaler)
# X = your_data # Shape: (batch_size, sequence_length, features)
# predictions = model.predict(X)
Files Included
stage2_universal_lstm_20250705_170829.keras
: Main model filestage2_scalers_20250705_170829.pkl
: Feature scalers for preprocessingstage2_metadata_20250705_170829.json
: Model metadata and configurationstage2_architecture_20250705_170829.txt
: Detailed architecture description
Citation
If you use this model in your research, please cite:
@misc{lstm_stock_prediction_2025,
title={Universal LSTM Stock Prediction Model with Sentiment Analysis},
author={Jeng Yang},
year={2025},
url={https://huggingface.co/jengyang/lstm-stock-prediction-model}
}
Disclaimer
This model is for research and educational purposes only. Stock market predictions are inherently uncertain and this model should not be used as the sole basis for financial decisions. Always consult with financial professionals and conduct your own research before making investment decisions.
Contact
For questions or issues, please open an issue in the model repository.