# Class weighting during validation in Keras

I would like to know if the class weighting is also used in evaluating the loss in the validation data during the training. If not, is there a way to adjust the fit() function so that it takes into account the class weighting during the validation loss calculation.

• I wonder why you want to add weights to the class during validation!! – enterML Sep 7 '17 at 5:52

As described in Keras.models.py[1], validation_data can be a tuple (inputs, targets, sample_weights). So, you can use this parameter for class weighting during the validation loss calculation.