Skip to content

Commit

Permalink
Update data_splitters.py
Browse files Browse the repository at this point in the history
Fixed issue with saving Keras models with latest Keras version
  • Loading branch information
rjacobs914 committed Sep 27, 2024
1 parent 76da6f3 commit e08976b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mastml/data_splitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,8 @@ def _evaluate_split(self, X_train, X_test, y_train, y_test, model, model_name, p
# Save the individual Keras models comprising the Ensemble
count = 0
for m in model.model.estimators_:
m.model_.save(filepath=os.path.join(splitpath,'keras_model_' + str(count)))
m.model_.save(filepath=os.path.join(splitpath,'keras_model_' + str(count)+'.keras'))
#m.model.save(filepath=os.path.join(splitpath, 'keras_model_' + str(count)))
count += 1
#print('Warning: unable to save pickled model of ensemble of KerasRegressor models. Passing through...')
else:
Expand Down

0 comments on commit e08976b

Please sign in to comment.