title: ANN: keras/sklearn doesn't scale well
body: <p>I don't know the reason why the results I have obtained aren't scale well.
  As you can see on the pictures bellow, there is a problem with scaling. </p>
  
  <p><a href="https://i.stack.imgur.com/GQ8Lg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GQ8Lg.png" alt="enter image description here"></a> </p>
  
  <p><a href="https://i.stack.imgur.com/aAIqU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aAIqU.png" alt="enter image description here"></a></p>
  
  <p>There are two issues:</p>
  
  <ul>
  <li>There are no negative values</li>
  <li>There is problem with maximum values prediction</li>
  </ul>
  
  <p>I don't have idea why I have those problems.
  Do you have any idea's how I can fix this issue?</p>
  
  <p>I would be very grateful for your help</p>
  
  <p>CODE:</p>
  
  
  
  <pre class="lang-python prettyprint-override"><code># Read inputs
  X = dataset.iloc[0:20000, [1, 4, 10]].values
  # Read output
  y = dataset.iloc[0:20000, 5].values
  
  # Splitting the dataset into the Training set and Test set
  from sklearn.cross_validation import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
  
  # Output matrix conversion
  y_train = y_train.reshape(-1, 1)
  y_test = y_test.reshape(-1, 1)
  
  # Feature Scaling
  from sklearn.preprocessing import StandardScaler
  sc = StandardScaler()
  X_train = sc.fit_transform(X_train)
  X_test = sc.transform(X_test)
  
  y_train = sc.fit_transform(y_train) 
  y_test = sc.transform(y_test)
  
  # Import the Keras libraries and package
  from keras.models import Sequential
  from keras.layers import Dense
  
  # building model
  classifier = Sequential()
  classifier.add(Dense(activation="sigmoid", input_dim=3, units=64, kernel_initializer="uniform"))
  classifier.add(Dense(activation="sigmoid", units=32, kernel_initializer="uniform"))
  classifier.add(Dense(activation="sigmoid", units=16, kernel_initializer="uniform"))
  classifier.add(Dense(activation="sigmoid", units=1, kernel_initializer="uniform"))
  classifier.compile(optimizer='adam', loss='mean_squared_error', metrics=['accuracy'])
  
  # Fitting the ANN to the training set
  results = classifier.fit(X_train, y_train, batch_size=16, epochs=25)
  
  # Predicting the Test set results
  y_pred = classifier.predict(X_test)
  </code></pre>