Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classifier package ppg #109

Merged
merged 96 commits into from
Jan 16, 2025
Merged

Classifier package ppg #109

merged 96 commits into from
Jan 16, 2025

Conversation

KarsVeldkamp
Copy link
Contributor

@KarsVeldkamp KarsVeldkamp commented Jan 13, 2025

In this PR I have added the classifier package of PPG but also:

  1. Removed all redundant matlab files to clean up the toolbox
  2. Change ppg to heart_rate
  3. fix abs_stats in heart rate pipeline

@Erikpostt Most of the adjustments are clean-up and almost all relevant additions are in heart_rate_analysis.py

KarsVeldkamp and others added 30 commits December 3, 2024 08:36
@KarsVeldkamp KarsVeldkamp changed the title DRAFT: Classifier package ppg Classifier package ppg Jan 16, 2025
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Execution counts :(

@@ -244,7 +244,7 @@ def __init__(self, step: str | None = None) -> None:


class HeartRateConfig(PPGConfig):
def __init__(self, sensor: str = 'ppg', min_window_length: float = 10) -> None:
def __init__(self, sensor: str = 'ppg', min_window_length: int = 30) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to rename it to min_window_length_s to clarify the units.

Copy link
Contributor

@Erikpostt Erikpostt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, made some small suggestions but otherwise ready to merge.

@KarsVeldkamp
Copy link
Contributor Author

@Erikpostt implemented the suggestions and will merge it now

@KarsVeldkamp KarsVeldkamp merged commit 7c8aa9b into main Jan 16, 2025
1 check passed
@KarsVeldkamp KarsVeldkamp deleted the classifier-package-ppg branch January 16, 2025 14:48
@KarsVeldkamp KarsVeldkamp restored the classifier-package-ppg branch January 17, 2025 14:28
@KarsVeldkamp KarsVeldkamp deleted the classifier-package-ppg branch January 17, 2025 15:10
KarsVeldkamp added a commit that referenced this pull request Jan 17, 2025
* change test output

* Update tremor_analysis.ipynb

* add documentation

* fix bug

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* Simplify

* Updating Poetry

* clear execution count

* Remove angle and velocity from preprocessing

* import heart_rate_estimation

* Change rotation axes

* Adjust parameters segmentation

* Add flexibility for pathing

* Return a Series instead of df

* ensure features dont scale when storing

* Update tabulate windows

* Heart rate estimation (#85)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* clear execution counts

* execution counts + indentation + short documentation

* update final comments + small matlab changes

* merge updates

* Solve pytype issue

* Solve pytype issue

* added suggestions

* remove execution counts

* update ppg_analysis

* test update notebook

* execution counts

* Vectorize merging of predictions with timestamps

* Add flexibility to filtering gait parameters

* Remove redundant cells in notebooks

* Solve bugs

* Solve conflict

* Continue process when dataframe is empty

* Modify quantification

* Modify quantification

* Typo

* Add flexibility for pred proba to merging

* Add flexibility for pred proba to merging

* Add flexibility for pred proba to merging

* Solve numpy/list bug

* Solve numpy/list bug

* Solve numpy/list bug

* Solve numpy/list bug

* Start catching errors

* Start catching errors

* Fix np.nan issue

* Fix np.nan issue

* Reduce memory reqs

* Temp for debugging

* Temp for debugging

* Typo

* replace df to numpy arrays

* fix notebook

* adding accelerometer feature

* fix type error list vs float

* Expand feature extraction docs

* change notebook accordingly

* Update notebooks

* Add '1' to MFCC filter points

* implement accelerometer feature

* update matlab file based on refactoring

* fixing types, docstrings and readibility

* adding documentation acc feature

* add documentation of autocorrelation

* Pandas to numpy ppg (#93)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* First steps to refactoring to numpy

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* import heart_rate_estimation

* merge updates

* update ppg_analysis

* replace df to numpy arrays

* fix notebook

* fix type error list vs float

* fixing types, docstrings and readibility

* add documentation of autocorrelation

---------

Co-authored-by: Erikpostt <erik_post_6@hotmail.com>

* Modify test data

* Change mfcc param

* Change mfcc param

* Structure

* Reset legacy for the time being

* Adjust test scripts to changes

* Adjust tremor to changes

* structure docstrings

* Improve consistency of docstrings

* Structure testing

* Update test data

* Resolve pytype error

* Adjust tabulate_windows to new version

* Ensure first column is returned for PPG

* modify mfcc calculation and update classifier

* Made requested changes

* fix config

* modify test data

* Adding accelerometer to ppg (#95)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* First steps to refactoring to numpy

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* import heart_rate_estimation

* merge updates

* update ppg_analysis

* replace df to numpy arrays

* fix notebook

* adding accelerometer feature

* fix type error list vs float

* implement accelerometer feature

* update matlab file based on refactoring

* fixing types, docstrings and readibility

* adding documentation acc feature

* add documentation of autocorrelation

* Made requested changes

* fix config

---------

Co-authored-by: Erikpostt <erik_post_6@hotmail.com>

* add tutorial

* Solve issues raised by reviewer

* Rerun notebooks ppg

* Change scalers, classifiers and thresholds

* Update test files

* Add aggregation of quantification

* modified tutorial

* update tutorial

* remove execution counts

* Add ability to create classifier objects

* Test to remove rom features

* Test to remove rom features

* adding aggregation heart rate

* Adjust functions to classification package

* Update package loading

* Adjust gait pipeline to classifier packages

* added suggestions

* Change test data with new classifier

* Adjust tests and ensure Path used in notebooks

* Change pathing to fix poetry pytest

* restructure functions

* update test data

* update tutorial

* fixed typo's

* Merge with main

* update aggregates

* remove config

* Add files via upload

* add start tutorial

* aggregation implementation with dictionary

* add lines for consistency

* Add user guides for coordinate system and update index of docs

* moved windoweddataextractor to segmenting

* Displays outputs of data preparation tutorial

* Heart rate aggregation (#102)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* First steps to refactoring to numpy

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* import heart_rate_estimation

* merge updates

* update ppg_analysis

* replace df to numpy arrays

* fix notebook

* adding accelerometer feature

* fix type error list vs float

* implement accelerometer feature

* update matlab file based on refactoring

* fixing types, docstrings and readibility

* adding documentation acc feature

* add documentation of autocorrelation

* Made requested changes

* fix config

* adding aggregation heart rate

* update aggregates

* remove config

* aggregation implementation with dictionary

* add lines for consistency

* moved windoweddataextractor to segmenting

* updates based on review

---------

Co-authored-by: Erikpostt <erik_post_6@hotmail.com>

* resolve merge conflict

* add tremor classifier package

* update notebook

* remove execution counts

* Modify according to feedback of reviewer

* update test function

* Concat forward & backward pav to allow for dataframes

* Renaming functions

* Add error messages when df is empty

* Print -> Raise eerror messages when df is empty

* Also raise when no gait without other arm activity

* Remove irrelevant test files and raise valuerrors

* Reset to io wrappers

* Update docstrings

* update loading + preprocessing with seperate functionality

* update tutorial notebook and corresponding notebook

* change path usage

* Update test to io function

* Update README.md

* print notebook output

* change total psd

* add function links

* Faster computation using any()

* Remove unnecessary improts

* Tutorial ppg (#106)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* First steps to refactoring to numpy

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* import heart_rate_estimation

* merge updates

* update ppg_analysis

* replace df to numpy arrays

* fix notebook

* adding accelerometer feature

* fix type error list vs float

* implement accelerometer feature

* update matlab file based on refactoring

* fixing types, docstrings and readibility

* adding documentation acc feature

* add documentation of autocorrelation

* Made requested changes

* fix config

* adding aggregation heart rate

* update aggregates

* remove config

* add start tutorial

* aggregation implementation with dictionary

* add lines for consistency

* moved windoweddataextractor to segmenting

* resolve merge conflict

* update loading + preprocessing with seperate functionality

* update tutorial notebook and corresponding notebook

* Update test to io function

* update tutorial and notebook with simplified loading of the data

* Reset execution counts in notebook cells

* update execution_counts and output

* Updates from PR feedback

* fix type error

* made final feedback

---------

Co-authored-by: Erikpostt <erik_post_6@hotmail.com>
Co-authored-by: Erik Post <57133568+Erikpostt@users.noreply.github.com>

* Resolve merge conflict

* add suggestions

* Move notebooks to parent directory and remove subdirectories

* change total_psd_calculation again

* Modify structure of files

* Update classifier, update test data, update dependencies, update testing gait pipeline

* Update dtypes heart rate pipeline

* Reset scikit version, update tremor values

* Remove notebook temporarily to pass tests

* Reduce no. of configs and change notebooks accordingly

* Update test data

* Remove redundant files

* final suggestions

* Modify tremor low freq power and slightly adjust tutorial

* Change git attributes to ensure output in tutorials

* Test displaying output tutorials

* Test displaying output tutorials

* Test II

* Update config and remove nbstripout from gitattributes

* Add tutorial outputs other domains

* Merge conflict heart rate pipeline

* Merge conflicts gait pipeline

* Merge conflicts gait pipeline

* Update notebooks

* Revert time to first binary file

* Add suggestions

* Iterate on tutorial gait

* Complete gait pipeline

* Classifier package ppg (#109)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* First steps to refactoring to numpy

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* import heart_rate_estimation

* merge updates

* update ppg_analysis

* replace df to numpy arrays

* fix notebook

* adding accelerometer feature

* fix type error list vs float

* implement accelerometer feature

* update matlab file based on refactoring

* fixing types, docstrings and readibility

* adding documentation acc feature

* add documentation of autocorrelation

* Made requested changes

* fix config

* adding aggregation heart rate

* update aggregates

* remove config

* add start tutorial

* aggregation implementation with dictionary

* add lines for consistency

* moved windoweddataextractor to segmenting

* resolve merge conflict

* update loading + preprocessing with seperate functionality

* update tutorial notebook and corresponding notebook

* Update test to io function

* update tutorial and notebook with simplified loading of the data

* Reset execution counts in notebook cells

* update execution_counts and output

* Updates from PR feedback

* fix type error

* remove unneccessary matlab files

* update merge conflicts

* update using classifier package

* fix pkl feature names in scaler and delete old classifier files

* renaming ppg to heart rate

* rename files ppg to heart_rate

* remove legacy classification

* renaming clf_package

* modify tutorial

* update abs stats

* update tutorial based on abs stats output

* Remove redundant stuff from notebook

* remove tremor txt files

* update tutorial based on right config settings

* type error fix

* fix type error

* update based on suggestions

---------

Co-authored-by: Erikpostt <erik_post_6@hotmail.com>
Co-authored-by: Erik Post <57133568+Erikpostt@users.noreply.github.com>

* Add tutorial data

* Update tutorial per reviewers remarks

* Remove output notebooks

* Update docs

* DRAFT: Update sync functions (#115)

* Start heart rate estimation including tfd

* stash updates

* update based on merge conflicts

* update hr main function

* update minor stuff matlab files

* change tfd parameters to dict

* First steps to refactoring to numpy

* Finalizing heart rate pipeline plus renaming preprocessing to acc instead of imu

* setting execution count to null

* fix output types

* fixing pytype due to old configs

* fix min_hr_samples pytype error

* remove irrelevant config

* resolved comments PR reviewer

* remove data type since it causes pytype error

* clear execution count

* import heart_rate_estimation

* merge updates

* update ppg_analysis

* replace df to numpy arrays

* fix notebook

* adding accelerometer feature

* fix type error list vs float

* implement accelerometer feature

* update matlab file based on refactoring

* fixing types, docstrings and readibility

* adding documentation acc feature

* add documentation of autocorrelation

* Made requested changes

* fix config

* adding aggregation heart rate

* update aggregates

* remove config

* add start tutorial

* aggregation implementation with dictionary

* add lines for consistency

* moved windoweddataextractor to segmenting

* resolve merge conflict

* update loading + preprocessing with seperate functionality

* update tutorial notebook and corresponding notebook

* Update test to io function

* Update notebook with functional links

* move scan_and_sync_segments to util with corresponding functions

* remove ppp functionalities from util

* Correct implementation of the extract_overlapping_segments

* update tests without scan_and_sync_segments

* updates based on suggestions

* fix type error

---------

Co-authored-by: Erikpostt <erik_post_6@hotmail.com>

* Major reshuffling of files and directories

* Adding nbsphinx

* update tutorials functional links + preprocessing

* Update readme contact (#119)

---------

Co-authored-by: nienketimmermans <65012819+nienketimmermans@users.noreply.github.com>
Co-authored-by: KarsVeldkamp <veldkampkars@gmail.com>
Co-authored-by: KarsVeldkamp <105375796+KarsVeldkamp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants