deep-symbolic-optimization icon indicating copy to clipboard operation
deep-symbolic-optimization copied to clipboard

How to access the hall of fame?

Open soerenab opened this issue 2 years ago • 2 comments

Hi,

Thanks a lot for this great package and its documentation. I have a question regarding the hall of fame: I am using the DeepSymbolicRegressor and after fitting, I am accessing the best program with model.program_. This works well! Now I am wondering: In config_common.json I found the hall of fame parameter hof, which (if I understand correctly) defines the number of "best programs" to keep. Is it possible to access these programs after fitting (instead of getting just the single best one as I am doing currently), and if so how would I do this?

Thanks a lot!

soerenab avatar Sep 13 '22 16:09 soerenab

Thank you for your interest! You are correct: the "hall of fame" is a record of the top hof programs ever seen during training, as measured by r.

It sounds like you are using the sklearn regressor interface. This is intended to be a bare-bones interface that does not expose the hall of fame. If you instead run via CLI (i.e. using python -m dso.run path_to_config.json), then the hall of fame will be saved to file (ending with _hof.csv).

In a future update, the hall of fame will be updated each step during training, not just at the end of training (i.e. after calling model.fit), and will be able to be more easily accessible programmatically (e.g. via model.hof), as opposed to just with post-fit file I/O.

Hope this helps!

brendenpetersen avatar Sep 13 '22 17:09 brendenpetersen

Thanks for the detailed answer, this helps indeed!

soerenab avatar Sep 13 '22 17:09 soerenab