ML engineering
Investigate a suspicious model improvement
evaluate.py · illustrative excerpt
# Keep each customer in one split.
splitter = GroupShuffleSplit(
n_splits=1, test_size=0.2, random_state=42
)
train, holdout = next(splitter.split(
features, target, groups=customer_id
))
assert not set(customer_id[train]) & set(
customer_id[holdout]
)
pipeline.fit(features[train], target[train])
prediction = pipeline.predict(features[holdout])Example dialogue showing how working context enters the task.
