A workflow uses a feature transformation step that takes raw categorical strings and outputs encoded numeric vectors. What approach best avoids training/serving skew in encoding?
Answer
Save the fitted preprocessing artifacts (e.g., encoders) and reuse the same artifacts for inference
Explanation
Using the same fitted preprocessing artifacts for both training and inference ensures consistent mapping from categories to numeric values. Re-fitting or encoding only on inference inputs can introduce skew and unexpected behavior.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
For an imbalanced classification problem, which strategy is most likely to improve model performance without changing the evaluation metric?
View question →
Which practice most directly helps prevent data leakage when creating train/validation splits?
View question →
Which AWS service is best suited to run large-scale hyperparameter tuning jobs for a machine learning model?
View question →
A model produces predicted probabilities for multi-class classification. Which evaluation metric is most appropriate if you need to measure the quality of ranked predictions across classes?
View question →
You need near real-time inference with variable request rates and desire automatic scaling. Which deployment option is most appropriate in SageMaker?
View question →
In a SageMaker pipeline, which component executes a step such as data preprocessing or feature engineering using a container?
View question →