Commit bc77ceb8 authored by Mike Bedington's avatar Mike Bedington

Whitespace changes

parent 9c3806e8
......@@ -23,7 +23,6 @@ from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import Pipeline
def windowSum(data, window):
output = np.zeros([len(data),1])
output[0:window,0] = np.sum(data[0:window])
......@@ -34,7 +33,6 @@ def windowSum(data, window):
return output
def lagData(data, lag):
output = np.zeros([len(data),1])
output[0:lag,0] = data[0]
......@@ -42,7 +40,6 @@ def lagData(data, lag):
return output
def baseline_model(input_len, node_width):
# create model
model = Sequential()
......@@ -52,9 +49,7 @@ def baseline_model(input_len, node_width):
model.compile(loss='mean_squared_error', optimizer='adam')
return model
def modelErrorMetrics(preds, obs):
rmse = np.sqrt(((preds - obs)**2).mean())
print('RMSE - '+str(rmse))
......@@ -66,7 +61,6 @@ def modelErrorMetrics(preds, obs):
return np.asarray([rmse, corr[0], nss])
def runNNtrain(train_flux, train_data, no_epochs):
# scale the data ready for neural net fitting
......@@ -83,7 +77,6 @@ def runNNtrain(train_flux, train_data, no_epochs):
# output the model and the error metrics
return [nn_scaler, nn_model]
def nn_create_run_data(precipitation, temp, precipitation_sums_lags, temp_sums_lags):
nn_run_data = np.asarray([precipitation, temp]).T
......@@ -101,7 +94,6 @@ def nn_create_run_data(precipitation, temp, precipitation_sums_lags, temp_sums_
return nn_run_data
def create_generic_nn(river_dict, generic_model_files=None, train_dates=None, pt_sums_lags=None):
if generic_model_files is None:
generic_model_files = ['generic_nn.h5', 'generic_nn_train']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment