Hello Nixtla team. ```I am making a Machine Learn...
# general
n
Hello Nixtla team.
Copy code
I am making a Machine Learning model, but it turns out that I have the following problem when I make the predictions with the predict method by adding the level(confidence interval) parameter, it gives me an error, 
                                                                                           mlf.fit(df1, id_col='unique_id', time_col='ds', target_col='y',prediction_intervals=PredictionIntervals(n_windows=5, window_size=18))
k
Are you trying to do something like this?
Copy code
from statsforecast.core import StatsForecast
from statsforecast.models import ( 
    AutoARIMA,
    AutoETS,
)
from statsforecast.utils import generate_series, ConformalIntervals

series = generate_series(5)

sf = StatsForecast(
    models=[AutoETS(season_length=7)],
    freq='D',
)
# sf.forecast(df=series, h=horizon).head()
sf.fit(series, prediction_intervals=ConformalIntervals(n_windows=2, h=10))
sf.predict(18, level=[20,30])
n
Hi @Kevin Kho Something like this but with Mlforecast, with statsforecast there is no problem
k
Ah gotcha, I am less familiar with MLForecast
m
@José Morales: could you try to help Naren?
j
I've answered the issue, I think it's more beneficial to have this conversation there
m
Thanks! I wasn’t aware of that.
m
https://nixtlacommunity.slack.com/archives/C031M8RLC66/p1688397461750749 @José Morales i think i have error in same reshape function could you give me your opinion?
j
I think this can happen if there's a gap in your series, e.g. a missing day
m
i thought that also but i am not sure so can i choose the window size to be not this happend do you have idea?
j
Do you have a single serie?
m
yes i have single @José Morales
for know is there different if i have multiple ?
j
No, I just think it may be easier to debug. Can you try the following: df['ds'].sort_values().diff().value_counts() to see if there's a gap?
m
0 days 010000 4703 73 days 210000 1 1 days 040000 1 0 days 020000 1 0 days 060000 1 2 days 150000 1 here the output
@José Morales
j
Your series need to have a regular frequency, seems like you have mostly 1 hr differences but some observations are very far apart. If you don't care about the dates you can just use an incremental integer as the time column
m
what do you mean what do you mean by regular frequency i have data every 1 hour but in january for example doesnt have data
how can i dont care about the date if i am usring the lags and every properites for time series
maybe i need to fill the gap?
the gap is the missing value right?
j
Yes, you need to fill the gap so that the diff command above returns a single value
m
you mean return 0 instead of 73 for example?
j
Yes, all of your samples should be one hour apart. If you don't have data for that period you need to fill it with 0s, interpolate or similar
m
but if i dont have data for one month this a big priode right ?
i was thinking by predict this priode and then merge it again
j
That would work as well