I have a large longitudinal dataset with 5 minute granularity for a period of around 30 months from thousands of households. I would like to classify them using a 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 would like 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?


1 Answer 1


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.

and here for a technical paper.

Here is a specialized package for sequence classification which uses convolutional neural networks (CNN).

CPT algorithm, an accurate method for sequence prediction, can also be used here. A continuous 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$ Dec 17, 2018 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, 2018 at 1:19

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.