How do I handle outliers and dirty order data?

Three layers of defense. (1) Filter at the SQL layer: exclude canceled / held / pending_payment orders, exclude refunded line-items, exclude test orders (filter on customer_email or store_id). (2) Detect outliers in Python: compute rolling 14-day median absolute deviation; flag any day > 4 MAD from the median. Mark those days as NaN in the y column, Prophet handles missing days correctly, but lets you blame the outlier on a real-world event later. (3) Use Prophet’s built-in outlier robustness by setting changepoint_prior_scale low (0.01-0.05) for SKUs with known dirty history. Garbage-in-garbage-out: a 30-line data-quality check before training is the single highest-leverage thing you can write.

Kishan Savaliya
Kishan Savaliya
Adobe Certified Magento Commerce Developer
Ahmedabad [IN]working hours, replies within four hours
When do you need it

Read personally. Never shared. Or email the brief.

More on magento 2 demand forecasting with python + prophet, faqs

Need it fixed, not just explained?

Send the brief with your store URL; the written quote comes back within 24 hours.