Skip to content

DerickMatheus/ECG-interpretation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECG-interpretation

How To Run

Downloading Data

On the "data" folder, you'll find a file named "get_data.sh". Run sh get_data.sh on your terminal and all the data will be downloaded and extracted.

Matching the Requirements

On the main folder, there's a file called "requirements.yml". Create a Conda Environment from that file and you should be ready to go.
Further instructions can be found in the link below:
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html.

Running the Code

In the main folder, go for python run.py on your terminal and you'll run the code with default values. The default values are as follows:


val_traces = 'data/ecg_tracings.hdf5'
model = 'data/model.hdf5'
real = None
noise = None
sim = 100
id_ecg = "all"

To run with values other than the default, you can type:
python run.py with 'a=value1' 'b="value2"' 'c=value3'

For example, to run for id_ecg = 1, number of simulations = 50 and another dataset, you would do:
python run.py with 'id_ecg=1' 'sim=100' 'val_traces="path/to/dataset.hdf5"'

Further instructions can be found in the link below:
https://sacred.readthedocs.io/en/stable/command_line.html

Code Output

Graphs

A graphs folder will be created in the main directory, containing the following graphs:

real.png
noiseAV_rate.png
noiseqrs.png
noisest.png
noiseaxis.png
noiseqt.png
noiserandom30.png
noiset.png
noisep.png
noiser.png
noiserandom50.png
noisepr.png
noiserandom.png
noiserhythm.png
noiseq.png
noises.png

The real.png file represents the plot for the original ECG and all the other ones represents how the ECG looks with each noise applied.

Results

A output_result folder will be created in the main directory, containing two other folders:

tests

The tests folder contains one file for each type of noise that was applied.
The files contain one vector for each simulation that was made and these vectors represent how much impact the noise caused in the judgement of the classification model.

mean

The mean folder contains one file for each execution of the code, identified by the eletrocardiogram id.
The files are in R format and contains one vector for each type of noise that was applied.
These vectors represent the mean of how much impact the noise caused in the judgement of the classification model for every simulation. That is, the vectors in this file are the mean of the vectors previously mentioned on the tests folder.

About

ECG agnostic interpretation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages