refund_amount is only filled in after a customer cancels, so a model trained on it would look perfect and then fail in real use. Find leaks like this with numbers: store the list of numeric columns (other than sub_id and churned) whose absolute correlation with churned is above 0.9 in result.
import pandas as pd
subs = pd.DataFrame({
"sub_id": list(range(1, 13)),
"city": ["Pune", "Pune", "Pune", "Delhi", "Delhi", "Delhi", "Delhi", "Mumbai", "Mumbai", "Jaipur", "Pune", "Delhi"],
"plan": ["Basic", "Premium", "Basic", "Basic", "Premium", "Basic", "Basic", "Premium", "Basic", "Basic", "Premium", "Premium"],
"watch_hours": [12, 40, 5, 8, 35, 3, 10, 50, 6, 2, 45, 30],
"support_calls": [1, 0, 3, 2, 0, 4, 1, 0, 2, 5, 0, 1],
"refund_amount": [0, 0, 199, 199, 0, 199, 0, 0, 199, 199, 0, 0],
"churned": [0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0],
})Store your final answer in a variable named result.
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.