Model performance drops silently
Review this Python feature-loading code.
Model performance quietly drops after an upstream export-format change, but nothing errors. What dtype/data bug is hiding here?
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix, specific and kind.
0:00 of about 16 min
Mark a line and say what kind of problem it is.0 findings
1import pandas as pd
2import numpy as np
3
4def load_features(path):
5 df = pd.read_csv(path)
6 # 'amount' sometimes has values like '1,200' or 'N/A' from the export
7 X = df[["amount", "age", "score"]].astype(str)
8 X = X.apply(lambda c: c.str.replace(",", ""))
9 X = X.apply(pd.to_numeric, errors="coerce")
10 X = X.fillna(0)
11 return X.values
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.