I\'m trying to use Keras Scikit Learn Wrapper in order to make random search for parameters easier. I wrote an example code here where :
There is a bug in the KerasClassifier that is causing this issue. I have opened an issue for it on the repo. https://github.com/fchollet/keras/issues/2864
The fix is also in there. You can define your own KerasClassifier in the mean time as a temporary workaround.
class FixedKerasClassifier(KerasClassifier):
def predict_proba(self, X, **kwargs):
kwargs = self.filter_sk_params(Sequential.predict_proba, kwargs)
probs = self.model.predict_proba(X, **kwargs)
if(probs.shape[1] == 1):
probs = np.hstack([1-probs,probs])
return probs