AurelPx commited on
Commit
c2e0e95
·
verified ·
1 Parent(s): 49a0e7a

Document local Argent-1D inference

Browse files
Files changed (3) hide show
  1. README.md +23 -12
  2. metrics.json +1 -1
  3. 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 `d5f5f5f`.
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. 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
- direction_score = float(estimator.predict_proba(X_next)[0, 1] - 0.5)
 
 
 
 
 
 
 
 
 
 
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": "d5f5f5f"
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