Imbalance imbalance_model make imbalance model imbalance measure loss_extract get loss model use all data -> train loss_model_indexing check loss ranking and save index loss_classification use loss ranking index -> new classification model temperature_scaling_model temperature_scaling model and calibration measure