AstropyFitter1D#
- class glue.core.fitters.AstropyFitter1D(**params)#
Bases:
BaseFitter1DA base class for wrapping
astropy.modeling.Subclasses must override
model_clsfitting_clsto point to the desired Astropymodelandfitterclasses.In addition, they should override
labelwith a better label, andparameter_guesses()to generate initial guessesAttributes Summary
Built-in mutable sequence.
Methods Summary
fit(x, y, dy, constraints)Fit the model to data.
parameter_guesses(x, y, dy)Provide initial guesses for each model parameter.
predict(fit_result, x)Evaluate the model at a set of locations.
summarize(fit_result, x, y[, dy])Return a textual summary of the fit.
Attributes Documentation
- fitting_cls = None#
- label = 'Base Astropy Fitter'#
- model_cls = None#
- param_names#
Methods Documentation
- fit(x, y, dy, constraints)#
Fit the model to data.
This must be overriden by a subclass.
- Parameters:
x (
numpy.ndarray) – The x values of the datay (
numpy.ndarray) – The y values of the datady (
numpy.ndarray) – 1 sigma uncertainties on each datum (optional)constraints – The current value of the
constraintspropertyoptions – kwargs for model hyperparameters.
- Returns:
An object representing the fit result.
- parameter_guesses(x, y, dy)#
Provide initial guesses for each model parameter.
The base implementation does nothing, and should be overridden
- Parameters:
x (
numpy.ndarray) – X - values of the datay (
numpy.ndarray) – Y - values of the datady (
numpy.ndarray) – uncertainties on Y(assumed to be 1 sigma)
- Returns:
A dict mapping
{parameter_name: value guess}for each parameter
- predict(fit_result, x)#
Evaluate the model at a set of locations.
This must be overridden in a subclass.
- Parameters:
fit_result – The result from the fit method
x (
numpy.ndarray) – Locations to evaluate model at
- Returns:
model(x)
- Return type: