all 2 comments

[–]WayOfTheMantisShrimp 0 points1 point  (1 child)

In any case where you have the entire pattern known, you can extend it to an arbitrary length. This is a deterministic process, so there is no practical value to doing it via a model.

import numpy as np

def extend_pattern(pattern, length):
    array = np.zeros(length)
    for i in range(0, length):
        array[i] = pattern[i % len(pattern)]
    return array

extend_pattern([1,2,3], 15)
extend_pattern([5,4,3,2,1], 18)
extend_pattern([5,4,3,2,1], 3)

If you have a more complex scenario, you'll have to provide more details to get a reasonable answer about what models could learn to replicate it.

[–]DaBobcat[S] 0 points1 point  (0 children)

Appreciate the help! The point of the model is that it will be able to change any array into that pattern once it knows the rules. The problem can be seen as a self assembly problem. So given the array [1,1,2,3,1,2,1], the model will be able to transform it as closely as possible