Keras: Stratified validation set

Created on 8 Oct 2015  路  4Comments  路  Source: keras-team/keras

I am coming up with the problem that my validation set is getting all labels of one class, so the validation accuracy is either 0 or 1.

Could someone point me where to change the validation split to use StratifedShuffleSplit from sklearn

http://scikit-learn.org/stable/modules/generated/sklearn.cross_validation.StratifiedShuffleSplit.html

Most helpful comment

would still be nice to add a flag for that

All 4 comments

You can do a stratified split from sklearn, and then pass that in through validation_data=(X_val, y_val) in .fit() rather than validation_split=...

True!, thanks.

would still be nice to add a flag for that

:+1: This would be super useful

Was this page helpful?
0 / 5 - 0 ratings