Define class weights to make predictions on a class imbalanced dataset
6 min readJun 11, 2023
Making predictions on an imbalance dataset is perhaps a very difficult feat for the data scientist. There are several methods that can be used to balance classes, to include oversampling and undersampling techniques. I prefer to define class weights in my program, however, because these values can be incorporated within the model, to include both sklearn and tensorflow.