title: Getting 0 or 1 as probability values in neural network Keras sequential model
body: <p>I am running my training set of 30k on python library Keras for neural network (model "sequential"). </p>
  
  <p>When i am fitting the model and calculating probabilities on the test set (size = 13k) then I am getting 0 or 1 only. Whereas I am supposed to get some fractional values like 0.62, 0.42, 0.31 etc. </p>
  
  <p>I tried using class_weight and setting it to 'auto' or 'balanced' but I was not able to solve this issue. </p>
  
  <p>Output is not integer type, its float type only.</p>
  
  <p>Below is the code</p>
  
  <pre><code>from keras.models import Sequential
  from keras.layers import Dense
  import numpy as np
  seed = 8 
  np.random.seed(seed)
  
  model = Sequential()
  model.add(Dense(9, input_dim=8, init='uniform', activation='relu'))
  model.add(Dense(5, init='uniform', activation='relu'))
  model.add(Dense(1, init='uniform', activation='sigmoid'))
  
  from keras.optimizers import SGD
  model.compile(loss='binary_crossentropy', optimizer=SGD(lr=0.01, momentum=0.9, nesterov=True), metrics=['accuracy'])
  
  trainx = X_train.as_matrix()
  trainy = y_train.as_matrix()
  
  import time as time
  start = time.time()
  model.fit(trainx, trainy, nb_epoch=10, batch_size=10, verbose = 2,    class_weight ='auto')
  print (time.time() - start)
  
  X_test = X_test.as_matrix()
  y_test = y_test.as_matrix()
  
  proba = model.predict_proba(X_test, batch_size=10)
  </code></pre>
  
  <p>And the values of proba are all 0s.
  The data has only 2% defaulter cases, so its imbalanced class.</p>