Skip to content

Instantly share code, notes, and snippets.

@KenoLeon
Created July 18, 2020 00:44
Show Gist options
  • Select an option

  • Save KenoLeon/9c7fa738e0f12d8fbf318f19e386b5f9 to your computer and use it in GitHub Desktop.

Select an option

Save KenoLeon/9c7fa738e0f12d8fbf318f19e386b5f9 to your computer and use it in GitHub Desktop.
Train NN Keras
def train_model(model, feature, label, epochs, batch_size):
"""Train Keras Model"""
history = model.fit(x=feature,
y=label,
batch_size=batch_size,
epochs=epochs)
epochs = history.epoch
hist = pd.DataFrame(history.history)
mse = hist["mse"]
return epochs, mse
epochs, rmse = train_model(regressor_model, train_Features, train_Target, epochs, batch_size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment