Downloads · 30 days
0
KawgKawgKawg/LSTM-Based-Options-Upside-Classifier
LSTM-Based-Options-Upside-Classifier is a machine learning model from KawgKawgKawg. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Predict whether an option contract has upside potential using a deep learning model trained on market-derived features. This project uses a time-aware LSTM model to capture temporal dynamics and trends in the options…
Downloads · 30 days
0
Access
Public
Updated Jun 11, 2025
Repo size
849 MB
Likes
1
Public
Click a slice to open those files.
.csv847 MB · 100%
From the Hugging Face model README
Predict whether an option contract has upside potential using a deep learning model trained on market-derived features. This project uses a time-aware LSTM model to capture temporal dynamics and trends in the options market.
In options trading, identifying contracts with likely upside can significantly boost strategy returns. Most traditional models overlook temporal dependencies — our LSTM model leverages time series sequences of engineered features to predict if an option will have a positive return in the near future.
Upside or No Upside)| Metric | Value |
|---|---|
| Accuracy | 88.02% |
| Precision | 92.23% |
| Recall | 93.20% |
| F1 Score | 92.71% |
| ROC AUC | 0.9067 |
Confusion Matrix:
[[ 9190 5000] # True Negatives / False Positives [ 4329 59350]] # False Negatives / True Positives
days_to_expiry, day_of_week, monthintraday_range, daily_return, log_returnvolatility_ratioprice_vs_strike, pct_above_strikeoi_change_ratio, volume_per_oi, val_per_contractrolling_mean_5, rolling_std_5, return_5dAll features are standardized before being fed into the LSTM.
1 if future return > 0, else 0)StandardScaler used on both features and target10 timestepsmodel.fit(
X_train_seq, y_train_seq,
validation_split=0.2,
epochs=50,
batch_size=32,
callbacks=[EarlyStopping(patience=10, restore_best_weights=True)]
)
🧾 How to Use Load the Model:
from tensorflow.keras.models import load_model
model = load_model("models/option_upside_lstm.h5")
Predict:
X_seq = prepare_sequences(your_feature_df, scaler, time_steps=10)
preds = model.predict(X_seq)
To install all requirements, simply run:
pip install -r requirements.txt
🤝 Contributing Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change or improve.