NeuroKit icon indicating copy to clipboard operation
NeuroKit copied to clipboard

About recall rsp_analyze function

Open Hannahhanhan555 opened this issue 9 months ago • 7 comments

This is a template for reporting a bug. You can remove it and write from scratch. These sections are a rough guide, but the important thing is to give enough details so that the developers can reproduce the bug on their machine and then investigate.

Describe the bug I want to extract some resp features from resp data. First, I process my raw resp data, just show 2 of them. (fs = 64Hz) sig_0, info = nk.rsp_process(sig_0, 64) sig_1, info = nk.rsp_process(sig_1, 64) Then I try to extract features from processed data. f_0 = nk.rsp_analyze(sig_0, 64)

The results are like this, f_1 have more features because sig_1 has more resp cycles: `f_0 = nk.rsp_analyze(sig_0, 64)

f_0 RSP_Rate_Mean RRV_RMSSD RRV_MeanBB ... RSP_Phase_Duration_Inspiration RSP_Phase_Duration_Expiration RSP_Phase_Duration_Ratio
0 21.485973 [518.1048322371641] [2806.0897435897436] ... 1.472656 1.305288 1.128223

[1 rows x 28 columns]`

`f_1 = nk.rsp_analyze(sig_1, 64)

f_1 RSP_Rate_Mean RRV_RMSSD RRV_MeanBB ... RRV_MFDFA_alpha2_Asymmetry RRV_MFDFA_alpha2_Fluctuation RRV_MFDFA_alpha2_Increment
0 33.034043 [1331.7795392630542] [1981.7116477272727] ... [-0.5063283533806278] [0.00010017426967995603] [0.05214062328627242]

[1 rows x 37 columns] `

Until now, nothing goes wrong. but when I extract features from sig_0 again: `f_0_new = nk.rsp_analyze(sig_0, 64)

f_0_new RSP_Rate_Mean RRV_RMSSD RRV_MeanBB ... RRV_MFDFA_alpha2_Asymmetry RRV_MFDFA_alpha2_Fluctuation RRV_MFDFA_alpha2_Increment 0 21.485973 [518.1048322371641] [2806.0897435897436] ... [-0.5063283533806278] [0.00010017426967995603] [0.05214062328627242]

[1 rows x 37 columns]`

The result changed, number of feature is the same as f_1, at the same time, the added feature(MFDFA_aplha2_xxxx) are equal to those of f_1.

I have tried several times, use different signals, all results are the same.

Screenshots

qTVQ8EDijJ

System Specifications

  • OS: Windows (WindowsPE 64bit)
  • Python: 3.8.16
  • NeuroKit2: 0.2.5

Hannahhanhan555 avatar Sep 28 '23 08:09 Hannahhanhan555