All Projects → Aura-healthcare → hrv-analysis

Aura-healthcare / hrv-analysis

Licence: GPL-3.0 license
Package for Heart Rate Variability analysis in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to hrv-analysis

ReinforcementLearning Sutton-Barto Solutions
Solutions and figures for problems from Reinforcement Learning: An Introduction Sutton&Barto
Stars: ✭ 20 (-91.11%)
Mutual labels:  feature-engineering
AutoTabular
Automatic machine learning for tabular data. ⚡🔥⚡
Stars: ✭ 51 (-77.33%)
Mutual labels:  feature-engineering
hamilton
A scalable general purpose micro-framework for defining dataflows. You can use it to create dataframes, numpy matrices, python objects, ML models, etc.
Stars: ✭ 612 (+172%)
Mutual labels:  feature-engineering
PubMed-Best-Match
Machine-learning based pipeline relying on LambdaMART currently used in PubMed for relevance (Best Match) searches
Stars: ✭ 36 (-84%)
Mutual labels:  feature-engineering
systole
Systole: A python package for cardiac signal synchrony and analysis
Stars: ✭ 51 (-77.33%)
Mutual labels:  heart-rate-variability
dominance-analysis
This package can be used for dominance analysis or Shapley Value Regression for finding relative importance of predictors on given dataset. This library can be used for key driver analysis or marginal resource allocation models.
Stars: ✭ 111 (-50.67%)
Mutual labels:  feature-engineering
msda
Library for multi-dimensional, multi-sensor, uni/multivariate time series data analysis, unsupervised feature selection, unsupervised deep anomaly detection, and prototype of explainable AI for anomaly detector
Stars: ✭ 80 (-64.44%)
Mutual labels:  feature-engineering
go-featureprocessing
🔥 Fast, simple sklearn-like feature processing for Go
Stars: ✭ 81 (-64%)
Mutual labels:  feature-engineering
zca
ZCA whitening in python
Stars: ✭ 29 (-87.11%)
Mutual labels:  feature-engineering
50-days-of-Statistics-for-Data-Science
This repository consist of a 50-day program. All the statistics required for the complete understanding of data science will be uploaded in this repository.
Stars: ✭ 19 (-91.56%)
Mutual labels:  feature-engineering
anovos
Anovos - An Open Source Library for Scalable feature engineering Using Apache-Spark
Stars: ✭ 77 (-65.78%)
Mutual labels:  feature-engineering
Meditate
Meditation app for Garmin smartwatches
Stars: ✭ 42 (-81.33%)
Mutual labels:  heart-rate-variability
pyhrv
Python toolbox for Heart Rate Variability
Stars: ✭ 172 (-23.56%)
Mutual labels:  heart-rate-variability
heartrate-monitor
Heart rate variability (HRV) analysis tool to detect autonomic nerve state
Stars: ✭ 29 (-87.11%)
Mutual labels:  heart-rate-variability
Feature-Engineering-for-Fraud-Detection
Implementation of feature engineering from Feature engineering strategies for credit card fraud
Stars: ✭ 31 (-86.22%)
Mutual labels:  feature-engineering
exemplary-ml-pipeline
Exemplary, annotated machine learning pipeline for any tabular data problem.
Stars: ✭ 23 (-89.78%)
Mutual labels:  feature-engineering
NVTabular
NVTabular is a feature engineering and preprocessing library for tabular data designed to quickly and easily manipulate terabyte scale datasets used to train deep learning based recommender systems.
Stars: ✭ 797 (+254.22%)
Mutual labels:  feature-engineering
Predicting-Transportation-Modes-of-GPS-Trajectories
Understanding transportation mode from GPS (Global Positioning System) traces is an essential topic in the data mobility domain. In this paper, a framework is proposed to predict transportation modes. This framework follows a sequence of five steps: (i) data preparation, where GPS points are grouped in trajectory samples; (ii) point features gen…
Stars: ✭ 37 (-83.56%)
Mutual labels:  feature-engineering
Bike-Sharing-Demand-Kaggle
Top 5th percentile solution to the Kaggle knowledge problem - Bike Sharing Demand
Stars: ✭ 33 (-85.33%)
Mutual labels:  feature-engineering
Quora-Paraphrase-Question-Identification
Paraphrase question identification using Feature Fusion Network (FFN).
Stars: ✭ 19 (-91.56%)
Mutual labels:  feature-engineering

Heart Rate Variability analysis

PyPI version Build Status codecov License: GPL v3 Downloads

hrvanalysis is a Python module for Heart Rate Variability analysis of RR-intervals built on top of SciPy, AstroPy, Nolds and NumPy and distributed under the GPLv3 license.

The development of this library started in July 2018 as part of Aura Healthcare project, in OCTO Technology R&D team and is maintained by Robin Champseix.

alt text

Full documentation : https://aura-healthcare.github.io/hrv-analysis

Website : https://www.aura.healthcare

Github : https://github.com/Aura-healthcare

Version : 1.0.4

Installation / Prerequisites

User installation

The easiest way to install hrv-analysis is using pip :

$ pip install hrv-analysis

you can also clone the repository:

$ git clone https://github.com/Aura-healthcare/hrv-analysis.git
$ python setup.py install

Dependencies

hrvanalysis requires the following:

  • Python (>= 3.5)
  • astropy >= 3.0.4
  • future >= 0.16.0
  • nolds >= 0.4.1
  • numpy >= 1.15.1
  • scipy >= 1.1.0

Note: The package can be used with all Python versions from 3.5 to latest version (currently Python 3.9).

Getting started

Outliers and ectopic beats filtering methods

This package provides methods to remove outliers and ectopic beats from signal for further analysis. Those methods are useful to get Normal to Normal Interval (NN-intervals) from RR-intervals. Please use this methods carefully as they might have a huge impact on features calculation.

from hrvanalysis import remove_outliers, remove_ectopic_beats, interpolate_nan_values

# rr_intervals_list contains integer values of RR-interval
rr_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]

# This remove outliers from signal
rr_intervals_without_outliers = remove_outliers(rr_intervals=rr_intervals_list,  
                                                low_rri=300, high_rri=2000)
# This replace outliers nan values with linear interpolation
interpolated_rr_intervals = interpolate_nan_values(rr_intervals=rr_intervals_without_outliers,
                                                   interpolation_method="linear")

# This remove ectopic beats from signal
nn_intervals_list = remove_ectopic_beats(rr_intervals=interpolated_rr_intervals, method="malik")
# This replace ectopic beats nan values with linear interpolation
interpolated_nn_intervals = interpolate_nan_values(rr_intervals=nn_intervals_list)

You can find how to use the following methods, references and more details in the documentation:

  • remove_outliers
  • remove_ectopic_beats

Features calculation

There are 4 types of features you can get from NN-intervals:

Time domain features : Mean_NNI, SDNN, SDSD, NN50, pNN50, NN20, pNN20, RMSSD, Median_NN, Range_NN, CVSD, CV_NNI, Mean_HR, Max_HR, Min_HR, STD_HR

Geometrical domain features : Triangular_index, TINN

Frequency domain features : LF, HF, VLF, LH/HF ratio, LFnu, HFnu, Total_Power

Non Linear domain features : CSI, CVI, Modified_CSI, SD1, SD2, SD1/SD2 ratio, SampEn

As an exemple, what you can compute to get Time domain analysis is :

from hrvanalysis import get_time_domain_features

 # nn_intervals_list contains integer values of NN-interval
nn_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]

time_domain_features = get_time_domain_features(nn_intervals_list)

>>> time_domain_features
{'mean_nni': 718.248,
 'sdnn': 43.113,
 'sdsd': 19.519,
 'nni_50': 24,
 'pnni_50': 2.4,
 'nni_20': 225,
 'pnni_20': 22.5,
 'rmssd': 19.519,
 'median_nni': 722.5,
 'range_nni': 249,
 'cvsd': 0.0272,
 'cvnni': 0.060,
 'mean_hr': 83.847,
 'max_hr': 101.694,
 'min_hr': 71.513,
 'std_hr': 5.196}

You can find how to use the following methods, references and details about each feature in the documentation:

  • get_time_domain_features
  • get_geometrical_features
  • get_frequency_domain_features
  • get_csi_cvi_features
  • get_poincare_plot_features
  • get_sampen

Plot functions

There are several plot functions that allow you to see, for example, the Power Spectral Density (PSD) for frequency domain features or Poincaré Plot for non linear domain features:

from hrvanalysis import plot_psd

# nn_intervals_list contains integer values of NN-interval
nn_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]

plot_psd(nn_intervals_list, method="welch")
plot_psd(nn_intervals_list, method="lomb")

alt text

from hrvanalysis import plot_poincare

# nn_intervals_list contains integer values of NN-interval
nn_intervals_list = [1000, 1050, 1020, 1080, ..., 1100, 1110, 1060]

plot_poincare(nn_intervals_list)
plot_poincare(nn_intervals_list, plot_sd_features=True)

alt text

You can find how to use methods and details in the documentation:

  • plot_distrib
  • plot_timeseries
  • plot_psd
  • plot_poincare

Here is a high level view of the distinct building blocks of the package:

alt text

References

Here are the main references used to compute the set of features and for signal processing methods:

Heart rate variability - Standards of measurement, physiological interpretation, and clinical use, Task Force of The European Society of Cardiology and The North American Society of Pacing and Electrophysiology, 1996

Signal Processing Methods for Heart Rate Variability - Gari D. Clifford, 2002

Physiological time-series analysis using approximate entropy and sample entropy, Joshua S. Richman, J. Randall Moorman - 2000

Using Lorenz plot and Cardiac Sympathetic Index of heart rate variability for detecting seizures for patients with epilepsy, Jesper Jeppesen et al, 2014

Authors

Robin Champseix - (https://github.com/robinchampseix)

License

This project is licensed under the GNU GENERAL PUBLIC License - see the LICENSE.md file for details

How to contribute

Please refer to How To Contribute

Acknowledgments

I hereby thank Laurent Ribière and Clément Le Couedic, my coworkers who gave me time to Open Source this library. I also thank Fabien Arcellier for his advices on to how build a library in PyPi.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].