I have a large longitudinal dataset with 5 minutes granularity for a period of around 30 months from thousands of households. I want to classify them as binary output (0/1) based on the input which is also a set of binary variables (sensors activated or not- 0/1. I have a training dataset available with the labeled binary output(0/1) with binary inputs. Sample dataset

I want to know which Machine learning model will be best for this type of case where both input and outputs are binary in nature.

Whether Logistic regression is one of the options or not?


Your problem is one of "sequence classification" for which Recurrent Neural Networks (RNN) e.g. Long short-term memory (LSTM) are generally used.

See here for a good example: https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/

and here for a technical paper: https://www.cs.sfu.ca/~jpei/publications/Sequence%20Classification.pdf

Here is a specialized package for sequence classification which uses convolutional neural network (CNN): https://github.com/aajanki/sequence-classification

CPT algorithm, an accurate method for sequence prediction, can also be used here: https://www.analyticsvidhya.com/blog/2018/04/guide-sequence-prediction-using-compact-prediction-tree-python/ A continous output can easily be rounded to 0 or 1 to get binary result.

  • $\begingroup$ Thanks for the reply @rnso, My outputs are discreet(0- a person at home and 1 represents away) and inputs are reading from the movement sensors. My input is not constant as it depends on the number of sensors. (Ranges 2 to 30 sensors). We have collected training data from a pilot study having the label- my plan is to build a model based on this training data and other big data sets will be my test data. $\endgroup$ – Kirti Sundar Sahu Dec 17 '18 at 17:54
  • $\begingroup$ Best may be to get means from all sensor for a person so that you have one sequence per person. Go through links given above and also other links from internet search and you should be able to create a satisfactory model. $\endgroup$ – rnso Dec 18 '18 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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