from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.datasets import boston_housing
(X_train, y_train), (X_test, y_test) = boston_housing.load_data()
model = Sequential()
model.add(Dense(10, input_shape=(X_train.shape[1],)))
model.add(Dense(1))
model.compile(loss='mean_absolute_error', optimizer='rmsprop')
model.fit(X_train, y_train, epoch=20, batch_size=1, validation_data=(X_test, y_test))
score, acc = model.evaluate(X_test, y_test, batch_size=1)
print('Test score:', score)
print('Test accuracy:', acc)
for i in range(-1, -10, -1):
print("Predicted price = {}, Actual price = {}".format(model.predict(X_test[i].reshape(1, 13))[0][0], y_test[i]))