getting started with neural networks preparing the data it would be problematic to feed into neural network values that all take wildly different ranges the network might be able to automatically adapt to such heterogeneous databut it would definitely make learning more difficult widespread best practice to deal with such data is to do feature-wise normalizationfor each feature in the input data ( column in the input data matrix)you subtract the mean of the feature and divide by the standard deviationso that the feature is centered around and has unit standard deviation this is easily done in numpy listing normalizing he dat mean train_data mean(axis= train_data -mean std train_data std(axis= train_data /std test_data -mean test_data /std note that the quantities used for normalizing the test data are computed using the training data you should never use in your workflow any quantity computed on the test dataeven for something as simple as data normalization building your network because so few samples are availableyou'll use very small network with two hidden layerseach with units in generalthe less training data you havethe worse overfitting will beand using small network is one way to mitigate overfitting listing model definit ion from keras import models from keras import layers because you'll need to instantiate the same model multiple timesyou use function to construct it def build_model()model models sequential(model add(layers dense( activation='relu'input_shape=(train_data shape[ ],))model add(layers dense( activation='relu')model add(layers dense( )model compile(optimizer='rmsprop'loss='mse'metrics=['mae']return model the network ends with single unit and no activation (it will be linear layerthis is typical setup for scalar regression ( regression where you're trying to predict single continuous valueapplying an activation function would constrain the range the output can takefor instanceif you applied sigmoid activation function to the last layerthe network could only learn to predict values between and herebecause the last layer is purely linearthe network is free to learn to predict values in any range licensed to