# How to Setup Multivariate Time Series Dataset for Classification

First post on StackExchange. I’m fairly new to ML, with about 1 year of experience so please pardon any ignorance or misuse of terms.

I have a multivariate time series dataset where I would like to predict the likelihood of an outcome of 1/0 (think of this as a Conversion) in the next 3 time periods for unique ObjectID’s. I have a table that takes snapshots of ObjectID over time, and I want to use current data to predict if the ObjectID will convert (1 or 0) in the coming 3 time periods. Once an ObjectID reaches conversion, it will stay as such.

There’s a twist: some of the X variables are static, they do not change with time. I call these attributes, there are 8 in my dataset. These are essentially characteristics ObjectID in question. I have 2 variables that change with time, Age (in months) and a categorical variable with 7 levels through which the ObjectID progresses. Here’s how the data looks:

ObjID   Age  Time      Attr1    Attr2   Att3    CurrCat Conversion
id1234  0   1/1/2019    ABC      XYZ    HIJ        A       0
id1234  1   1/2/2019    ABC      XYZ    HIJ        B       0
id1234  2   1/3/2019    ABC      XYZ    HIJ        A       0
id1234  3   1/4/2019    ABC      XYZ    HIJ        D       0 <-- current time
id6789  0   1/1/2019    CBA      ZYX    JIH        C       0
id6789  1   1/2/2019    CBA      ZYX    JIH        C       0
id6789  2   1/3/2019    CBA      ZYX    JIH        D       1
id6789  3   1/4/2019    CBA      ZYX    JIH        A       1


How can I setup this dataset for a classification or decision tree model?

I'll be building the model in Python, so any suggested packages would be helpful too.

I have good experiences with Keras LSTM. Think it should also work with the time constant features. Here is a helpful tutorial. https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/

• Thanks, do I need to change the dataset from time series to static, or can I run it through the algorithm as is? – andro302mp May 26 at 17:20
• I run as static, so no time variable specified. The LSTM requires a „lookback“ function which generates a lag of x steps, which is used in the learning process. So the time variable is defined via the lookback function. – Peter May 26 at 17:35