I have a problem which I explained in other question. I've understood that my dataset is a sequence of states or something like that. Is there libraries to analyze sequence with python? And is it right way to use Hidden Markov Models to cluster sequences?

  • 2
    $\begingroup$ This may help. Moreover, markov hidden models are those that your current state does not have a long connection to the far previous states. I guess you need LSTM-like classifiers rather than simple rnns for classification-like tasks. $\endgroup$ – Media Apr 3 '18 at 10:14
  • $\begingroup$ I'm learning more about LSTM and RNN at the moment. Is it possible to use LSTM RNN with unsupervised data? And which tools may be useful? tensorflow.org/tutorials/recurrent - is it ok to try use with my dataset? $\endgroup$ – Andrey Apr 3 '18 at 10:28

Is there libraries to analyze sequence with python

You can take a look at here. You can also use TensorFlow if your task is sequence classification, but based on comments you have referred that your task is unsupervised. Actually, LSTMs can be used for unsupervised tasks too depending on what you want. Take a look at here.

And is it right way to use Hidden Markov Models to cluster sequences?

Markov hidden models are those that your current state does not depend on all previous states. If you your task has longterm dependencies, you can use LSTM networks. If your data does not have longterm dependencies you can use simple RNNs.

  • $\begingroup$ Thanks for your answer! I've tried one approach from this topic: stats.stackexchange.com/questions/337439/… andI got the following results: " Clusters distinguish from each other by their classes, but not by the nature of changing. I mean cluster #1 consists of sequences with classes 1 in the end and etc. But I'm trying to distinguish them by their behavior, in other words cluster1 consists of customers who has started buying other class of products. Cluster2 consists of customers who keeps buying similar class of products and etc." $\endgroup$ – Andrey Apr 3 '18 at 12:19
  • $\begingroup$ Maybe the description above of the results helps you to understand my problem. After this explanation RNN will be the right way? How do you think? $\endgroup$ – Andrey Apr 3 '18 at 12:22
  • $\begingroup$ @Andrey Do you want to have prediction why they are going to buy next? $\endgroup$ – Media Apr 4 '18 at 11:03
  • $\begingroup$ Before predicting I'm going to analyze customers behavior and their preferences. To examine different clusters of sequences of their orders. For example some of them prefer meat meals but sometimes try meals with chicken. Or identify customers who have absolutely changed their preferences. $\endgroup$ – Andrey Apr 5 '18 at 7:21
  • $\begingroup$ @Andrey Take a look at professor Andrew Ng course of deep learning specialization, the fifth course. The first week he explains the use of LSTMs for sequence generation. That may help you. $\endgroup$ – Media Apr 8 '18 at 3:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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