title: Keras LSTM for classification of time series with irregular intervals
body: <p>I have a data set with various samples, each sample having one or more events at irregular time intervals. There are several features associated with the events. I want to predict binary labels associated with each sample.</p>
  
  <p>The data set looks like this:</p>
  
  <pre><code>    import pandas as pd
      X = pd.DataFrame({'id': [1,1,1,2,2,3,3,3,3],
                'time': [-1,-5,-10,-2,-4,-1,-4,-7,-10],
                'var1': [1,2,1,3,1,2,1,3,1], 
                'var2': [3,3,1,4,1,3,3,1,2],
                'var3': [4,5,6,1,3,5,6,7,8]})
  
      Y = pd.DataFrame({'id': [1,2,3],
                'label': [0,1,0]})
  </code></pre>
  
  <p>In X, the column id is the sample, time reflects how many days ago was the event. Var1..3 are features associated with the event (categorical). 
  In Y, column label is the response to be predicted.</p>
  
  <p>In the actual data set, the number of events per sample varies quite a lot, from 1 to few hundered.</p>
  
  <p>How can I use Keras LSTM to render a prediction of the label in the Y data frame, using the features of the past events in the X data frame?</p>