YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

πŸ“ˆ LSTM-Based Options Upside Classifier

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.

πŸ” Motivation

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.


🧠 Model Overview

  • Architecture: LSTM + Dense layers
  • Problem Type: Binary classification (Upside or No Upside)
  • Evaluation: Achieves >90% on precision, recall, and F1

πŸ“Š Performance

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

πŸ“¦ Features Used

  • Time-based: days_to_expiry, day_of_week, month
  • Price action: intraday_range, daily_return, log_return
  • Volatility: volatility_ratio
  • Strike comparison: price_vs_strike, pct_above_strike
  • Market sentiment: oi_change_ratio, volume_per_oi, val_per_contract
  • Rolling signals: rolling_mean_5, rolling_std_5, return_5d

All features are standardized before being fed into the LSTM.


πŸ§ͺ Dataset & Preprocessing

  • Input: Time series of option features with a binary label (1 if future return > 0, else 0)
  • Scaling: StandardScaler used on both features and target
  • Sequence building: Uses sliding window of 10 timesteps
  • Train/test split: Chronologically split to avoid time leakage

πŸ› οΈ Training

model.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.


license: cc-by-nc-sa-3.0

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support