I have a sequence of event and would like to predict the next one. The training data looks like this:

  • Ev1,Ev2,Ev5,Ev6,Ev7
  • Ev1,Ev6,Ev99
  • Ev4,Ev3,Ev6

So, the idea is to get Ev7 given Ev1,Ev2,Ev5,Ev6

The problem is that the number of "final" events is very high (100K). I tried to look into neural network but it means the last layer would need to have size of 100K.

Can anybody point to any other ways how to do that or any examples?

  • $\begingroup$ If you must, use a hierarchical or factored model; first predict which subgroup it belongs to, then the next subgroup, and so on. However, a cardinality of 100K is not unsurmountable for today's tools. NLP problems regularly operate in precisely that space since it corresponds to the number of words in the language. $\endgroup$
    – Emre
    May 23, 2017 at 18:20
  • $\begingroup$ Peter, did you manage to figure this out and if so, can you add an answer? I am interested in solving very similar task. $\endgroup$ Jun 5, 2017 at 5:22

1 Answer 1


Hidden Markov Model (HMM) is a method that you could try out. They have been used to model very large sequences (like gene sequences).


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.