ModelMinimizer#
- class jetset.minimizer.ModelMinimizer(minimizer_type)[source]#
Bases:
objectHigh-level entry point for model fitting workflows.
Notes
Handles data preparation, fit-range filtering, backend minimizer selection (SciPy, Minuit, or Sherpa), and packaging of best-fit results.
Methods Summary
fit(fit_model, sed_data, nu_fit_start, ...)Fit.
get_fit_results(fit_model, nu_fit_start, ...)Return fit results.
load_model(file_name)Load object state from disk.
Plot corr matrix.
Reset model parameters to stored best-fit solution.
save_model(file_name)Save object state to disk.
Print warnings collected during fitting.
Methods Documentation
- fit(fit_model, sed_data, nu_fit_start, nu_fit_stop, fitname=None, fit_workplace=None, loglog=False, silent=False, get_conf_int=False, max_ev=0, use_fake_err=False, use_UL=False, skip_minimizer=False, repeat=1)[source]#
Fit.
- Parameters:
fit_model (object) – Model instance used for fitting.
sed_data (object) – Observational SED data container.
nu_fit_start (float) – Lower bound of the fit range in Hz.
nu_fit_stop (float) – Upper bound of the fit range in Hz.
fitname (object, optional) – Name assigned to the fit run.
fit_workplace (path, optional) – Workplace/output configuration object.
loglog (bool, optional) – If
True, operate in log10 space.silent (bool, optional) – If
True, suppress informational output.get_conf_int (bool, optional) – If
True, use confidence-interval initialization strategy.max_ev (int, optional) – Maximum number of optimizer function evaluations.
use_fake_err (bool, optional) – If
True, enable fake err.use_UL (bool, optional) – If
True, enable ul.skip_minimizer (bool, optional) – If
True, skip minimizer.repeat (int, optional) – Number of repeated minimization passes.
- Returns:
Computed value.
- Return type:
object
- get_fit_results(fit_model, nu_fit_start, nu_fit_stop, fitname, silent=False, loglog=False)[source]#
Return fit results.
- Parameters:
fit_model (object) – Model instance used for fitting.
nu_fit_start (float) – Lower bound of the fit range in Hz.
nu_fit_stop (nu_fit_start : floa) – Upper bound of the fit range in Hz.
fitname (str) – Name assigned to the fit run.
silent (bool, optional) – If
True, suppress informational output.loglog (bool, optional) – If
True, operate in log10 space.
- Returns:
Requested value.
- Return type:
object
- classmethod load_model(file_name)[source]#
Load object state from disk.
- Parameters:
file_name (object) – Input/output file path.
- Returns:
Loaded object.
- Return type:
object
- plot_corr_matrix()[source]#
Plot corr matrix.
- Returns:
Plot object or generated visualization.
- Return type:
object
- reset_to_best_fit()[source]#
Reset model parameters to stored best-fit solution.
Notes
Also refreshes per-parameter best-fit values and errors.