AurelPx commited on
Commit
cecee59
·
verified ·
1 Parent(s): da6e71d

Document local Aurum-1D inference

Browse files
Files changed (5) hide show
  1. README.md +28 -13
  2. estimator.joblib +1 -1
  3. metrics.json +1 -1
  4. model.joblib +1 -1
  5. requirements.txt +1 -0
README.md CHANGED
@@ -50,7 +50,7 @@ Gold outputs a return estimate.
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 `d5f5f5f`.
54
 
55
  ## Evaluation under the repository protocol
56
 
@@ -94,25 +94,40 @@ 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.106` for Gold. 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. Construct the latest causal feature row with the source repository, preserve the schema order, then load the estimator:
100
 
101
  ```python
102
  import json
 
103
  from pathlib import Path
104
 
105
  import joblib
106
-
107
- ARTIFACT_DIR = Path(".")
108
- estimator = joblib.load(ARTIFACT_DIR / "model.joblib")
109
- schema = json.loads((ARTIFACT_DIR / "feature_schema.json").read_text())
110
-
111
- # Build this one-row DataFrame with the causal feature builder in the source
112
- # repository. It must contain exactly the columns listed in schema.
113
- X_next = build_causal_feature_row(raw_history)[schema["feature_columns"]]
114
- next_day_log_return = float(estimator.predict(X_next)[0])
115
- print(next_day_log_return)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  ```
117
 
118
  ## Data and reproducibility
 
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.106` for Gold. 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/Aurum-1D", "model.joblib"))
117
+ schema = json.loads(Path(
118
+ hf_hub_download("AurelPx/Aurum-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
+ next_day_log_return = float(model.predict(X_next)[0])
126
+ last_close = float(history["gold_close"].dropna().iloc[-1])
127
+ print({
128
+ "next_day_log_return": next_day_log_return,
129
+ "implied_next_close": last_close * math.exp(next_day_log_return),
130
+ })
131
  ```
132
 
133
  ## Data and reproducibility
estimator.joblib CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:06d7bf71c8426e7857a92d14d8d4f6319333cb5ba429a58a0786c8131179c943
3
  size 843665
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2381635b9bec90c8c26d2e2728a8dc549e06ee040e9021749b642faf10cb4611
3
  size 843665
metrics.json CHANGED
@@ -251,5 +251,5 @@
251
  "btc": "BTC-USD"
252
  }
253
  },
254
- "source_code_revision": "d5f5f5f"
255
  }
 
251
  "btc": "BTC-USD"
252
  }
253
  },
254
+ "source_code_revision": "2983c13"
255
  }
model.joblib CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:06d7bf71c8426e7857a92d14d8d4f6319333cb5ba429a58a0786c8131179c943
3
  size 843665
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2381635b9bec90c8c26d2e2728a8dc549e06ee040e9021749b642faf10cb4611
3
  size 843665
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