Operational tables contain missing measurements and categories that appear after the model is trained. A numeric imputer learns a fill value from training rows. A one-hot encoder learns a set of category columns. Both are fitted transformations, so their learned state belongs to the training process.
Do not replace a missing outcome with a feature median or fit a separate encoder on each partition. Different category columns can silently change what a coefficient means. The fictional customer data includes missing session counts and a trial plan that appears only in the test inputs. You will practice mean and median imputation as explicit alternatives, then encode unknown plans without failing. Keeping the fitted objects visible makes it easier to inspect the statistics and category contract before you combine them in a pipeline.