# Binary classification model with time series as variables

This is probably a simple question. Assume I'm interested in modelling a binary variable, with various covariates, including ones that are time series observations. In the usual modelling approach, one can try searching for various features from the timeseries data, such as standard deviations, averages, max and etc, to make a flat model matrix.

My question: what are the tools/approaches that allow for a (relatively) simple inclusion of time series data to a classification problem?

I don't think panel regression would work since the time series data is very different among the rows, sometimes is very sparse and asynchronous. Melting the data, due to the structure, obviously wouldn't work too. Descriptive statistics is the easy way, but there should be something else?

I'm not experienced in working with neural networks, but maybe there's a NN approach that could find meaningful structures in the time series data?

I'm also thinking about clustering different time series based on their similarities and check for significance, but again, is there something robust to different length/sparseness of the time series?

• Logistic regression done in a mixed models framework would seem to be one possibility. I suspect (as do you) that a NN approach would also be possible, since NN's are generally going to give you a logistic response model.
– 42-
Nov 20, 2018 at 17:45
• @42- thanks. Would you by any chance know any good sources/examples of similar cases? Wouldn't want to reinvent the wheel, if there are good implementations available
– runr
Nov 20, 2018 at 19:29

I think one of your statements is simply a misunderstanding of the relationship of data structure and analysis. When you say "Melting the data, due to the structure, obviously wouldn't work too." you seem to failing to understand that melting the data properly would require construction of a supplemental covariate that would encode the "column location" of the values. In longitudinal data this location (in the "wide" version of the data) would become the "time" variable in the "long" format. Regression and neural network methods can handle such a format.

I intended that my comment only be a suggestion for improving a search strategy, since you had not described the task or the inputs in any great detail. So I'm "answering" with some links resulting from several variations on a search strategy along the lines of ("binary outcome" OR "signal detection" OR classification) AND ("logistic regression" OR "neural networks") AND longitudinal AND missing:

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5401893/

http://www.stats.ox.ac.uk/~snijders/WrightLondon2009.pdf

http://www.drizopoulos.com/pdf/Slides/jsm_2015.pdf

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3834930/

https://dl.acm.org/citation.cfm?id=3167596

https://mlhc17mit.github.io/slides/lecture7.pdf

https://www.cs.cmu.edu/~epxing/Class/10708-17/project-reports/project8.pdf

https://arxiv.org/pdf/1802.04664.pdf

• Thanks, I will look into it. My idea behind "melting wouldn't work" was due to the mentioned occasional sparseness, asynchronicity and different time frames - that is, long and dense series for some outcomes (or, say, "rows"), and sparse or very short for others. Therefore, model would be biased (and possibly unbalanced) towards those outcomes, that featured long and dense series. But I agree, without detailed description of inputs
– runr
Nov 21, 2018 at 8:39
• The sparseness or missing-ness can be a problem, but that is not a barrier to "melting" your data. It's a reason to consider imputation and to otherwise handle the consequences of the sparsity.
– 42-
Nov 21, 2018 at 17:04
• I think you're right in the general case. In my case, one timeseries corresponds to a lifetime of an account. There may be many, there may be one, short or long. So non-existence of an account is also information, same as popping up of a new account and instant close. Wouldn't want to lose this info, but I agree, this could be encoded in another variable. I will think about it more and try some experimenting. NB: I still think NN's should be effective of handling such info, I would imagine the various time series stacked as an image, with "black" points as missing data.
– runr
Nov 22, 2018 at 10:28
• The problem though is that some have only one series, while the other have multiple, so it wouldn't exactly be "squared" as an image would. Plus, I have no experience with NN's, so that too.. :) Thanks again for your input, though!
– runr
Nov 22, 2018 at 10:33
• There are statistical frameworks where either description and inference are done in two stages. First stage could handle the data available for all accounts and the second stage then deals with the longitudinal aspects. The third citation above is an example of this framework.
– 42-
Nov 22, 2018 at 19:24