Skip to main content

ECG-featurizer

/docs/source/img/ECG-featurizer_banner.png

A method to extract features from electrocardiographic recordings

The purpose of this package is to make tabular data from ECG-recordings by calculating many features. The package is built on WFDB [1] and NeuroKit2 [2].

Documentation Status https://travis-ci.org/ECG-featurizer/ECG-featurizer.svg?branch=master https://coveralls.io/repos/github/ECG-featurizer/ECG-featurizer/badge.svg?branch=master https://badge.fury.io/py/ECG-featurizer.svg https://pypip.in/d/ECG-featurizer/badge.svg GitHub Forks GitHub Open Issues Project Status: Active - The project has reached a stable, usable state and is being actively developed. https://zenodo.org/badge/308713553.svg

Installation

To install ECG-featurizer, run this command in your terminal:

pip install ECG-featurizer

Documentation:

Featurize .dat-files:

from ECGfeaturizer import featurize as ef

# Make ECG-featurizer object
Feature_object =ef.get_features()

# Preprocess the data (filter, find peaks, etc.)
My_features=Feature_object.featurizer_dat(features=ecg_filenames,labels=labels,directory="./data/",demographical_data=demo_data)

Featurize .mat-files:

from ECGfeaturizer import featurize as ef

number_of_ECGs = <the amount of ECGs>
directory = "<your dir>"

# Make ECG-featurizer object
Feature_object =ef.get_features()

# Preprocess the data (filter, find peaks, etc.)
My_features=Feature_object.featurizer_mat(num_features=number_of_ECGs, mat_dir = directory)

features:

A numpy array of ECG-recordings in directory. Each recording should have a file with the recording as a time series and one file with meta data containing information about the patient and measurement information. This is standard format for WFDB and PhysioNet-files [1] [3]

Supported input files:

Input data

Supported file format

ECG-recordings

.dat files

Patient meta data

.hea files

labels:

A numpy array of labels / diagnoses for each ECG-recording. The length of the labels-array should have the same length as the features-array .. code-block:: python

len(labels) == len(features)

directory:

A string with the path to the features. If the folder structure looks like this:

mypath
├── ECG-recordings
│ ├── A0001.hea
│ ├── A0001.dat
│ ├── A0002.hea
│ ├── A0002.dat
│ └── Axxxx.dat

then the feature and directory varaible could be:

features[0] “A0001”

directory “./mypath/ECG-recordings/”

demographical_data:

The demographical data that is used in this function is age and gender. A Dataframe with the following 3 columns should be passed to the featurizer() function.

age

gender

filename_hr

0

11.0

1

“A0001”

1

57.0

0

“A0002”

2

94.0

0

“A0003”

3

34.0

1

“A0004”

The strings in the filename_hr -column should be the same as the strings in the feature array. In this example gender is OneHot encoded such that

1 = Female 0 = Male

Tutorials:

Other examples:

Contributing

GPLv3 license

Citation:

Citation guidelines will come

Popularity:

https://img.shields.io/pypi/dd/ECG-featurizer https://img.shields.io/github/stars/ECG-featurizer/ECG-featurizer https://img.shields.io/github/forks/ECG-featurizer/ECG-featurizer

References:

Metadata

Release files for ECG-featurizer 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ECG-featurizer 1.0.7
File Size Uploaded
ECG-featurizer-1.0.7.tar.gz 129.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ECG-featurizer 1.0.7
File Interpreter ABI Platform
ECG_featurizer-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 148.1 kB

Release files / ECG-featurizer-1.0.7.tar.gz

Download URL ECG-featurizer-1.0.7.tar.gz
Size 129.7 kB
Tags Source
SHA-256 checksum
How to use checksums
67c466394af93d73c29420813fd528a66ab8807c57431b0db63dd9e840dee577
BLAKE2b-256 checksum
How to use checksums
2f924dc9bba447407e09414c564b69908fc5192b31fbe02274f884dd38caa3d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release files / ECG_featurizer-1.0.7-py3-none-any.whl

Download URL ECG_featurizer-1.0.7-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c3dfd5e60861b740dce3a9b64400e6ee0679059706e9844e1b5082c00fdabd0
BLAKE2b-256 checksum
How to use checksums
a77b99bd6bd2d779da73a2bae6eb439706a6b157f2cdb13932dcfdcbc773416d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

1 release file

1.0.0

1 release file

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page