modern annotation_mask, sleep_state and posterior_rhythm

- processes.annotation_mask: the director's state words and interval rules
  on the EDF+ annotations (MNE), window dominant state and 'mixta'.
- processes.sleep_state: vigilancia's features from batched Hann
  periodograms (mne psd_array_welch), depth index, HK1K cut-offs or cohort
  reference + KMeans (scikit-learn) after train().
- biomarkers.posterior_rhythm: Welch of the wake windows (MNE), 1/f-fitted
  dominant peak, median of O1 O2 P3 P4; private copy of the baselines.
- Registered as the modern modules; Pipeline.default("modern") now runs
  the full slice.

On a synthetic study: annotation states and sleep-state labels identical to
legacy, rhythm equal (6.5 Hz); contract suites and cohort cut-offs tested.
This commit is contained in:
AlbertoPMDM
2026-11-18 20:53:52 -06:00
parent acfd3a70d4
commit 1f8793aacb
12 changed files with 885 additions and 0 deletions
@@ -0,0 +1,47 @@
{
"ref": {
"delta_beta": {
"med": 1.6117037688126001,
"disp": 0.3097998485854789
},
"ritmo_post": {
"pend": 4.934510806157707,
"orden": 0.999676072265559,
"disp": 1.021788597296859,
"med": 7.765061458878031
},
"sigma_rel": {
"med": 0.019957376774209706,
"disp": 0.012167857665235331
},
"emg": {
"med": 0.0742822337558628,
"disp": 0.056777351044491706
},
"rel_alfa": {
"med": 0.03498707283228359,
"disp": 0.016352123389996105
}
},
"cortes_A": [
-1.2326590642152986,
0.243030749000992
],
"corte_B": -0.3031551001049524,
"youden_B": 0.5286948181809392,
"validacion_cruzada": {
"cv1_corte": -0.307,
"cv1_sueno_n2_pct_mediana": 85.3,
"cv1_sueno_pre_pct_mediana": 26.8,
"cv2_corte": -0.299,
"cv2_sueno_n2_pct_mediana": 85.9,
"cv2_sueno_pre_pct_mediana": 23.0
},
"edad_meses": [
16,
36
],
"n_estudios_ref": 223,
"version": "0.2.0",
"fuente": "E13, HK1K (Zenodo 17138539); vigilancia.py del director, rasgos solo en ventanas limpias; corte B por Youden (0–300 s frente a 360–900 s)"
}