2

I have text file (x_train) from sensor data such as accelerometers:

# (patient number, time in ms, normalization of X Y and Z,
# kurtosis, skewness, pitch, roll and yaw, label) respectively.
1,15,-0.248010047716,0.00378335508419,-0.0152548459993,-86.3738760481,0.872322164158,-3.51314800063,0
1,31,-0.248010047716,0.00378335508419,-0.0152548459993,-86.3738760481,0.872322164158,-3.51314800063,0
1,46,-0.267422664673,0.0051143782875,-0.0191247001961,-85.7662354031,1.0928406847,-4.08015176908,0
1,62,-0.267422664673,0.0051143782875,-0.0191247001961,-85.7662354031,1.0928406847,-4.08015176908,0

And i am working on a deep learning model RNN-LSTM with keras I am trying to detect if a patient is in a FOG (freezing of gait) stage or not

In the figure below is the chunks that i want to determine from the accelerometer signal file.

figure

and this is the x-axis, y-axis and z-axis enter image description here

y-axis

z-axis

The issue I am having now is that I can't figure out how to get those chunks programatically.

And also what I basically want is to know how often a patient have FOG or walking during a certain time window. (Window size around 3 seconds).

this is what i have tried

def rwindows(a, window):

    shape = a.shape[0] - window + 1, window, a.shape[-1]
    strides = (a.strides[0],) + a.strides
    windows = np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
    return np.squeeze(windows)

s=x_train.reshape(-1,6)
print(rwindows(s,3))

and i need to obtain the difference between signals in the case of fog and walking

hadeerdodo
  • 85
  • 10
  • I was wondering why this question looked [similar](https://stackoverflow.com/questions/50434750/python-rnn-lstm-model-low-accuracy) to [another](https://stackoverflow.com/questions/50647025/how-to-calculate-roc-for-multi-variable-rnn-model). – nuric Jun 06 '18 at 19:42
  • what is the relation between those links posted by you with my question NOW??? – hadeerdodo Jun 06 '18 at 19:57
  • 1
    Calm down, they just have the same data and they look similar, that's all. – nuric Jun 06 '18 at 19:58
  • the same data because its the same text file thats all nothing else,, but the question it self is different if you read it !!! – hadeerdodo Jun 06 '18 at 20:26
  • for others to better understand, do you mind to upload a plot of X/Y/Z accelerometer data corresponding to the time axis illustration you have above? That would greatly help (me) - something like this: https://3kpnuxym9k04c8ilz2quku1czd-wpengine.netdna-ssl.com/wp-content/uploads/2013/08/lrt-gnuplot.png – sudonym Jun 07 '18 at 09:17
  • also, please add comments and imports - if you want some input, you need to make it easy for people to get it – sudonym Jun 07 '18 at 09:25
  • @sudonym i have edited the question, can you help me plz? – hadeerdodo Jun 07 '18 at 10:01
  • The label `time in mill/sec` is meaningless, please use `ms` or `millisecond` – gboffi Jun 07 '18 at 10:14
  • ok, Done editing – hadeerdodo Jun 07 '18 at 10:23
  • Yes, I will have some suggestions to you tomorrow morning – sudonym Jun 07 '18 at 12:39
  • OK! am waiting and thanks in advance – hadeerdodo Jun 08 '18 at 17:55

0 Answers0