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.