fitting#
Curve fitting with automatic algorithm and initial-guess selection.
Fit a builtin models.* function or your own model to a signal, spectrum, or (x, y) arrays.
analyze_model
#
analyze_model(
model: Callable[..., ndarray],
) -> FunctionAnalysisResult
Inspect a model function and report its detected type, confidence, and recommended fitting approach.
fit
#
fit(
data: Signal1D | Spectrum1D | tuple[ndarray, ndarray],
model: Callable[..., ndarray],
initial_guess: tuple[float, ...] | None = None,
method: Literal[
"auto", "robust", "fast", "accurate"
] = "auto",
algorithm: Literal[
"scipy", "linear", "varpro", "specialized"
]
| None = None,
n_components: int = 1,
**kwargs: Any,
) -> SmartFittingResult
Fit a model to data, choosing algorithm and initial guess automatically.
Returns:
| Type | Description |
|---|---|
SmartFittingResult
|
Result with |
get_predefined_models
#
Return the built-in model functions as a name-to-function mapping.