some info about my dataset # Convert 'WeekDate' to datetime format
dataset_newitem = dataset_newitem.with_columns(
    pl.col("WeekDate").str.strptime(pl.Datetime, "%Y-%m-%d")
)

# Group by ‘MaterialID’, ‘SalesOrg’, ‘DistrChan’, 'CL4' and 'WeekDate', then sum 'OrderQuantity'
y_cl4 = dataset_newitem.groupby(['MaterialID', 'SalesOrg', 'DistrChan', 'CL4', 'WeekDate']).agg(
    pl.sum("OrderQuantity").alias("OrderQuantity")
)

# Sort by 'WeekDate'
y_cl4 = y_cl4.sort("WeekDate") # Concatenate ‘MaterialID’, ‘SalesOrg’, ‘DistrChan’, ‘CL4’ to a new column ‘unique_id’
y_cl4 = y_cl4.with_columns(
    pl.concat_str([pl.col('MaterialID'), pl.col('SalesOrg'), pl.col('DistrChan'), pl.col('CL4')], separator='_').alias('unique_id')
)
 
# Drop the original columns 
y_cl4 = y_cl4.drop(['MaterialID', 'SalesOrg', 'DistrChan', 'CL4'])

# Renaming columns to 'ds' and 'y' to meet the input requirements of the StatsForecast library
y_cl4 = y_cl4.rename({'WeekDate': 'ds', 'OrderQuantity': 'y'}) y_cl4.head() ds	y	unique_id
datetime[μs]	f64	str
2022-06-27 00:00:00	12.0	"12499186_US01_…
2022-06-27 00:00:00	128.0	"12506328_US01_…
2022-06-27 00:00:00	32.0	"12506326_US01_…
2022-06-27 00:00:00	96.0	"12520808_US01_…
2022-06-27 00:00:00	252.0	"12409760_US01_…
 4275 series ranging from 1 week to 74 weeks, weekly data  length ┆ count │
│ ---    ┆ ---   │
│ u32    ┆ u32   │
╞════════╪═══════╡
│ 1      ┆ 1942  │
│ 2      ┆ 357   │
│ 3      ┆ 157   │
│ 4      ┆ 107   │
│ 5      ┆ 74    │
│ 6      ┆ 40    │
│ 7      ┆ 48    │
│ 8      ┆ 37    │
│ 9      ┆ 39    │
│ 10     ┆ 47    │
│ 11     ┆ 54    │
│ 12     ┆ 36    │
│ 13     ┆ 35    │
│ 14     ┆ 43    │
│ 15     ┆ 47    │
│ 16     ┆ 45    │
│ 17     ┆ 36    │
│ 18     ┆ 37    │
│ 19     ┆ 51    │
│ 20     ┆ 35    │
│ 21     ┆ 41    │
│ 22     ┆ 29    │
│ 23     ┆ 26    │
│ 24     ┆ 33    │
│ 25     ┆ 35    │
│ 26     ┆ 41    │
│ 27     ┆ 39    │
│ 28     ┆ 34    │
│ 29     ┆ 37    │
│ 30     ┆ 31    │
│ 31     ┆ 32    │
│ 32     ┆ 26    │
│ 33     ┆ 30    │
│ 34     ┆ 22    │
│ 35     ┆ 39    │
│ 36     ┆ 32    │
│ 37     ┆ 32    │
│ 38     ┆ 33    │
│ 39     ┆ 37    │
│ 40     ┆ 34    │
│ 41     ┆ 24    │
│ 42     ┆ 22    │
│ 43     ┆ 17    │
│ 44     ┆ 18    │
│ 45     ┆ 13    │
│ 46     ┆ 9     │
│ 47     ┆ 18    │
│ 48     ┆ 15    │
│ 49     ┆ 17    │
│ 50     ┆ 12    │
│ 51     ┆ 15    │
│ 52     ┆ 10    │
│ 53     ┆ 11    │
│ 54     ┆ 6     │
│ 55     ┆ 9     │
│ 56     ┆ 7     │
│ 57     ┆ 11    │
│ 58     ┆ 11    │
│ 59     ┆ 9     │
│ 60     ┆ 13    │
│ 61     ┆ 14    │
│ 62     ┆ 7     │
│ 63     ┆ 5     │
│ 64     ┆ 3     │
│ 65     ┆ 6     │
│ 66     ┆ 6     │
│ 67     ┆ 5     │
│ 68     ┆ 11    │
│ 69     ┆ 7     │
│ 70     ┆ 4     │
│ 71     ┆ 2     │
│ 72     ┆ 4     │
│ 73     ┆ 3     │
│ 74     ┆ 1     │  I'm training the ensemble models arima, ets, theta and imapa on series with 32 data points and up since it;s less noisy # Filter the lengths DataFrame for lengths greater than 31
lengths_filtered = lengths.filter(pl.col('length') > 31)

# y_soldto filtered with only values greater than 31 in length
y_cl4_filtered = y_cl4.join(
    lengths_filtered.select(pl.col('unique_id')), 
    on='unique_id', 
    how='semi'  
)

# Sort by 'WeekDate'
y_cl4_filtered = y_cl4_filtered.sort("ds")

print(y_cl4_filtered)


 but fit the dataset to do 24 months forecast needs at least right now 9 data points,  1      ┆ 1942  │
│ 2      ┆ 357   │
│ 3      ┆ 157   │
│ 4      ┆ 107   │
│ 5      ┆ 74    │
│ 6      ┆ 40    │
│ 7      ┆ 48    │
│ 8      ┆ 37    │ you could see that there's quite a lot of series that needed to get to 9 data points threshold to fit the models for forecast, I"m thinking maybe since sries are made up of 4 columns MaterialID which is SKU, salesorg sales organization, distrchan distribution channel and cl4 which is retailer, ie walmart target, would it make sense to try to see if the series with only 8 data points or less has some similar series with at least 9 data points and maybe either backfill to forward fill with the mean of the similar series for that exact same time period? What I mean is that for example the series with 1 data point maybe has 1 week June 10 2022 and it has 4 other similar series, and similar here I mean has the the same materialID, salesorg, distrchan but different cl4 so same product but sold to walmart or target or kroger, these 4 similar series if they have data from june 17 2022 to another 8 weeks forward, we can take their average and forward fill these values to the series with only 1 data point and then do 24 months forecast? would this work?