I am trying to use movements identified from accelerometers during sleep to predict gait speed (continuous). I am trying to figure out what the best machine learning algorithms/ feature extraction methods can be used to use as much of the information as possible in this prediction.

I am currently identifying every movement that occurs during sleep for each night measured and then extracting features from the accelerations of each movement. I then average all of these features over each movement identified during the night and then each night measured for that person, resulting in 1 set of features per person. This can be easily used in machine learning algorithms to predict gait speed as a continuous variable.

However, I think by averaging over all of the movements per night and then over all of the nights collected, I am losing a lot of information about the individual movements of each person. Is there a way to include all of the movements (~200-1000) from one person as instances that can be used to predict the 1 set of outcomes per person? If not, is there a better way to condense the number of movements in into 1 instance per person without losing a ton of information from taking an average? Maybe using clustering?

Thanks for any input!


1 Answer 1


I think you would benefit from keeping your data as a time series and use a sequence model. Commonly you would use an RNN, the most popular flavor would be a LSTM.

Here is an example using Keras that I think is relevant for you

Multivariate example from same blog (but forecasting instead of classification)

LSTM with regression

  • $\begingroup$ Thanks for the help. I have actually read the examples on that page previously and agreed that it could be a great approach for this data. However, I have only those types of models used in this context to classify movements or to do time series forcasting. My goal is to input many movement accelerations/features per subject and output 1 gait speed prediction that was measured separately from the accelerations. Is it still possible to do that with RNN, LSTM or similar neural networks? $\endgroup$
    – srigot55
    Commented Mar 28, 2019 at 17:20
  • $\begingroup$ Yes, RNNs work well with multivariate time series. I added a link from the same blog. $\endgroup$ Commented Mar 28, 2019 at 17:28
  • $\begingroup$ Thanks again for the example. Do you know of any examples that use deep learning methods like that to predict something separate from what was input (not time series forecasting or classification)? For example, the multivariate link you provided uses time series of pollution and other weather variables to predict future pollution. My problem would be like using pollution time series to predict the number of hospital admissions; I think the 2 variables are related and you should be able to use one to predict the other, but the thing being predicted isn't directly measured in the time series. $\endgroup$
    – srigot55
    Commented Mar 29, 2019 at 18:18
  • $\begingroup$ Yes, it is called regression and there is a link I provided now (The one with loss='mse'). But we should not do new topics in the comments. Please vote my answer as correct if you feel that your question was answered, and open a new question if there is something new you want answered. $\endgroup$ Commented Mar 29, 2019 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.