File size: 850 Bytes
6835659
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from __future__ import annotations

from typing import Any, Dict


def extract_coherence_features(
    scores: Dict[str, float],
    drift: Dict[str, bool],
    coherence: Dict[str, Any],
) -> Dict[str, float]:
    """
    Convert a run into flat numeric features for classification.
    """
    return {
        "msci": scores.get("msci", 0.0),
        "st_i": scores.get("st_i", 0.0),
        "st_a": scores.get("st_a", 0.0),
        "si_a": scores.get("si_a", 0.0),
        "base_score": coherence.get("base_score", 0.0),
        "final_score": coherence.get("final_score", 0.0),
        "weakest_modality": coherence.get("weakest_modality", 1.0),
        "global_drift": float(drift.get("global_drift", False)),
        "visual_drift": float(drift.get("visual_drift", False)),
        "audio_drift": float(drift.get("audio_drift", False)),
    }