File size: 4,876 Bytes
9e61740 f4b089f 9e61740 017271a f4b089f 017271a f4b089f 017271a f4b089f 017271a f4b089f 017271a f4b089f 017271a f4b089f 017271a f4b089f 017271a f4b089f 90f87ee f4b089f 017271a f4b089f 017271a f4b089f 017271a 90f87ee f4b089f 017271a f4b089f 017271a f4b089f 90f87ee f4b089f 90f87ee f4b089f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | ---
title: README
emoji: π
colorFrom: red
colorTo: green
sdk: gradio
pinned: false
---
# π§ kpOX Mini β Open Source AI Model for Market Forecasting
[](https://huggingface.co)
[](LICENSE)
[](https://kpox.ai)
---
## π Overview
**kpOX Mini** is a lightweight, transformer-based AI model developed for **predictive analytics in the futures and equity markets**.
It is part of the larger kpOX platform β used by both retail researchers and institutional trading teams.
This is the **open-source edition**, designed for learning, experimentation, and prototyping.
---
## π§© Editions
| Version | Purpose | Access |
|------------------|---------------------------------------------|----------------|
| π’ kpOX Mini | Open-source for research and education | Free (MIT) |
| π kpOX Pro | Enterprise-grade model with full features | Licensed |
---
## β
Features (kpOX Mini)
- **Asset Support**: Equity, index, and commodity futures
- **Model Type**: Time-series transformer with classification head
- **Outputs**:
- `direction`: Up / Down probability
- `expected_return`: Scaled value
- `confidence`: Model certainty (0β1)
- **Input Features**:
- OHLCV data (price candles)
- Indicators: EMA, RSI, MACD, VWAP
- Optional news sentiment score
---
## π Use Cases
- Academic research on time-series forecasting
- Educational examples in financial machine learning
- Backtesting and strategy prototyping
- Lightweight signal layer for DIY quant trading
---
## π Quick Start
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("kpox/ai-mini-futures")
tokenizer = AutoTokenizer.from_pretrained("kpox/ai-mini-futures")
inputs = tokenizer("2024-07-15 | ohlcv: [4178.4, 4190.0, 4160.3, 4187.2, 3100000], rsi: 62", return_tensors="pt")
outputs = model(**inputs)
probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
print("π Up Probability:", round(probs[0][1].item(), 3))
```
> βοΈ See `/examples/structured_inputs/` for full input format (JSON or CSV-to-token examples).
---
## π§ Architecture
| Component | Detail |
|------------------|---------------------------------------------|
| Model Type | Transformer (Tiny / 6-head classification) |
| Input Window | 10β30 time steps |
| Target Horizon | 1β5 steps ahead forecast |
| Tokenization | Custom tokenizer for numeric time series |
| Framework | PyTorch + Hugging Face Transformers |
---
## ποΈ Training Details
- **Data**: 7 years of intraday & EOD data (futures, equities)
- **Indicators**: Pre-computed with TA-Lib + custom scalers
- **Optimizer**: AdamW + Lookahead
- **Loss**: Weighted Huber + Directional penalty
- **Epochs**: 20 (Mini) / 100+ (Pro)
---
## π Evaluation
| Metric | Value (Mini) | Notes |
|----------------|--------------|------------------------------|
| Accuracy | ~58β62% | Depending on symbol |
| Precision (Up) | ~0.60 | Class-imbalanced adjusted |
| F1 Score | ~0.58 | Baseline + signal threshold |
| Backtest Edge | Moderate | On trend-based strategies |
> kpOX Pro improves all scores significantly using broader data and deeper architecture.
---
## π kpOX Pro β Enterprise Edition
`kpOX Pro` is used by **hedge funds, quant desks, and banks**.
It features:
- Sector-specific model heads (tech, energy, FX)
- Macroeconomic calendar conditioning
- Broker API streaming (IBKR, Alpaca)
- Risk engine integration
- Portfolio-level output & optimization
- Hosted API, WebSocket, and inference servers
---
## β οΈ License & Legal
- **kpOX Mini** is licensed under the [MIT License](LICENSE).
- You may **use, modify, and redistribute** for research and educational purposes.
- **kpOX Pro** is commercially licensed and not part of this repo.
> π Commercial or production use of kpOX Pro requires a separate agreement.
---
## π Disclaimers
- This is **not financial advice**.
- Use responsibly, with proper backtesting, legal compliance, and market risk management.
- Past performance of AI models does **not** guarantee future results.
---
## π€ Contributing
We welcome feedback, collaboration ideas, and pull requests for:
- Improved preprocessing
- New training data modules
- Model evaluation extensions
---
## π Links
---
Β© 2025 **kpOX**, Inc. All rights reserved.
|