Alteryx Machine Learning study materials
Alteryx Machine Learning study resources

Model Selection and Hyperparameter Tuning for Sales Forecasting

Alteryx Machine Learning · Put your knowledge to work in context.

All case studies

Model Selection and Hyperparameter Tuning for Sales Forecasting

A retail company wants to forecast weekly sales for 100 stores using historical data of 3 years. They have features like promotions, holidays, and store attributes. They plan to use Alteryx Machine Learning to build a regression model. The team is considering using AutoML to automatically select the best model and hyperparameters. However, they are concerned about overfitting and want to ensure the model generalizes well. They have a limited time budget of 2 hours for model training.

1. How should the team set up the AutoML process in Alteryx Machine Learning to avoid overfitting while staying within the time budget? Discuss validation strategy, model selection, and hyperparameter tuning.

Read the worked answer

To avoid overfitting with AutoML: (1) Use a holdout set (e.g., last 6 months of data) for final evaluation, not just cross-validation. (2) Configure cross-validation with a sufficient number of folds (e.g., 5) and ensure it's time-series aware if data is temporal (e.g., use time-based splits). (3) Limit the hyperparameter search space or use early stopping to fit within 2 hours. (4) Enable regularization (e.g., L1/L2) for linear models and tree depth limits for tree-based models. (5) Use the 'Leaderboard' to compare models not only on training score but on validation score, and check for overfitting by comparing training vs validation performance. (6) Consider using a simpler model if complex models don't significantly improve validation performance. (7) Set a maximum time per model or use random search instead of grid search. In Alteryx Machine Learning, you can set the 'Max time' for AutoML and choose to optimize for a specific metric (e.g., RMSE). Also, use the 'Feature Importance' to check if the model relies on noisy features.

2. What steps would you take to detect and mitigate overfitting after the model is built?

Read the worked answer

After building the model, compare training and validation performance metrics (e.g., RMSE, MAE). A large gap indicates overfitting. Other signs: high variance in cross-validation scores, or poor performance on the holdout set. To mitigate: (1) Simplify the model (reduce complexity, e.g., lower tree depth, increase regularization). (2) Reduce the number of features (feature selection). (3) Increase training data if possible. (4) Use early stopping for iterative models. (5) Ensemble methods like bagging can reduce variance. (6) Re-examine data leakage: ensure no future information is used in training. In Alteryx Machine Learning, you can use the 'Model Comparison' to see if a simpler model performs similarly on validation. Also, use learning curves to diagnose bias-variance trade-off.