Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
3497ff3
Add .gitignore
dcajal Mar 2, 2026
3fd3769
Add AUTHORS.txt with contributor names and affiliations
dcajal Mar 2, 2026
2952aa1
Add models from previous challenges
dcajal Mar 2, 2026
1aaa8f0
Add some processing scripts and methods
dcajal Mar 2, 2026
02a8229
Visual noise corrected
dcajal Mar 2, 2026
0484d8a
Refactor
dcajal Mar 3, 2026
9a73d0d
Add scripts for creating and managing smoke training datasets
dcajal Mar 3, 2026
de17158
Add documentation for project overview, Docker usage, smoke dataset, …
dcajal Mar 3, 2026
fb6216c
Add .dockerignore file to exclude datasets, artifacts, and OS/IDE files
dcajal Mar 3, 2026
689fd97
Update .gitignore to include datasets, model artifacts, and output di…
dcajal Mar 3, 2026
d3a10db
Fix paths for smoke dataset training in documentation
dcajal Mar 3, 2026
2f63033
Add progress bar functionality and print filtering for model execution
dcajal Mar 3, 2026
5e05482
Update run script and documentation to include new commands for devel…
dcajal Mar 3, 2026
4d080a1
Add unified run script with commands for building, training, and runn…
dcajal Mar 3, 2026
a2a52f3
Add note for PowerShell script execution policy in run script documen…
dcajal Mar 3, 2026
ec74b58
Add bash run script and create smoke dataset script for model trainin…
dcajal Mar 3, 2026
67d9b63
Update Docker and smoke dataset documentation for clarity and structure
dcajal Mar 3, 2026
819ca18
Refactor Docker commands in run script for improved path handling and…
dcajal Mar 3, 2026
1ebe7a8
Move lolai_models to src
dcajal Mar 3, 2026
b7cc2ea
Add evaluation commands for existing predictions in run scripts and d…
dcajal Mar 9, 2026
f70efc1
Merge pull request #1 from physionetchallenges/main
dcajal Mar 25, 2026
03fc272
Refactor dataset handling in run scripts to support supplementary dat…
dcajal Mar 27, 2026
922c109
Update run scripts to replace references from supplementary_set to te…
dcajal Mar 27, 2026
ebe970c
Add optimization tracking documentation and improve training performa…
dcajal Mar 27, 2026
8f121b7
Refactor respiratory processing to improve signal handling and featur…
rolopu1 Mar 27, 2026
de1a5cf
Cambio de tipo de datos a np.array y concatenar features
rolopu1 Mar 27, 2026
6ea8ddf
Añadir ficheros Sofia
rolopu1 Mar 27, 2026
14e0672
Fix import errors
dcajal Mar 27, 2026
6c4f780
Bypass CPAP
rolopu1 Mar 27, 2026
4fe3992
Correccion EEG
rolopu1 Mar 27, 2026
7bf2500
Update smoke dataset configuration to use 10 subjects by default and …
dcajal Mar 27, 2026
a550325
Update smoke dataset configuration to use 5 subjects by default and e…
dcajal Mar 27, 2026
ca1f9e6
Update smoke dataset configuration to use 5 subjects by default
dcajal Mar 27, 2026
e1cc32e
Refactor EEG and respiratory signal processing functions to enhance f…
dcajal Mar 27, 2026
616a1b8
Update openECGfunction.py
sromagnoli-10 Mar 28, 2026
30e2369
Update team_code.py
sromagnoli-10 Mar 28, 2026
fe8e28b
Update team_code.py
sromagnoli-10 Mar 28, 2026
112aae0
Fix invalid value encounteres in sacalar divide
dcajal Mar 28, 2026
112d75a
Merge branch 'main' of github.com:BSICoS/python-example-2026
dcajal Mar 28, 2026
866d466
creating ECG processing branch, changing folder of two functions and …
sromagnoli-10 Mar 28, 2026
af8c392
add ecg calls
rolopu1 Mar 29, 2026
19149a2
models functions
rolopu1 Mar 29, 2026
38f9671
creating ECG processing branch, changing folder of two functions and …
sromagnoli-10 Mar 29, 2026
887092d
Merged with new changes
sromagnoli-10 Mar 29, 2026
37f57f5
correction in team code for ecg features merging
sromagnoli-10 Mar 29, 2026
832741e
fixed error after merging
sromagnoli-10 Mar 29, 2026
778d925
remove pyedflib import and update requirements for xgboost
dcajal Mar 30, 2026
da9d2b8
Implement persistent feature caching to optimize data extraction process
dcajal Mar 30, 2026
a33b55e
Add caching for EEG and respiratory alias groups to optimize data pro…
dcajal Mar 30, 2026
2f32d61
Refactor EEG processing and update feature extraction to improve chan…
dcajal Mar 30, 2026
ddabe8b
Update feature extraction to focus on demographic data and refine cac…
dcajal Mar 30, 2026
4c41cf2
Add signal alias handling and improve data loading for EEG and respir…
dcajal Mar 30, 2026
486b36f
Add initial pipeline modules and refactor training logic
dcajal Mar 30, 2026
1370123
delete lolai_models
dcajal Mar 30, 2026
ad2164f
Add channel and signal utility functions for processing EEG and respi…
dcajal Mar 30, 2026
a778efd
remove unused files
dcajal Mar 30, 2026
b74b6e9
Remove unused imports and commented code
dcajal Mar 30, 2026
16c600c
Refactor and renaming
dcajal Mar 30, 2026
2947186
Add feature cache directory support in run scripts
dcajal Mar 31, 2026
cee9467
Multimodal ensemble model integration
dcajal Mar 31, 2026
e902673
Update processing functions to handle NaN values. Add imputation with…
dcajal Mar 31, 2026
fea7064
Export cache also in csv
dcajal Mar 31, 2026
eb28e11
Add data_smoke directory to .gitignore
dcajal Mar 31, 2026
1bc434e
Validate sampling frequency in compute_ecg_features and pan_tompkins …
dcajal Apr 1, 2026
b9b078e
Add segment duration and stride constants to config and update featur…
dcajal Apr 1, 2026
3f73430
Update mean to nanmean in ecg_hrv_features.py
sromagnoli-10 Apr 1, 2026
66bbd24
Segment feature aggregation
dcajal Apr 1, 2026
6a1927d
Use np.nanmean for detrending in compute_hrv_hrf function
dcajal Apr 1, 2026
c9344a3
Update minimum intervals check in compute_hrv_hrf function
dcajal Apr 1, 2026
4c2259b
Update length ecg as variable to use it in ecg_ecg_hrv_features and d…
sromagnoli-10 Apr 1, 2026
259ee8b
Update length window ecg_hrv_features.py
sromagnoli-10 Apr 1, 2026
31180c2
Update sampling frequency instead of fs ecg_hrv_features.py
sromagnoli-10 Apr 1, 2026
35e37a7
Refactor compute_ecg_features and compute_hrv_hrf functions for impro…
dcajal Apr 1, 2026
28aa94b
Refactor demographic feature extraction and segment iteration to avoi…
dcajal Apr 1, 2026
7c00450
Merge branch 'segment-signals'
dcajal Apr 1, 2026
3986308
Update resp_features into Resp_features during importresp_processing.py
sromagnoli-10 Apr 1, 2026
5179cb3
Rename Resp_features.py to resp_features.py
sromagnoli-10 Apr 2, 2026
856393a
Update import resp_features in resp_processing.py
sromagnoli-10 Apr 2, 2026
b7f3383
Update training - threshold = 0.5.py
sromagnoli-10 Apr 5, 2026
64a2023
Menor coste computacional resp y eeg
rolopu1 Apr 6, 2026
8510355
Run model feature export handling
dcajal Apr 7, 2026
7e5a5f9
Update training - CV of model hyperparameters and threshold.py
sromagnoli-10 Apr 7, 2026
594f40a
Add Train_test_split
rolopu1 Apr 8, 2026
36363cd
Merge branch 'main' of https://github.com/BSICoS/python-example-2026
rolopu1 Apr 8, 2026
2deede9
Update config - step 15 minutes.py
sromagnoli-10 Apr 8, 2026
2744229
Add cross-validation fold evaluation
dcajal Apr 8, 2026
3ca135f
Add cross-validation per site
dcajal Apr 8, 2026
19938f7
Add feature correlation threshold
dcajal Apr 8, 2026
538c606
Add mean calculation condition
dcajal Apr 8, 2026
1b6d365
Fix column number missmatch
dcajal Apr 8, 2026
b923e26
Enable hyperparameter optimization and change scoring metric to ROC A…
dcajal Apr 9, 2026
142a2d3
Update cross_validation.py
sromagnoli-10 Apr 9, 2026
f1aff83
changes
jnmadrid May 28, 2026
ec3c2e1
Merge branch 'main' of https://github.com/BSICoS/python-example-2026
jnmadrid May 28, 2026
dabab2c
Add new PowerShell script for copying new files and enhance preproces…
rolopu1 Jun 2, 2026
3d0143c
Merge branch 'main' of https://github.com/BSICoS/python-example-2026
rolopu1 Jun 2, 2026
8c0b658
Add new functions for slow wave analysis and related processing
rolopu1 Jun 2, 2026
938772c
Update file paths and enhance SW feature extraction in EEG processing
rolopu1 Jul 3, 2026
23954de
Added SW features into workflow
rolopu1 Jul 20, 2026
1384b80
Update evaluator from official Challenge repository
rolopu1 Jul 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Datasets
data/
**/training_set/
**/supplementary_set/
**/*.edf

# Artifacts
model/
model_smoke/
model_full_smoke/
outputs/
outputs_smoke/
__pycache__/
*.pyc
*.pkl
*.sav
*.joblib

# OS / IDE
.DS_Store
Thumbs.db
.vscode/
.idea/
240 changes: 240 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
# Dataset
data/
data_smoke/

# Cache
.feature_cache/

# Model artifacts
model/
model_smoke/
*.pkl
*.sav
*.joblib

# Outputs
outputs/
outputs_smoke/

# Python
__pycache__/
*.pyc

# OS
.DS_Store
Thumbs.db

# IDE
.vscode/
.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[codz]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/
graphs/

graphs
# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
#poetry.toml

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
#pdm.lock
#pdm.toml
.pdm-python
.pdm-build/

# pixi
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
#pixi.lock
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
# in the .venv directory. It is recommended not to include this directory in version control.
.pixi

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.envrc
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Cursor
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
# refer to https://docs.cursor.com/context/ignore-files
.cursorignore
.cursorindexingignore

# Marimo
marimo/_static/
marimo/_lsp/
__marimo__/

movedata.py
4 changes: 4 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sofia Romagnoli - Universidad de Zaragoza
Diego Cajal - CIBER-BBN
Josseline Madrid - Universidad de Zaragoza
Rodrigo Lozano - Universidad de Zaragoza
20 changes: 20 additions & 0 deletions RemoveTestCache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
import pandas as pd

demotest = pd.read_csv("data/test_set/demographics.csv")

cache_path = ".feature_cache"

for i in demotest.index:
h = demotest.loc[i, "SiteID"]
f = demotest.loc[i, "BidsFolder"]
session = demotest.loc[i, "SessionID"]
if os.path.exists(os.path.join(cache_path, h, f+"_ses-" + str(session)+".csv")):
print(f"Removing {os.path.join(cache_path, h, f+"_ses-" + str(session)+".csv")}")
os.remove(os.path.join(cache_path, h, f+"_ses-" + str(session)+".csv"))
if os.path.exists(os.path.join(cache_path, h, f+"_ses-" + str(session)+".sav")):
print(f"Removing {os.path.join(cache_path, h, f+"_ses-" + str(session)+".sav")}")
os.remove(os.path.join(cache_path, h, f+"_ses-" + str(session)+".sav"))

os.remove(os.path.join(cache_path, "exports", "test_features_raw.csv"))
os.remove(os.path.join(cache_path, "exports", "test_features_preprocessed.csv"))
35 changes: 35 additions & 0 deletions docs/01_overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# CINC 2026 – Visión General del Proyecto

Estamos participando en el Challenge 2026 de Computing in Cardiology.

El objetivo es predecir deterioro cognitivo a partir de datos de polisomnografía (PSG).

## Cómo nos evaluarán

La organización:

1. Construirá nuestra imagen Docker.
2. Ejecutará `train_model.py`.
3. Ejecutará `run_model.py`.
4. Evaluará las predicciones generadas.

Por tanto, la reproducibilidad mediante Docker es obligatoria.

Nuestro objetivo es garantizar que:
- El código se ejecuta sin intervención manual.
- El modelo se entrena correctamente.
- Las predicciones se generan en el formato requerido.

## Qué se puede modificar y qué no

❌ No modificar

- `train_model.py`
- `run_model.py`
- `helper_code.py`
- `evaluate_model.py`

✅ Modificar/Añadir

- `team_code.py` <-- Toda la lógica científica y de modelado debe implementarse ahí.
- Helpers, scripts, métodos: añadir a voluntad en `src/`
46 changes: 46 additions & 0 deletions docs/02_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Uso de Docker

Este documento define el contexto de ejecución con Docker.

## Requisitos

- Docker Desktop instalado (modo Linux containers)
- Dataset descargado desde Kaggle
- Dataset completo disponible en `data/training_set/` (ruta por defecto del proyecto)

Si tu dataset está en otra ubicación, actualiza la variable de ruta en el script de ejecución.

## Estructura de trabajo

Entradas:

- `data/training_set/` (dataset completo)
- `data/training_smoke/` (dataset reducido para modo desarrollo (smoke))

Salidas:

- `model/` y `outputs/` (flujo completo)
- `model_smoke/` y `outputs_smoke/` (flujo smoke/desarrollo)

## Orden recomendado de ejecución

1. Construir imagen Docker (`build`)
2. Preparar dataset smoke (`smoke`)
3. Iterar en modo desarrollo (smoke) (`train-dev` / `run-dev`)
4. Ejecutar validación completa (`train` / `run`)
5. Limpiar artefactos cuando corresponda (`clean`)

La guía paso a paso está en `docs/04_run_script.md`.

## Compatibilidad de scripts

El flujo principal del equipo está documentado con `run.sh` (Git Bash).
También existen equivalentes en PowerShell: `run.ps1` y `scripts/create_smoke.ps1`.

## Resultado esperado

Tras ejecutar la generación de predicciones (inferencia) completa, en `outputs/` se genera un `demographics.csv` con:

- Columnas originales
- `Cognitive_Impairment`
- `Cognitive_Impairment_Probability`
Loading