Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
LB_Team
New Contributor III

ML Model - SARIMAX

Hi all,

I'm working on time series forecasting using SARIMAX in Python, and I encountered a confusing result:
My dataset is count of tests taken on daily from the year 2022 jan to 2024 dec 

  • When I use this data and forecasted for next 12 months using SARIMAX gave me accurate forecasts.

  • But when I use the same data and tried to forecast for the next 7 days instead of 12 months, the predictions are often inaccurate sometimes showing a steep decline or not capturing the correct trend at all.

Where am I going wrong? Please guide me.

I've attached the link to the code :
https://drive.google.com/file/d/1fhOf-bY0oZTYyq9wifXRDEaHa659-pxp/view?usp=sharing

1 ACCEPTED SOLUTION
v-sdhruv
Honored Contributor

Hi @LB_Team ,

If your data shows seasonal patterns and you want to forecast for 7 days, then SARIMAX is sensitive. Your model probably learned seasonal trends well over long periods, but struggles to generalize for short-term prediction due to overfitting to long cycles or reacting too much to end-point anomalies.

Check residuals near the end of your training window.

If residuals are high, the model is already misfitting โ€” so short-term forecasts will diverge quickly.

 

Tailor your model specifically for weekly forecasts-->s=7

Use smaller seasonal_order and possibly a narrower training window-- SARIMAX(..., seasonal_order=(P,D,Q,7))


I hope this helps!
If the response has addressed your query, please accept it as a solution so other members can easily find it.
Thank You

View solution in original post

8 REPLIES 8
v-sdhruv
Honored Contributor

Hi @LB_Team ,

SARIMAX captures seasonal components, trends, and exogenous variables. If your model includes seasonal components (e.g., weekly or yearly), then:

Long-term forecasts (like 12 months) are more influenced by seasonal patterns it has learned.

Short-term forecasts (like 7 days) might be more sensitive to noise, recent variability, or model overfitting to short-term anomalies.

Improper seasonal or non-seasonal orders can have unexpected short-term behavior. For example:

1.Over-differencing can cause forecasts to trend downward.

2.Misidentified seasonal periods  can distort short-term forecasts

Try using ARIMA model:
Refer-
https://skforecast.org/0.10.0/user_guides/forecasting-sarimax-arima

Hope this helps!
If the response has addressed your query, please accept it as a solution so other members can easily find it.
Thank You

LB_Team
New Contributor III

But my data shows seasonality patterns also will ARIMA be suitable for my usecase to forecast for next 7 days?

 

v-sdhruv
Honored Contributor

Hi @LB_Team ,

If your data shows seasonal patterns and you want to forecast for 7 days, then SARIMAX is sensitive. Your model probably learned seasonal trends well over long periods, but struggles to generalize for short-term prediction due to overfitting to long cycles or reacting too much to end-point anomalies.

Check residuals near the end of your training window.

If residuals are high, the model is already misfitting โ€” so short-term forecasts will diverge quickly.

 

Tailor your model specifically for weekly forecasts-->s=7

Use smaller seasonal_order and possibly a narrower training window-- SARIMAX(..., seasonal_order=(P,D,Q,7))


I hope this helps!
If the response has addressed your query, please accept it as a solution so other members can easily find it.
Thank You

v-sdhruv
Honored Contributor

Hi @LB_Team ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution  so other members can easily find it.
Thank You

v-sdhruv
Honored Contributor

Hi @LB_Team ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution  so other members can easily find it.
Thank You

v-sdhruv
Honored Contributor

Hi @LB_Team ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution  so other members can easily find it.
Thank You

AnShikagautam
New Contributor

U can do your work time to time because when you doing yours work at a time so you don't have any problem thnku 

AnShikagautam
New Contributor

You can do yours work time to time so yous can't face these problems thnku 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

Check out the January 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (14,774)