Skip to content

physionetchallenges/matlab-example-2026

Repository files navigation

MATLAB example code for the George B. Moody PhysioNet Challenge 2026

What's in this repository?

This repository contains a simple example that illustrates how to format a MATLAB entry for the George B. Moody PhysioNet Challenge 2026. This template was kindly provided by Allan Moser (Swarthmore College).

If you are participating in the 2026 Challenge, then we recommend using this repository as a template for your entry. You can remove some of the code, reuse other code, and add new code to create your entry. You do not need to use the models, features, and/or libraries in this example for your entry. We encourage a diversity of approaches to the Challenges.

For this example, we implemented a random forest model with several simple features. (This simple example is not designed to perform well, so you should not use it as a baseline for your approach's performance.) You can try it by running the following commands on the Challenge training set. If you are using a relatively recent personal computer, then you should be able to run these commands from start to finish on a small subset (1000 records) of the training data in a few minutes or less.

How do I run these scripts?

First, you can download the large and small training sets, as well as a supplementary set containing examples from the validation and test sets, from their respective Kaggle pages:

Second, to run the code within MATLAB, you can call the functions train_model and run_model, as follows:

Training

train_model('data', 'model', 'outputs')
% or:
%  train_model('data', 'model', 'outputs', 'v') 

where

  • data is a folder containing the Challenge data,
  • model is a folder for saving your model, and
  • and v is an optional verbosity flag.

Inference

run_model('data', 'model', 'outputs')
% or:
%  run_model('data', 'model', 'outputs', 'v')

where

  • data is a folder containing the Challenge data,
  • model is a folder containing your trained model,
  • outputs is a folder for saving your model's outputs, and
  • v is an optional verbosity flag.

You can evaluate your model by pulling or downloading the evaluation code included with the Python template and running

python evaluate_model.py -d holdout_labels -o holdout_outputs -p prevalence_labels -s scores.csv

where

  • holdout_labels (input; required) is the path to the CSV file with the labels for the held-out data;
  • holdout_outputs (input; required) is the path to the CSV file with your model's outputs for the held-out data;
  • prevalence_labels (input; required) is the path to the CSV file with labels and ages for the data; we will use the demographics.csv data for the full training set;
  • scores.tsv (output; optional) is file with a collection of scores for your model.

You can use the provided training set for the training_data and holdout_data files, but we will use different datasets for the validation and test sets, and we will not provide the labels to your code.

If the MATLAB and Python implementations of the evaluation code provide different results, then we will use the results from the Python version of the evaluation code.

Which scripts I can edit?

Please edit the following script to add your code:

  • team_training_code.m is a script with functions for training your model.
  • team_testing_code.m is a script with functions for running your model on hidden data.

Please do not edit the following scripts. We will use the unedited versions of these scripts when running your code:

  • train_model.m is a script for training your model.
  • run_model.m is a script for running your trained model.

These scripts must remain in the root path of your repository, but you can put other scripts and other files elsewhere in your repository.

How will the code be run when it's submitted?

We compile your code using mcc, then run it inside a container with a MATLAB Runtime environment set up.

The Dockerfile included here sets up the necessary environment for MATLAB R2025b. Note that you can include a different Dockerfile, as long as it meets the following criteria:

  • It contains a folder /challenge.
  • We can run your code successfully in it.

Inside the container, we run this command for training (assuming the bash variable LANGUAGE is set to the language name, e.g., MATLAB R2025b):

export AGREE_TO_MATLAB_RUNTIME_LICENSE=yes &&
      export LD_LIBRARY_PATH=/opt/matlabruntime/${LANGUAGE#MATLAB }/runtime/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/bin/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/sys/os/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/sys/opengl/lib/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/extern/bin/glnxa64 &&
      /compiled/run_train_model.sh /opt/matlabruntime/${LANGUAGE##MATLAB } /data /model

We run this command for inference:

export AGREE_TO_MATLAB_RUNTIME_LICENSE=yes &&
      export LD_LIBRARY_PATH=/opt/matlabruntime/${LANGUAGE#MATLAB }/runtime/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/bin/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/sys/os/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/sys/opengl/lib/glnxa64:`
                            `/opt/matlabruntime/${LANGUAGE#MATLAB }/extern/bin/glnxa64 &&
      /compiled/run_run_model.sh /opt/matlabruntime/${LANGUAGE##MATLAB } /holdout_data /model /outputs

How do I learn more? How do I share more?

Please see the Challenge website for more details. Please post questions and concerns on the Challenge discussion forum. Please do not make pull requests, which may share information about your approach.

Useful links

About

MATLAB example code for the PhysioNet Challenge 2026

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors