logo-MindMajix
PostKerasKeras
J
James ROBERT

Posted on 16th June 2024|133 views

0
votes

Keras Class Weight

How can we set class weights for the imbalance classes in Keras?

1 answers
Answers
P
sreelu 123

Posted on 16th June 2024| views

We can simply set class_weight = auto to weight all the classes equally see the below example.

model.fit(X_train, Y_train, nb_epoch=5, batch_size=32, class_weight = 'auto')

If you are looking for the Keras certification course, you can check out this Keras course by Mindmajix.

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number