A small lender has past loans. Each row is [income, debt] in thousands, and each label is 1 if the loan was repaid and 0 if not. The lender only wants to say yes when the model is sure enough.
Write approve_at_threshold(rows, repaid, new_rows, threshold).
make_pipeline(StandardScaler(), LogisticRegression(max_iter=1000)) on rows and repaid.new_rows, get the model's probability of class 1 (repaid) with predict_proba.threshold. Otherwise refuse (0).Return a list of 1s and 0s, one per new row, in order.