TransWikia.com

Ensure class balanced batches while hyperparameter tuning keras models with grid search

Data Science Asked by Amine on November 29, 2020

Ensuring class balanced batches while training keras models is possible using fit_generator method. I used imblearn.keras.BalancedBatchGenerator for that and it works fine!

But i wanted to do that with GridSearchCV to fine-tune my model, so i created an inherited class KerasBatchClassifier(KerasClassifier) as a Keras Wrapper for the Scikit-Learn API. (Inspired by this StackOverflow question)

Ensuring class balanced batches to fit the model is working, but i haven’t figured out how to do it with validation data ! Any ideas to do that ?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP