-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset Keras models in bias_variance_decomp after each bootstrap round #746
Comments
Hi @rasbt ,
to adapt functional keras as well |
Thanks for the comment, @hanzigs. It's probably best to (1) reset the model (this would be more expected), (2) Make a note about that in the documentation, (3) allow fit parameters for keras to set the number of epochs for refitting the reset models, and (4) make the modification you describe. I can do that in a separate PR. |
Hi @rasbt
Thanks |
Technically, this would work, but the problem with that would be that all the predictions would then be the same in each round. |
You are right, then we should reinitiate the model |
Yeah. I have implemented it in #748 along with a fit_params option to pass on the number of epochs for the keras fit method. It seems to work well |
Following up on #725, I think that the model needs to be reset after each bootstrap round.
Consider the following:
results in
Now, the running the
bias_var_decomposition
:yields
you can see that the loss starts at 41.6, which indicates that the fitted model is reused.
Btw. the results are
which looks okay. However, the issue is that it seems like the Keras model is not reset after each round in
https://github.com/rasbt/mlxtend/blob/master/mlxtend/evaluate/bias_variance_decomp.py#L78
I think in the code above
needs to be changed to something like
What do you think @hanzigs ?
The text was updated successfully, but these errors were encountered: