Skip to content

Hyperoptplot for new hyperopt#2430

Merged
scarlehoff merged 8 commits intomasterfrom
update_hyperoptplot
Mar 2, 2026
Merged

Hyperoptplot for new hyperopt#2430
scarlehoff merged 8 commits intomasterfrom
update_hyperoptplot

Conversation

@tgiani
Copy link
Contributor

@tgiani tgiani commented Feb 17, 2026

Updating hyperoptplot for new hyperopt keys.

@tgiani
Copy link
Contributor Author

tgiani commented Feb 17, 2026

@Radonirinaunimi this should correspond to the patch you had at some point. Could you please have a look?

@scarlehoff
Copy link
Member

Thanks. Is this what you are using now for the plots you are creating?

(if not, could you add that as well, so we have that in the repo)

@tgiani
Copy link
Contributor Author

tgiani commented Feb 17, 2026

sure, I ll add here some vp functions to produce those plots in a hyperopt report

Copy link
Member

@scarlehoff scarlehoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few comments. For the rest I'm ok with this

return fig

@figure
def plot_cumulative_loss(hyperopt_dataframe):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add docstr

return fig

@figure
def plot_cumulative_logp_chi2(hyperopt_dataframe):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstr

chi2_ = results['hyper_loss_chi2'].to_numpy()
chi2exp = results['trvl_loss_chi2exp'].to_numpy()

idx_ok = np.where(chi2exp<1.35)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this threshold as an argument (default to 1.35) but just so that it can be changed easily (and it is obvious that it is a threshold)

chi2_ = results['hyper_loss_chi2'].to_numpy()

# don t look at samples with -logp or chi2 too big
idx_ok = np.where(chi2_<5.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this threshold as an argument (default to 5) but just so that it can be changed easily (and it is obvious that it is a threshold)

filters set in the commandline arguments.
"""
drop_keys = ["hyper_losses_chi2", "hyper_losses_phi2", "hyper_losses_logp"]
drop_keys += [f"layer_{idx}" for idx in range(1, 5)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the range should be larger just in case there are more layers. Perhaps even read how many layers we have.

@tgiani
Copy link
Contributor Author

tgiani commented Feb 26, 2026

@scarlehoff if you are happy with this we can merge it

@scarlehoff scarlehoff merged commit 5f3378d into master Mar 2, 2026
12 checks passed
@scarlehoff scarlehoff deleted the update_hyperoptplot branch March 2, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants