File size: 1,316 Bytes
ccf23d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""Disease × modality weight registry for the fusion engine.

Heuristic preset weights — tune offline as clinician feedback arrives.
"""
from __future__ import annotations

from typing import Mapping

DEFAULT_WEIGHTS: dict[str, dict[str, float]] = {
    "alzheimers": {
        "mri":             0.35,
        "eeg":             0.20,
        "clinical_mmse":   0.20,
        "clinical_moca":   0.15,
        "clinical_age":    0.10,
    },
    "parkinsons": {
        "mri":             0.20,
        "eeg":             0.30,
        "clinical_updrs":  0.30,
        "clinical_gait":   0.15,
        "clinical_age":    0.05,
    },
    "other": {
        "mri": 0.50,
        "eeg": 0.50,
    },
}


def available_diseases() -> list[str]:
    return sorted(DEFAULT_WEIGHTS.keys())


def available_clinical_tests() -> list[str]:
    """Return the bare clinical-test names (without the 'clinical_' prefix)."""
    names: set[str] = set()
    for table in DEFAULT_WEIGHTS.values():
        for key in table:
            if key.startswith("clinical_"):
                names.add(key[len("clinical_"):])
    return sorted(names)


def get_weights(disease: str) -> Mapping[str, float]:
    if disease not in DEFAULT_WEIGHTS:
        raise KeyError(f"unknown disease: {disease!r}")
    return DEFAULT_WEIGHTS[disease]