im-ethz / flirt

Are you ready to FLIRT with your wearable data?
https://flirt.readthedocs.io
Other
61 stars 21 forks source link

Missing Most of the Functionality In The Paper #5

Open mrucker opened 1 year ago

mrucker commented 1 year ago

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 commented 5 months ago

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 commented 5 months ago

@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.

mrucker commented 5 months ago

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 commented 5 months ago

@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.

mrucker commented 5 months ago

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

mrucker commented 5 months ago

For EDA it might look something like this:

image

mrucker commented 5 months ago

For HRV from BVP it looks something like this:

image

hidaIgo commented 5 months ago

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 commented 5 months ago

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.

mrucker commented 5 months ago

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.