Step 1 of 5
Make an imbalanced dataset
Fraud is rare. Accuracy will lie to you, which is the first lesson.
from sklearn.datasets import make_classification
X, y = make_classification(n_samples=3000, weights=[0.95], n_informative=6, random_state=7)
print("fraud share:", round(y.mean(), 3))
print("accuracy of always saying 'fine':", round(1 - y.mean(), 3))You are done whenYou can explain why high accuracy is worthless here.
