Spaces:
Sleeping
Sleeping
Commit History
-
Production hardening: real calibration, request limits, logging, unified policy
F15 - Calibration measured against observed outcomes, not coin flips. /continuous-update and /autonomous-cycle computed ECE against np.random.choice([0,1], p=[0.8,0.2]). The verdict was written to calibration_memory and /shadow-learning-status reported it back as the safety gate status, so random numbers became a governance judgement and were then presented as evidence the model was behaving. fetch_matured_calibration_pairs() joins model_predictions to risk_outcomes on (user_id, snapshot_date), keeps only rows whose target_date has passed, and refuses to report anything below 30 matched pairs or on a single class. Verified end to end: 29 real pairs -> ECE 0.1931, recalibration correctly flagged; 0 pairs -> "not enough matured data", nothing invented. F11 - /shadow-learning-status stops reporting literals as telemetry. fgi, both AUCs and transfer_auc were hardcoded and the gate was computed from them. Unmeasured quantities are now null with a stated reason and t…ff54386
-
Fix scoring engine: restore ML path, remove synthetic ensemble, secure key issuance
Brings the Space up to date with the audit fixes. Availability: - sqlite3 shim re-exports the real Row/Connection/Cursor. The stub Row broke the SQLite path outright and the missing Connection broke pandas.read_sql_query at 17 call sites, which silently dropped every request to the baseline heuristic. - init_db() no longer aborts module import, so a database outage returns 503 DEGRADED from /health instead of crash-looping uvicorn. - Unknown user_id returns 404 rather than scoring default features and leaking a foreign-key error; all scoring connections are wrapped in try/finally with rollback, so one failed request no longer leaves a write lock behind. Scoring correctness: - Snapshot date defaults to the user's own latest transaction rather than the global maximum, which had left 98% of users on the cold-start heuristic. Adds a data_freshness block reporting snapshot age. - Removes the synthetic ensemble that added np.random.normal() noise to the XGBoost output four …992fce0
-
Optimize database queries to batch inserts/updates and resolve API timeouts
75fce80
-
Deploy financial risk API to Hugging Face
bc308f6