ML Modeling approach for Event data

I have this two dataset(image below).The one on the left shows events and the right is the alarm data.

Goal : Using the two datasets, after any number of events, an alarm can be triggered.I'd like to predict when the next alarm will rise.

Approach : I am a bit confused about the approach though. This is like a time-series data. Is using RNN the best approach or is there other approaches ?

Thanks

Topic sequence time-series

Category Data Science


This is sort of a hybrid task. It is time series data, but the outcome is categorical (it's binary in fact, it's whether the alarm is triggered (1), or the alarm is not triggered (0)). What you need here is a combination of a classifier and something that takes in sequential data.

As you said, I think an LSTM RNN fits the bill. If you use tensorflow and you need some initial model to start playing around with, you can just use a tensorflow.keras sequential model with the following in order:

  1. LSTM layer
  2. dropout or dense layers of choice (don't do anything too polarizing, maybe a modest dropout depending on how big your data is)
  3. output should be a dense layer, with an activation function of either sigmoid (number of units = 1) or softmax (number of units = 2)
  4. When you compile the models, use the following loss functions:
  • if you chose sigmoid, use binary crossentropy
  • if you chose softmax, use categorical crossentropy (if your labels are one-hot encoded), use sparse categorical crossentropy (if your labels are just integers)

If you use PyTorch instead, then you can find a direct analogue to what I described.

Make sure to label your data at every timestep (whether the alarm rang or not), and check if the dataset is imbalanced and judge your model thoroughly using precision, recall, f1 score. Accuracy is misleading for imbalanced data. I hope this gives you a good direction to start the analysis.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.