I have a data frame with multiple ids which have their own time series data. Here, I only provide a simple example. I would like to cluster them into 2 (in real data 10) classes. I have tried to use the time series clustering in this tutorial, however it does not work for me (since it has time and etc.) Could you help me with that? Here is my dataframe:

import pandas as pd 

df = pd.DataFrame()
df['id'] = [1, 2, 3, 4]
df ['value_1'] = [2, 3, 4, 6]
df ['value_2'] = [5,1, 4, 6]
df ['value_3'] = [2, 2, 4, 9]

1 Answer 1


You case use GMM for clustering or advanced ml algorithms like TICC. whose clusters are formed based on different distribution/patterns.

Catch here is you don't feed "time" feature while training. TICC treats each time as a one state. You can find more details in this paper: https://cs.stanford.edu/people/jure/pubs/ticc-kdd17.pdf

Thanks, Hope this was helpful. :)


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.