Roland
Roland

Reputation: 133

Machine Learning to predict time-series multi-class signal changes

I would like to predict the switching behavior of time-dependent signals. Currently the signal has 3 states (1, 2, 3), but it could be that this will change in the future. For the moment, however, it is absolutely okay to assume three states.

I can make the following assumptions about these states (see picture):

  1. the signals repeat periodically, possibly with variations concerning the time of day.
  2. the duration of state 2 is always constant and relatively short for all signals.
  3. the duration of states 1 and 3 are also constant, but vary for the different signals.
  4. the switching sequence is always the same: 1 --> 2 --> 3 --> 2 --> 1 --> [...]
  5. there is a constant but unknown time reference between the different signals.
  6. There is no constant time reference between my observations for the different signals. They are simply measured one after the other, but always at different times.
  7. I am able to rebuild my model periodically after i obtained more samples.

Sketch of signal model and observations

I have the following problems:

  1. I can only observe one signal at a time.
  2. I can only observe the signals at different times.
  3. I cannot trigger my measurement with the state transition. That means, when I measure, I am always "in the middle" of a state. Therefore I don't know when this state has started and also not exactly when this state will end.
  4. I cannot observe a certain signal for a long duration. So, i am not able to observe a complete period.
  5. My samples (observations) are widespread in time.
  6. I would like to get a prediction either for the state change or the current state for the current time. It is likely to happen that i will never have measured my signals for that requested time.

So far I have tested the TimeSeriesPredictor from the ML.NET Toolbox, as it seemed suitable to me. However, in my opinion, this algorithm requires that you always pass only the data of one signal. This means that assumption 5 is not included in the prediction, which is probably suboptimal. Also, in this case I had problems with the prediction not changing, which should actually happen time-dependently when I query multiple predictions. This behavior led me to believe that only the order of the values entered the model, but not the associated timestamp. If I have understood everything correctly, then exactly this timestamp is my most important "feature"... So far, i did not do any tests on Regression-based approaches, e.g. FastTree, since my data is not linear, but keeps changing states. Maybe this assumption is not valid and regression-based methods could also be suitable?

I also don't know if a multiclassifier is required, because I had understood that the TimeSeriesPredictor would also be suitable for this, since it works with the single data type. Whether the prediction is 1.3 or exactly 1.0 would be fine for me.

To sum it up: I am looking for a algorithm which is able to recognize the switching patterns based on lose and widespread samples. It would be okay to define boundaries, e.g. state duration 3 of signal 1 will never last longer than 30s or state duration 1 of signal 3 will never last longer 60s. Then, after the algorithm has obtained an approximate model of the switching behaviour, i would like to request a prediction of a certain signal state for a certain time.

Which methods can I use to get the best prediction, preferably using the ML.NET toolbox or based on matlab?

Upvotes: 1

Views: 189

Answers (2)

Nooby-Noob
Nooby-Noob

Reputation: 79

One way to approach this would be to first determine the periodicity of each of the signals independently. This could be done by looking at the frequency distribution of time differences between measurements of state 2 only and separately for each signal.

This will give a multinomial distribution. The shortest time difference will be the duration of the switching event (after discarding time differences less than the max duration of state 2). The second shortest peak will be the duration between the end of one switching event and the start of the next.

When you have the 3 calculations of periodicity you can simply calculate the difference between each of them. Given you have the timestamps of the measurements of state 2 for each signal you should be able to calculate the time of switching for all other signals.

Upvotes: 0

Luis Quintanilla
Luis Quintanilla

Reputation: 649

Not sure if this is quite what you're looking for, but if detecting spikes and changes using signals is what you're looking for, check out the anomaly detection algorithms in ML.NET. Here are two tutorials that show how to use them.

Upvotes: 1

Related Questions