class_docstr: Test cases for keras model fitting.
class_docstr_tok: ["Test","cases","for","keras","model","fitting","."]
docstr: Tests the BOltonModel calculate_class_weights method.
  
  This test passes invalid params which should raise the expected errors.
  
  Args:
    class_weights: the class_weights to use.
    class_counts: count of number of samples for each class.
    num_classes: number of outputs neurons.
    err_msg: The expected error message.
code: def test_class_errors(
      self, class_weights, class_counts, num_classes, err_msg
  ):
      """Tests the BOltonModel calculate_class_weights method.
  
      This test passes invalid params which should raise the expected errors.
  
      Args:
        class_weights: the class_weights to use.
        class_counts: count of number of samples for each class.
        num_classes: number of outputs neurons.
        err_msg: The expected error message.
      """
      clf = models.BoltOnModel(1, 1)
      with self.assertRaisesRegexp(
          ValueError, err_msg
      ):  # pylint: disable=deprecated-method
          clf.calculate_class_weights(
              class_weights, class_counts, num_classes
          )
  
imports: from absl.testing import parameterized
  import tensorflow.compat.v1
  from tensorflow.compat.v1.python.framework import ops
  from tensorflow.compat.v1.python.keras import keras_parameterized
  from tensorflow.compat.v1.python.keras import losses
  from tensorflow.compat.v1.python.keras.optimizer_v2.optimizer_v2 import OptimizerV2
  from tensorflow.compat.v1.python.keras.regularizers import L1L2
  from tensorflow_privacy.privacy.bolt_on import models
  from tensorflow_privacy.privacy.bolt_on.losses import StrongConvexMixin
  from tensorflow_privacy.privacy.bolt_on.optimizers import BoltOn
label_desc: Use image node_id 5 for calling the FitTests obj's underlying member method code with example usage: obj.test_class_errors(class_weights, class_counts, num_classes, err_msg) without return types