Initial import: XAUUSD news sentiment models, evals, and data tooling

TF-IDF baseline (news_sentiment.py, models/xauusd_sentiment.joblib) and the
two-head DeBERTa-v3-small transformer (transformer/, news_transformer.py)
with its Google News crawler and DeepSeek labeller (data_collect/), the
golden-set and archive evals (eval/), and the 2026-09-22 and 2026-09-27
results and progress notes.

Transformer weights (model.pt, model.onnx) and the crawl database are not
tracked; rebuild with transformer/train.py and transformer/export_onnx.py.
The DeepSeek label cache in data/ is tracked.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Harwinder Sekhon
2026-09-27 19:22:30 -04:00
commit 1d72e4006a
98 changed files with 1719757 additions and 0 deletions
@@ -0,0 +1,169 @@
{
"evaluation": {
"stratified_holdout": {
"accuracy": 0.7295081967213115,
"balanced_accuracy": 0.7079012345679012,
"classification_report": {
"accuracy": 0.7295081967213115,
"bearish": {
"f1-score": 0.82,
"precision": 0.82,
"recall": 0.82,
"support": 50.0
},
"bullish": {
"f1-score": 0.7032967032967034,
"precision": 0.6956521739130435,
"recall": 0.7111111111111111,
"support": 45.0
},
"macro avg": {
"f1-score": 0.7090234294007879,
"precision": 0.7103455964325529,
"recall": 0.7079012345679012,
"support": 122.0
},
"neutral": {
"f1-score": 0.6037735849056604,
"precision": 0.6153846153846154,
"recall": 0.5925925925925926,
"support": 27.0
},
"weighted avg": {
"f1-score": 0.7291003150885613,
"precision": 0.7288502659137014,
"recall": 0.7295081967213115,
"support": 122.0
}
},
"confusion_matrix": {
"labels": [
"bearish",
"neutral",
"bullish"
],
"matrix": [
[
41,
2,
7
],
[
4,
16,
7
],
[
5,
8,
32
]
]
},
"macro_f1": 0.7090234294007879,
"score_mae": 0.2818823212040985,
"test_examples": 122
},
"temporal_holdout": {
"accuracy": 0.6967213114754098,
"balanced_accuracy": 0.6945570783661773,
"classification_report": {
"accuracy": 0.6967213114754098,
"bearish": {
"f1-score": 0.7380952380952381,
"precision": 0.775,
"recall": 0.7045454545454546,
"support": 44.0
},
"bullish": {
"f1-score": 0.7321428571428571,
"precision": 0.7735849056603774,
"recall": 0.6949152542372882,
"support": 59.0
},
"macro avg": {
"f1-score": 0.6706349206349206,
"precision": 0.665620255909781,
"recall": 0.6945570783661773,
"support": 122.0
},
"neutral": {
"f1-score": 0.5416666666666666,
"precision": 0.4482758620689655,
"recall": 0.6842105263157895,
"support": 19.0
},
"weighted avg": {
"f1-score": 0.7046252927400469,
"precision": 0.7234323837153492,
"recall": 0.6967213114754098,
"support": 122.0
}
},
"confusion_matrix": {
"labels": [
"bearish",
"neutral",
"bullish"
],
"matrix": [
[
31,
5,
8
],
[
2,
13,
4
],
[
7,
11,
41
]
]
},
"macro_f1": 0.6706349206349206,
"score_mae": 0.32407588182906516,
"test_examples": 122,
"test_from": "2026-09-16T08:27:46+00:00",
"train_through": "2026-09-16T08:25:31+00:00"
}
},
"format_version": 3,
"model_path": "models/xauusd_sentiment.joblib",
"model_type": "domain_augmented_tfidf_logistic_regression",
"score_definition": "P(XAUUSD bullish) - P(XAUUSD bearish)",
"sklearn_version": "1.9.1",
"target": "XAUUSD",
"trained_at": "2026-09-17T18:54:46.714699+00:00",
"training": {
"database": "newsdata.db",
"domain_features": [
"explicit_xau_direction",
"usd_direction",
"treasury_yield_direction",
"hawkish_or_dovish_policy"
],
"duplicates_collapsed": 10,
"examples": 606,
"label_distribution": {
"bearish": 250,
"bullish": 221,
"neutral": 135
},
"max_features": 50000,
"min_df": 2,
"neutral_threshold": 0.05,
"random_state": 42,
"rows_without_target_label": 930,
"score_source": "llm",
"skipped_rows": 0,
"source_rows": 1546,
"target": "XAUUSD",
"target_labeled_rows": 616,
"target_score_key": "XAU",
"test_size": 0.2
}
}