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

Missing Most of the Functionality In The Paper #5

Open
mrucker opened this issue Oct 17, 2022 · 14 comments
Open

Missing Most of the Functionality In The Paper #5

mrucker opened this issue Oct 17, 2022 · 14 comments

Comments

@mrucker
Copy link

mrucker commented Oct 17, 2022

After reviewing your code more it appears that most of the functionality claimed in the paper is missing.

https://www.sciencedirect.com/science/article/pii/S0169260721005356

Are there plans to fix this?

@enniin
Copy link

enniin commented Mar 26, 2024

I noticed the same issue. I find this a bit misleading. Please at least inform us of this on the readthedocs page of the project -- not everyone is capable of examining the code in such detail as to notice the lack of e.g. preprocessing steps for the EDA pipeline.

That said, it would also be marvellous to have the full functionality. Please consider continuing with this!

@mrucker
Copy link
Author

mrucker commented Mar 26, 2024

@enniin, If you really need the functionality it all exists in various feature branches that have never been merged into master (or published on pypi). If you are using more than EDA, also note that there are problems with the ACC preprocessing and HRV preprocessing as well. For our work, my team ended up going with the Neurokit2 package.

@hidaIgo
Copy link

hidaIgo commented Mar 26, 2024

@enniin, If you really need the functionality it all exists in various feature branches that have never been merged into master (or published on pypi). If you are using more than EDA, also note that there are problems with the ACC preprocessing and HRV preprocessing as well. For our work, my team ended up going with the Neurokit2 package.

Thanks for the clarification, I am in the same situation. Neurokit2 works with empatica E4 wristband?

@mrucker
Copy link
Author

mrucker commented Mar 27, 2024

You have to load the data into numpy arrays before passing it to NeuroKit2. But yes, it does work with E4 wristband. That's what my lab uses.

@enniin
Copy link

enniin commented Mar 28, 2024

@enniin, If you really need the functionality it all exists in various feature branches that have never been merged into master (or published on pypi). If you are using more than EDA, also note that there are problems with the ACC preprocessing and HRV preprocessing as well. For our work, my team ended up going with the Neurokit2 package.

Thank you!! I think for this situation I will try to use the EDA-branch, though it does seem unmaintained -- there are some problems with getting it installed. (I guess I could make a pull request of it, as I managed to solve them, even if there's no maintainer to take them on board...) Thank you also for the tip on Neurokit2! It will be my second option.

@hidaIgo
Copy link

hidaIgo commented Apr 4, 2024

You have to load the data into numpy arrays before passing it to NeuroKit2. But yes, it does work with E4 wristband. That's what my lab uses.

Hi again, after a few days testing with neurokit2 I can't get features for the data that empatica E4 offers, if it's no bother, would you have any example that I can see? I am a student, it is not for professional purposes.

My purpose is to introduce to a ML model, different events of about 10 minutes labeled together with relevant features of the signals.

@mrucker
Copy link
Author

mrucker commented Apr 5, 2024

@hidaIgo Yeah, totally, What E4 sensor are you interested in? I assume EDA and BVP?

@hidaIgo
Copy link

hidaIgo commented Apr 5, 2024

@hidaIgo Yeah, totally, What E4 sensor are you interested in? I assume EDA and BVP?

For the moment yes, later I would like to try them all, but to start with EDA and BVP is fine. Thank you very much!

@mrucker
Copy link
Author

mrucker commented Apr 5, 2024

For EDA it might look something like this:

image

@mrucker
Copy link
Author

mrucker commented Apr 5, 2024

For HRV from BVP it looks something like this:

image

@hidaIgo
Copy link

hidaIgo commented Apr 8, 2024

For EDA it might look something like this:

image

Thank you very much! And how could I do this EDA feature extraction by specifying a window size and the window step size just like with flirt? What values for these should I test?

You are being a great help, sorry for the inconvenience.

@mrucker
Copy link
Author

mrucker commented Apr 8, 2024

You just have to split your EDA.csv file down into the windows/steps you want to calculate features for.

For example, the EDA signal on the E4 samples at 4hz.

So if you wanted features for 10 minute windows with a 5 minute step size then you'd do something like:

stp_size = 4*60*5 #5 minutes
win_size = 4*60*10 #10 minutes
n_windows = int(len(signal)>win_size) + (len(signal)-stp_size)/win_size
windows = [ signal[i*step_size: i*step_size+win_size] for i in range(n_windows) ]

for window in windows:
   # Calculate the EDA features using this signal window.

The most appropriate window size and step size really depends on your use case and what you're trying to predict. In general I'd say having a step size that is half of your window size is a good heuristic. That will let you stretch your data a little bit further so long as you're careful that overlapping windows don't get split between training and test. To figure out window size you'll just need to test different sizes.

@hidaIgo
Copy link

hidaIgo commented Apr 9, 2024

You just have to split your EDA.csv file down into the windows/steps you want to calculate features for.

For example, the EDA signal on the E4 samples at 4hz.

So if you wanted features for 10 minute windows with a 5 minute step size then you'd do something like:

stp_size = 4*60*5 #5 minutes
win_size = 4*60*10 #10 minutes
n_windows = int(len(signal)>win_size) + (len(signal)-stp_size)/win_size
windows = [ signal[i*step_size: i*step_size+win_size] for i in range(n_windows) ]

for window in windows:
   # Calculate the EDA features using this signal window.

The most appropriate window size and step size really depends on your use case and what you're trying to predict. In general I'd say having a step size that is half of your window size is a good heuristic. That will let you stretch your data a little bit further so long as you're careful that overlapping windows don't get split between training and test. To figure out window size you'll just need to test different sizes.

Thanks, that's exactly what I meant!

I don't quite understand how to make the overlapping windows not split between training and testing. I may have misunderstood the construction of the dataset.

An example: I have 2 EDA.csv files corresponding to two events (each 1 hour long), I process them separately as you said (with 10 minutes of window and a 5 minutes jump). This way I will have 7 windows for each file/event.

At the same time as I calculate the features for each window, I add the 'Mood' column to predict, so I have 7 rows with the same value of the target column, e.g. 'Happy'. On the other hand, I have another 7 rows coming from the other event with the column 'Mood' to 'Sad'.

Is this approach correct? If so, how would it be done so as not to split the overlapping windows between training and test as you say?

If not, as long as it is not a bother, could I contact you by mail so as not to fill this Issue with so many offtopic messages?

Thank you very much, I really appreciate this help.

@mrucker
Copy link
Author

mrucker commented Apr 9, 2024

Yeah, good idea. Why don't you email me.

I believe you can get my email address from my GitHub profile. If this isn't the case let me know.

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

No branches or pull requests

3 participants