From f2f09cceeabf2cb6ed11294b387bc95cf0336947 Mon Sep 17 00:00:00 2001 From: Pratik Savla Date: Sat, 5 Oct 2019 10:34:33 +0530 Subject: [PATCH] save the model after training --- 1. Diabetes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/1. Diabetes.py b/1. Diabetes.py index ecf3a87..521f5de 100644 --- a/1. Diabetes.py +++ b/1. Diabetes.py @@ -29,3 +29,10 @@ scores = model.evaluate(X, Y) print("\n%s: %.2f%%" % (model.metrics_names[1], scores[1]*100)) ''' 99.48% ''' + +model_json = model.to_json() +with open("model.json", "w") as json_file: + json_file.write(model_json) + +model.save_weights("model.h5") +print("Saved model to disk")