Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -5,13 +5,9 @@ An end-to-end multi-domain AI forecasting system. Real datasets, two model modes
|
|
| 5 |
## Models: separate vs unified
|
| 6 |
|
| 7 |
- **Separate** (`model_<topic>.pt`) β 6 dedicated 2-layer LSTMs, one per topic
|
| 8 |
-
- **Unified** (`unified_model.pt`) β
|
| 9 |
|
| 10 |
-
|
| 11 |
-
python train_unified.py # train the single combined model
|
| 12 |
-
python predict.py --topic finance --mode unified # query it for any topic
|
| 13 |
-
python ask.py "compare all topics" # chat uses unified automatically when available
|
| 14 |
-
```
|
| 15 |
|
| 16 |
## Topics & datasets (all real, fetched automatically)
|
| 17 |
|
|
@@ -24,8 +20,7 @@ python ask.py "compare all topics" # chat uses unified automatical
|
|
| 24 |
| **Weather** | Daily mean temperature (any city) | Open-Meteo archive | 4,248 |
|
| 25 |
| **Economy** | S&P 500 daily close | Yahoo Finance | 6,699 |
|
| 26 |
|
| 27 |
-
|
| 28 |
-
- Every topic falls back gracefully: Hugging Face search -> API -> synthetic data if fully offline.
|
| 29 |
|
| 30 |
## Configs
|
| 31 |
|
|
@@ -48,7 +43,7 @@ All configuration files are in the `configs/` folder:
|
|
| 48 |
| AI (NVIDIA) | $2.17 | 2.26% | ~naive |
|
| 49 |
| Economy (S&P 500) | $37.37 | 0.71% | beats naive by 0.5% |
|
| 50 |
| Finance (Bitcoin) | $1,437.46 | 1.61% | ~naive |
|
| 51 |
-
| Programming (react) | 1.17M downloads | 7.12% |
|
| 52 |
| Sports (ATP #1 Elo) | 3.40 Elo | 0.06% | ~naive |
|
| 53 |
| Weather (Chennai temp) | 0.99 K | 0.18% | beats naive by 1.9% |
|
| 54 |
|
|
@@ -67,46 +62,29 @@ All configuration files are in the `configs/` folder:
|
|
| 67 |
|
| 68 |
## Architecture (normal mode shows only the final response)
|
| 69 |
|
| 70 |
-
|
| 71 |
-
user question -> intent detection (response.py)
|
| 72 |
-
-> prediction_engine.py (structured metrics, prints nothing)
|
| 73 |
-
-> response_formatter.py (natural summary + Markdown, no internal details)
|
| 74 |
-
-> ask.py (chat_output, stdout)
|
| 75 |
-
```
|
| 76 |
|
| 77 |
-
-
|
| 78 |
-
-
|
| 79 |
-
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
- `response_formatter.py` β presents metrics naturally; opens with a one-sentence
|
| 85 |
-
ChatGPT-style summary; never invents confidence, probability, or values
|
| 86 |
-
- `debug_logger.py` β internal logs go to stderr only when `FORECAST_DEBUG=1` (or `--debug`)
|
| 87 |
-
- `data.py` β multi-topic data pipeline (fetchers + caching to `data/<topic>.csv`)
|
| 88 |
-
- `weather_cities.py` β city registry for location-specific weather models
|
| 89 |
-
- `model.py` / `train.py` β 2-layer LSTM, Huber loss, AdamW, early stopping, temporal split
|
| 90 |
-
- `predict.py` β per-topic model loader, rollout forecast, chart + text report
|
| 91 |
-
- `multi.py` β trains + evaluates all topics; quiet in normal mode
|
| 92 |
|
| 93 |
## Ask it anything (ChatGPT-style)
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
.\.venv\Scripts\python.exe ask.py --debug "predict ai for 3 days" # internal logs on stderr
|
| 101 |
-
```
|
| 102 |
|
| 103 |
Example response:
|
| 104 |
-
|
| 105 |
```
|
| 106 |
In short, the model expects Bitcoin to stay roughly stable next week, hovering near $63,228.
|
| 107 |
|
| 108 |
Bitcoin Forecast
|
| 109 |
-
|
| 110 |
August 18-24, 2026
|
| 111 |
|
| 112 |
The model forecasts relatively sideways movement for Bitcoin next week, with an
|
|
@@ -123,37 +101,19 @@ This is a model-generated forecast, and actual market behavior may differ.
|
|
| 123 |
|
| 124 |
## Weather for any city
|
| 125 |
|
| 126 |
-
|
| 127 |
-
$env:WEATHER_NAME='Chennai, India'; $env:WEATHER_LAT='13.0827'; $env:WEATHER_LON='80.2707'
|
| 128 |
-
.\.venv\Scripts\python.exe data.py --topic weather --refresh
|
| 129 |
-
.\.venv\Scripts\python.exe train.py --topic weather --epochs 150
|
| 130 |
-
.\.venv\Scripts\python.exe ask.py "predict weather in chennai tomorrow"
|
| 131 |
-
```
|
| 132 |
|
| 133 |
## Train / refresh
|
| 134 |
|
| 135 |
-
|
| 136 |
-
.\run_all.ps1 # everything (default topics)
|
| 137 |
-
.\.venv\Scripts\python.exe multi.py # all topics
|
| 138 |
-
.\.venv\Scripts\python.exe train.py --topic sports
|
| 139 |
-
.\.venv\Scripts\python.exe predict.py --topic ai --days 14
|
| 140 |
-
```
|
| 141 |
-
|
| 142 |
-
Outputs: `model_<topic>.pt`, `configs/config_<topic>.json`, `prediction_<topic>.png`, `prediction_<topic>.txt`, `results.json`.
|
| 143 |
|
| 144 |
## Add a new domain
|
| 145 |
|
| 146 |
-
1. Add
|
| 147 |
-
2. Add a fetcher returning
|
| 148 |
-
3. Run
|
| 149 |
|
| 150 |
## Hugging Face Repository
|
| 151 |
|
| 152 |
All models and configs are available at:
|
| 153 |
-
**https://huggingface.co/CodeDevX/future-prediction-multi-domain-lstm**
|
| 154 |
-
|
| 155 |
-
Download with:
|
| 156 |
-
```python
|
| 157 |
-
from huggingface_hub import hf_hub_download
|
| 158 |
-
model_path = hf_hub_download("CodeDevX/future-prediction-multi-domain-lstm", "model_ai.pt", repo_type="model")
|
| 159 |
-
```
|
|
|
|
| 5 |
## Models: separate vs unified
|
| 6 |
|
| 7 |
- **Separate** (`model_<topic>.pt`) β 6 dedicated 2-layer LSTMs, one per topic
|
| 8 |
+
- **Unified** (`unified_model.pt`) β One combined model for all 6 domains: shared LSTM backbone + per-domain embedding + per-domain heads, trained jointly from merged separate models
|
| 9 |
|
| 10 |
+
The unified model merges weights from all 6 trained separate models into a single checkpoint, enabling cross-domain knowledge transfer and a single model that can predict any of the 6 topics.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
## Topics & datasets (all real, fetched automatically)
|
| 13 |
|
|
|
|
| 20 |
| **Weather** | Daily mean temperature (any city) | Open-Meteo archive | 4,248 |
|
| 21 |
| **Economy** | S&P 500 daily close | Yahoo Finance | 6,699 |
|
| 22 |
|
| 23 |
+
Weather city is configurable. Every topic falls back gracefully: Hugging Face search -> API -> synthetic data if fully offline.
|
|
|
|
| 24 |
|
| 25 |
## Configs
|
| 26 |
|
|
|
|
| 43 |
| AI (NVIDIA) | $2.17 | 2.26% | ~naive |
|
| 44 |
| Economy (S&P 500) | $37.37 | 0.71% | beats naive by 0.5% |
|
| 45 |
| Finance (Bitcoin) | $1,437.46 | 1.61% | ~naive |
|
| 46 |
+
| Programming (react) | 1.17M downloads | 7.12% | beats naive by 77.5% |
|
| 47 |
| Sports (ATP #1 Elo) | 3.40 Elo | 0.06% | ~naive |
|
| 48 |
| Weather (Chennai temp) | 0.99 K | 0.18% | beats naive by 1.9% |
|
| 49 |
|
|
|
|
| 62 |
|
| 63 |
## Architecture (normal mode shows only the final response)
|
| 64 |
|
| 65 |
+
User question -> intent detection -> prediction engine -> response formatter -> chat output
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
+
- Chat CLI β only the final assistant response reaches the user
|
| 68 |
+
- Intent detection + orchestration (topic, location, horizon, style)
|
| 69 |
+
- Prediction engine β runs the LSTM, returns structured metrics: net change, forecast range, current-to-forecast, direction, primary forecast
|
| 70 |
+
- Response formatter β presents metrics naturally; opens with a one-sentence ChatGPT-style summary; never invents confidence, probability, or values
|
| 71 |
+
- Multi-topic data pipeline (fetchers + caching)
|
| 72 |
+
- 2-layer LSTM, Huber loss, AdamW, early stopping, temporal split
|
| 73 |
+
- Per-topic model loader, rollout forecast, chart + text report
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
## Ask it anything (ChatGPT-style)
|
| 76 |
|
| 77 |
+
Interactive chat with natural language queries:
|
| 78 |
+
- "what will bitcoin do next week?"
|
| 79 |
+
- "compare all topics"
|
| 80 |
+
- "predict programming for 14 days"
|
| 81 |
+
- "predict ai for 3 days"
|
|
|
|
|
|
|
| 82 |
|
| 83 |
Example response:
|
|
|
|
| 84 |
```
|
| 85 |
In short, the model expects Bitcoin to stay roughly stable next week, hovering near $63,228.
|
| 86 |
|
| 87 |
Bitcoin Forecast
|
|
|
|
| 88 |
August 18-24, 2026
|
| 89 |
|
| 90 |
The model forecasts relatively sideways movement for Bitcoin next week, with an
|
|
|
|
| 101 |
|
| 102 |
## Weather for any city
|
| 103 |
|
| 104 |
+
Configure city via environment variables or city registry, then query weather predictions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
## Train / refresh
|
| 107 |
|
| 108 |
+
Run training for all topics or individual domains. Outputs: model checkpoints, configs, predictions, charts, and results.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
## Add a new domain
|
| 111 |
|
| 112 |
+
1. Add entry to topics configuration (label, unit, asset name)
|
| 113 |
+
2. Add a fetcher returning date + value columns
|
| 114 |
+
3. Run training β everything else is automatic
|
| 115 |
|
| 116 |
## Hugging Face Repository
|
| 117 |
|
| 118 |
All models and configs are available at:
|
| 119 |
+
**https://huggingface.co/CodeDevX/future-prediction-multi-domain-lstm**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|