I have a series of transactions like the following:

  • [0, 2, 2, 3, 1, 0, 0, 0, 1]
  • [1, 0, 0]
  • [3, 3, 1, 1]

I would like to classify each transaction as being part of one of two categories: class A or class B, the issue is that a transaction can have any length from 2 to 150 in my case. What is the best approach for classifying similar variable size time series?

  • $\begingroup$ Do you have more labelled examples ? You might try adding summary values as a separate feature vector. $\endgroup$ Apr 1, 2015 at 23:37

1 Answer 1


You can use Dynamic Time Warping distance measure, which can tell distance between different length time series. This question has some nice answers about how to do that.

However it would be instructive to construct certain summary statistics for the series and do the clustering on them.

  • $\begingroup$ Thank you, I applied an algorithm for the compression of the time series and applied DTW with KNN, it's working like a charm. I tested DTW before posting here but wasn't getting good results, you gave me the input to adapt the time series and retry with DTW. $\endgroup$ Apr 4, 2015 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.