Train a fraud model on data that is 99 percent legitimate and it will learn to predict "legitimate" every time. Class weights are the standard correction: make each mistake on the rare class cost more, in proportion to how rare it is.
Write class_weights(labels, n_classes).
labels is a 1D array of integer class indices. Return a float array of length n_classes where each entry is inversely proportional to how often that class appears, scaled so the weights average to 1.0.
You have read the opening. The rest is free with a Bezen account, and no card is needed.
Behind the sign-in