In Keras, we can return the output of model.fit to a history as follows:
model.fit
history = model.fit(X_train, y_train, batch_size
The model history can be saved into a file as follows
model
import json hist = model.fit(X_train, y_train, epochs=5, batch_size=batch_size,validation_split=0.1) with open('file.json', 'w') as f: json.dump(hist.history, f)