Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Last active June 21, 2024 10:44
Show Gist options
  • Save eyaltrabelsi/456b722372e390e67f461ddfb49e6ec2 to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/456b722372e390e67f461ddfb49e6ec2 to your computer and use it in GitHub Desktop.
def test_training_can_overfit(capfd):
input_df = get_production_sample(pct=0.1)
features_df = feature_engineering(input_df)
train_df["col_a"] = train_df["label"] # Introduce leakage
train_df, test_df = split_train_test(features_df)
model = train_model(train_df)
auc = inference_and_evaluate(model, test_df)
assert 0.98 =< auc =< 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment