Answers.Body: <p>Those all fit into a single quadratic, auto-correlated model.</p>
  
  <p><span class="math-container">$$ x_0 = a \\ x_i = b i^2 + c x_{i-1} + d i + e $$</span></p>
  
  <p>The sequences can be curve fitted producing a set of <span class="math-container">$n$</span> perfect fits of the form <span class="math-container">$(a, b, c, d, e)$</span> given the above model. A rules engine given the correct parameterized rules can produce the most desirable verbal description from among the <span class="math-container">$n$</span> fits in the set. The rules can also be prioritized by a simple feed forward network trained to simulate the most natural selection of string descriptions from any set of fits where <span class="math-container">$n &gt; 1$</span>.</p>
  
  <p>This will work well for the examples in the question and many more, however, if the sequence <span class="math-container">$\{1, 4, 1, 5, 9\}$</span> is fed into the system, it will produce some weird description based on the quadratic, auto-correlated model it was given rather than, "digits of <span class="math-container">$\pi$</span> to the right of the decimal place."</p>
  
  <p>The only way to produce the most common response a university freshman math student would produce would be to extend the boundaries of AI engineering first. For example, once an AI system is developed that can handle natural language and cognition like a child, several of them can be separately trained in a simulation of primary and secondary school mathematics. The median response for each sequence given to the class of AI students (class made up of artificial students studying math, not class of humans studying AI) will then be a reasonable prediction of what human university freshmen would produce as a median response.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-24T21:07:58.430Z
Answers.LastActivityDate: 2019-01-24T21:07:58.430Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>This can be framed as a classification problem where a model is supervised on a dataset containing finite-length number sequences <span class="math-container">$x^{(i)}_1, \cdots, x^{(i)}_n$</span> and the sequence name <span class="math-container">$y_i$</span>. For example, the dataset could look like this:</p>
  
  <ul>
  <li><code>([0,1,2,3,4], 0)</code></li>
  <li><code>([1,3,5,7,9], 1)</code></li>
  <li><code>([1,1,2,3,5], 2)</code></li>
  <li><code>([1,4,9,16,25], 3)</code></li>
  </ul>
  
  <p>where the numbers on the right are integer representations of the sequence name. Given intuitive sequences, plentiful training data, and training examples of reasonable length, this problem would not be that difficult to solve. Sequence models from deep learning, such as recurrent networks (LSTM, GRU) or temporal convolutional networks, are well-suited for tasks such as this one.</p>
  
  <p>Of course, this is only possible within certain constraints. The models are only good at what they are trained to do, so it would be impossible to use them to infer whether a sequence skips by 2 or 3 without having that information explicitly present in the training data. It would be interesting to see whether unsupervised models could detect this sort of information, although I don't think this work has been done in the present.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-25T00:18:40.880Z
Answers.LastActivityDate: 2019-01-25T00:18:40.880Z
Answers.UserDisplayName: Shrey
Body: <p>I am curious if it is possible to do so.</p>
  <p>For example, if I supply</p>
  <ul>
  <li><p><span class="math-container">$[0, 1, 2, 3, 4, 5]$</span>, the model should return &quot;natural number sequence&quot;,</p>
  </li>
  <li><p><span class="math-container">$[1,3,5,7,9,11]$</span>, it should return &quot;natural number with step of <span class="math-container">$2$</span>&quot;,</p>
  </li>
  <li><p><span class="math-container">$[1,1,2,3,5]$</span>, it should return &quot;Fibonacci numbers&quot;,</p>
  </li>
  <li><p><span class="math-container">$[1,4,9,16,25]$</span>, it should return &quot;square natural number&quot;</p>
  </li>
  </ul>
  <p>and so on.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-24T13:16:12.557Z
Comments.Text: Like this? https://www.wolframalpha.com/widgets/view.jsp?id=a3af2e675c3bfae0f2ecce820c2bef43 (note some sequences cause broken behaviour, but it is marked "beta")
Comments.UserDisplayName: Neil Slater
Tags: <machine-learning><prediction><supervised-learning>
Title: Can a machine learning model predict the pattern of given sequence?
UserDisplayName: Koay HV
ThreadText: # Can a machine learning model predict the pattern of given sequence?
  
  (Asked by: username_0 on 2019-01-24)
  
  I am curious if it is possible to do so.
  
  For example, if I supply
  
  * $[0, 1, 2, 3, 4, 5]$, the model should return "natural number sequence",
  * $[1,3,5,7,9,11]$, it should return "natural number with step of $2$",
  * $[1,1,2,3,5]$, it should return "Fibonacci numbers",
  * $[1,4,9,16,25]$, it should return "square natural number"
  
  and so on.
  
  **Tags:** machine-learning, prediction, supervised-learning
  > **Comments:**
  > **username_1**: Like this? https://www.wolframalpha.com/widgets/view.jsp?id=a3af2e675c3bfae0f2ecce820c2bef43 (note some sequences cause broken behaviour, but it is marked "beta")  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-01-24. Score: 1
  
  Those all fit into a single quadratic, auto-correlated model.
  
  $$ x\_0 = a \\ x\_i = b i^2 + c x\_{i-1} + d i + e $$
  
  The sequences can be curve fitted producing a set of $n$ perfect fits of the form $(a, b, c, d, e)$ given the above model. A rules engine given the correct parameterized rules can produce the most desirable verbal description from among the $n$ fits in the set. The rules can also be prioritized by a simple feed forward network trained to simulate the most natural selection of string descriptions from any set of fits where $n > 1$.
  
  This will work well for the examples in the question and many more, however, if the sequence $\{1, 4, 1, 5, 9\}$ is fed into the system, it will produce some weird description based on the quadratic, auto-correlated model it was given rather than, "digits of $\pi$ to the right of the decimal place."
  
  The only way to produce the most common response a university freshman math student would produce would be to extend the boundaries of AI engineering first. For example, once an AI system is developed that can handle natural language and cognition like a child, several of them can be separately trained in a simulation of primary and secondary school mathematics. The median response for each sequence given to the class of AI students (class made up of artificial students studying math, not class of humans studying AI) will then be a reasonable prediction of what human university freshmen would produce as a median response.
  
  
  ---
  
  ### Answer by username_3 on 2019-01-25. Score: -1
  
  This can be framed as a classification problem where a model is supervised on a dataset containing finite-length number sequences $x^{(i)}\_1, \cdots, x^{(i)}\_n$ and the sequence name $y\_i$. For example, the dataset could look like this:
  
  * `([0,1,2,3,4], 0)`
  * `([1,3,5,7,9], 1)`
  * `([1,1,2,3,5], 2)`
  * `([1,4,9,16,25], 3)`
  
  where the numbers on the right are integer representations of the sequence name. Given intuitive sequences, plentiful training data, and training examples of reasonable length, this problem would not be that difficult to solve. Sequence models from deep learning, such as recurrent networks (LSTM, GRU) or temporal convolutional networks, are well-suited for tasks such as this one.
  
  Of course, this is only possible within certain constraints. The models are only good at what they are trained to do, so it would be impossible to use them to infer whether a sequence skips by 2 or 3 without having that information explicitly present in the training data. It would be interesting to see whether unsupervised models could detect this sort of information, although I don't think this work has been done in the present.
  
  
  ---
  
  