I have a dataset with me where the input is a sequence and output is just some labels. (No sequence in that) What is the best model to train that kind of dataset..?

I was using seq2seq model. But the results were very low.
Then I used multi-label svm with (1,7) ngrams. The result were better than seq2seq model. But not very good.
Can someone specify a better model..?

Thank You!!


Input is actually a set of sequences. When I was using svm, the set was flatten and considered as a one sequence. In seq2seq model, the sequences were separated with a special symbol to identify that it is a different sequence.


Input sequence does not have a finite length. An example is given below.
Say I have

input vocab: AAA, BBB, CCC, DDD, EEE

output vocab: 111, 222, 333, 444

----Input Sequence----------------------Output (Order does not matter)--
    AAA, BBB, DDD                            111, 333
    AAA, DDD, BBB                            222, 333
    DDD, BBB, AAA, CCC                       111, 444, 222
    BBB, DDD, CCC, AAA                       333

1 Answer 1


It would be helpful if you could provide some more information about the structure and characteristics of your data, without this any advice is kinda like shooting in the dark. But until then here are some things you could consider:

  • If all the sequences are of same length $l$, then you could consider using neural nets (with $l$ input nodes), or treating each entry in the sequence as a separate feature and then trying out decision trees (random forests, C5.0) or any sort of classification algorithm to that end, trained on the input sequence with the example labels.

If not:

  • Think about making them have the same lenght by imputing the missing values/setting them to NA and then continue with the classification approach. For example, decision trees have no problem with missing values in the data.

  • It is not clear to me if you want to classify your sequences or maybe just find some clusters. You could have a look at methods for clustering of longitudinal data of differing lengths. Dynamic Time Warping could give you reasonable distances between them or Symbolic Aggregate Approximation.

As said, without any further info on the data and your goal, this might be a starting point.

As far as i understood - you have variable output length as well. In your last two examples a sequence of length 4 can give you either output of length 3 or 1. I'm not well informed in this type of problems and cannot give you any specific tips.
What comes to mind is setting up a recurrent neural network since you have to deal with sequences. The input vectors would be your input vocabulary, same for the outputs.
Would be interesting to know what approach did you take and how did it work for you.hth.

  • $\begingroup$ I have edited the question.. $\endgroup$
    – Ramesh-X
    Commented Oct 18, 2016 at 3:30
  • $\begingroup$ you might try looking up LSTM reccurent neural nets for sequence-to-sequence or sequence-to-label modeling. $\endgroup$
    – davidski
    Commented Oct 28, 2016 at 9:11

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.