I have the following list of numbers (1 – 5 categories, first row) that I am trying to predict the next sequence for each column (total column sum = 6). There are over 1,500 lines of data in total. I have tried to make a column of the accumulated sum of each line and then use Linear Regression and Time Series Forecasting to predict the next accumulated sum and then subtract the previous number to predict the number (0,1,2,3,4) but I am not getting the results that I am after. How best can I forecast the next series of numbers using a non-Linear approach ?

predict next number

  • $\begingroup$ I think you need to be a bit clearer about your method so far. Perhaps include the code that you're using as it will be easier for us to help you. $\endgroup$
    – Derek
    Aug 29, 2017 at 13:27
  • $\begingroup$ Hay i have row of numbers :0,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,0 is ther eny whey to predict next number is it 1 or its 0 . Ihave even longer rows of numbers. i want know is ther program who can help me find next numbers according of previous data. $\endgroup$
    – Kishe
    Feb 13, 2019 at 19:29
  • $\begingroup$ Did you check if columns are linearly correlated (Pearson's coefficient)? I'm asking about any four of your columns, because the last one always depends on the chosen four columns (sum must equal 6). $\endgroup$ Mar 15, 2019 at 21:29

1 Answer 1


You could use LSTMs with a sequence to sequence model perhaps (using e.g. Keras).

For example: x lines are input, the next line is output.

Just an idea, your question is not that clear.


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