Fraud review project
Nacre Payments asks you to prepare a fraud review policy on fictional transaction features. False positives cost 1 review unit and missed frauds cost 8 units for this exercise. Fit on training rows, select a threshold on validation rows, and deliver held-out ranking, recovery and queue-load evidence. The completed notebook is the handoff; costs are task assumptions, not market prices.
A rare positive class can disappear behind a high accuracy figure. Class weights change how training errors contribute to the loss; a decision threshold changes which fitted probabilities enter the review queue. Those are separate choices. You will fit a weighted pipeline, apply a validation threshold and calculate recall with the positive class as the event. An empty queue needs a declared precision convention because no predicted positive exists to divide by. Keep the test set outside threshold selection. In a real fraud review, recovery and workload both matter, so a model score alone can't choose the operating policy.
weighted = make_pipeline(StandardScaler(), LogisticRegression(class_weight='balanced', C=0.7, max_iter=300)).fit(X_train, y_train)
Balanced weights increase the training contribution of the less frequent class without duplicating test observations.