Document local Argent-1D inference
Browse files- README.md +23 -12
- metrics.json +1 -1
- requirements.txt +1 -0
README.md
CHANGED
|
@@ -50,7 +50,7 @@ Silver outputs `P(up) - 0.5`; positive values indicate an upward directional sco
|
|
| 50 |
- `config.json`: data, feature, split and transaction-cost configuration.
|
| 51 |
- `metrics.json`: validation, locked-test, foundation-model and robustness results.
|
| 52 |
|
| 53 |
-
The payload contains no raw Yahoo Finance/FRED data, Hugging Face token or intermediate checkpoint. The estimator was fitted with code revision `
|
| 54 |
|
| 55 |
## Evaluation under the repository protocol
|
| 56 |
|
|
@@ -94,24 +94,35 @@ DM compares forecast loss on the same locked dates; `Holm p` corrects the four f
|
|
| 94 |
|
| 95 |
The candidate-aware White Reality Check for the full local-plus-foundation universe is `0.042` for Silver. This is a conditional bootstrap p-value, not a probability that the model will be profitable.
|
| 96 |
|
| 97 |
-
## Reproduce inference
|
| 98 |
|
| 99 |
-
The payload intentionally does not include raw market data.
|
| 100 |
|
| 101 |
```python
|
| 102 |
import json
|
|
|
|
| 103 |
from pathlib import Path
|
| 104 |
|
| 105 |
import joblib
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
#
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
position = 1 if direction_score > 0 else -1 if direction_score < 0 else 0
|
| 116 |
print({"direction_score": direction_score, "position": position})
|
| 117 |
```
|
|
|
|
| 50 |
- `config.json`: data, feature, split and transaction-cost configuration.
|
| 51 |
- `metrics.json`: validation, locked-test, foundation-model and robustness results.
|
| 52 |
|
| 53 |
+
The payload contains no raw Yahoo Finance/FRED data, Hugging Face token or intermediate checkpoint. The estimator was fitted with code revision `2983c13`.
|
| 54 |
|
| 55 |
## Evaluation under the repository protocol
|
| 56 |
|
|
|
|
| 94 |
|
| 95 |
The candidate-aware White Reality Check for the full local-plus-foundation universe is `0.042` for Silver. This is a conditional bootstrap p-value, not a probability that the model will be profitable.
|
| 96 |
|
| 97 |
+
## Reproduce inference locally
|
| 98 |
|
| 99 |
+
This is local inference only: no API, endpoint or Space is required. The payload intentionally does not include raw market data. Install the public source repository, download the current cache, reconstruct the latest causal feature row, preserve the schema order, then load the estimator:
|
| 100 |
|
| 101 |
```python
|
| 102 |
import json
|
| 103 |
+
import math
|
| 104 |
from pathlib import Path
|
| 105 |
|
| 106 |
import joblib
|
| 107 |
+
from huggingface_hub import hf_hub_download
|
| 108 |
+
|
| 109 |
+
from gold_silver.config import load_config
|
| 110 |
+
from gold_silver.data import load_cached_market_data
|
| 111 |
+
from gold_silver.features import build_features
|
| 112 |
+
|
| 113 |
+
# Run these commands once from the public source repository first:
|
| 114 |
+
# pip install -e .
|
| 115 |
+
# python scripts/download_data.py
|
| 116 |
+
model = joblib.load(hf_hub_download("AurelPx/Argent-1D", "model.joblib"))
|
| 117 |
+
schema = json.loads(Path(
|
| 118 |
+
hf_hub_download("AurelPx/Argent-1D", "feature_schema.json")
|
| 119 |
+
).read_text())
|
| 120 |
+
|
| 121 |
+
config = load_config("configs/default.yaml")
|
| 122 |
+
history = load_cached_market_data(config)
|
| 123 |
+
features = build_features(history, config)
|
| 124 |
+
X_next = features[schema["feature_columns"]].tail(1)
|
| 125 |
+
direction_score = float(model.predict_proba(X_next)[0, 1] - 0.5)
|
| 126 |
position = 1 if direction_score > 0 else -1 if direction_score < 0 else 0
|
| 127 |
print({"direction_score": direction_score, "position": position})
|
| 128 |
```
|
metrics.json
CHANGED
|
@@ -250,5 +250,5 @@
|
|
| 250 |
"btc": "BTC-USD"
|
| 251 |
}
|
| 252 |
},
|
| 253 |
-
"source_code_revision": "
|
| 254 |
}
|
|
|
|
| 250 |
"btc": "BTC-USD"
|
| 251 |
}
|
| 252 |
},
|
| 253 |
+
"source_code_revision": "2983c13"
|
| 254 |
}
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
joblib>=1.3
|
| 2 |
numpy>=1.26
|
| 3 |
pandas>=2.2
|
|
|
|
| 1 |
+
huggingface_hub>=0.30
|
| 2 |
joblib>=1.3
|
| 3 |
numpy>=1.26
|
| 4 |
pandas>=2.2
|