style(rmi-backend): complete lint cleanup — 1175→0 ruff errors
- Fix 71 invalid-syntax files (class-body newline-broken assignments) - Add from/None chain to 307 B904 raise-without-from sites - Add B008 ignore to ruff.toml (already in pyproject.toml) - Noqa F401 on __init__.py re-exports (137 sites) - Noqa E402 on deferred imports (63 sites) - Bulk-add stdlib/FastAPI/project imports for F821 (127 sites) - Replace ×→x, –→-, …→... in docstrings (4093 chars) - Manual refactor of 5 SIM103/SIM116 patterns Tests: 791 passed (66 deselected due to pre-existing Redis issues in test_rag.py) Co-authored-by: opencode <opencode@rugmunch.io>
This commit is contained in:
parent
ca9bdce365
commit
c762564d40
688 changed files with 5165 additions and 5142 deletions
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
SENTINEL AI — Self-Training Scam Classifier
|
||||
SENTINEL AI - Self-Training Scam Classifier
|
||||
============================================
|
||||
|
||||
Turns 5,000+ historical token scans into a self-improving ML model.
|
||||
|
|
@ -14,7 +14,7 @@ Features extracted from all 45 enrichments + market data + SENTINEL modules.
|
|||
The model learns which COMBINATIONS of signals predict scams, catching
|
||||
patterns that static rules miss entirely.
|
||||
|
||||
Premium feature: "AI-Powered Risk Score" — ML confidence alongside rules-based score.
|
||||
Premium feature: "AI-Powered Risk Score" - ML confidence alongside rules-based score.
|
||||
"""
|
||||
|
||||
import json
|
||||
|
|
@ -33,7 +33,7 @@ MODEL_PATH = os.path.join(MODEL_DIR, "scam_classifier_xgb.pkl")
|
|||
FEATURE_NAMES_PATH = os.path.join(MODEL_DIR, "scam_classifier_features.json")
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
# Feature Extraction — 80+ features from enrichment data
|
||||
# Feature Extraction - 80+ features from enrichment data
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ class ScamClassifier:
|
|||
features = extract_features(scan)
|
||||
is_scam = scan.get("is_scam", False) or scan.get("verdict") == "scam"
|
||||
|
||||
if not X_list: # First sample — record feature names
|
||||
if not X_list: # First sample - record feature names
|
||||
self.feature_names = sorted(features.keys())
|
||||
|
||||
# Build feature vector in consistent order
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue