title: python - returning nan when trying to predict with Keras
body: <p>For a school project, I'm trying to predict data using the keras framework, but it's returning 'nan' loss and values when I try to get predicted data.</p>
  
  <h1>Source code :</h1>
  
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=5)
  
  # create model
  model = Sequential()
  model.add(Dense(950, input_shape=(425,), activation='relu'))
  model.add(Dense(425, activation='relu'))
  model.add(Dense(200, activation='relu'))
  model.add(Dense(50, activation='relu'))
  model.add(Dense(1, activation='sigmoid'))
  
  # Compile model
  sgd = optimizers.SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
  model.compile(loss='mean_squared_error', optimizer='sgd')
  
  # Fit the model
  model.fit(X_train, y_train, epochs=20, batch_size=1, verbose=1)
  
  #evaluate the model
  y_pred = model.predict(X_test)
  
  score = model.evaluate(X_test, y_test,verbose=1)
  print(score)
  
  # calculate predictions
  predictions = model.predict(X_pred)
  </code></pre>
  
  <h1>Data :</h1>
  
  <p>X_train and X_test are (panda)dataframes of 5000 rows(nber of samples) * 425 columns (number of dimensions).</p>
  
  <p>y_train and y_test look like : </p>
  
  <pre><code>array([ 1.17899644,  1.46080518,  0.9662137 , ...,  2.40157461,
          0.53870386,  1.3192718 ])
  </code></pre>
  
  <p>Can you help me with that ?</p>
  
  <p>Thank you for you help!</p>