exa.core.model_selection_fitter.utils.outlier_detection#
- outlier_detection(y, model, independent_vars, plot_fit=False, fitter_options=None, n_iterations=3, n_picks=2, drop_samples_with_large_difference=False, max_outlier_fraction=0.6, override_model_initial_guess=False)#
Finds outlier indices using leave-one-out.
The first independent variable is used as the outlier search dimension. Only supports 1-d fits.
- Parameters:
model (Model) – Model that is fit to the data.
plot_fit (bool) – boolean indicating if the fit for outlier detection should be plotted
fitter_options (dict[str, Any] | None) – extra options passed to lmfit.fit
n_iterations (int) – Number of iterations in outlier detection. For example, n_iterations=1 would lead to only n_picks outliers with the largest deviation to be selected. A new reference fit is done between each iteration.
n_picks (int) – Maximum number of outliers selected at each iteration.
drop_samples_with_large_difference (bool) – Selects sample as outliers if their value differs from next the point by a significant value. The current implementation is not good, and therefore this feature should not be used.
max_outlier_fraction (float) – Maximum fraction of outliers from the data. When the maximum is reached, returns the outliers found.
override_model_initial_guess (bool) – If True, initial guess is done using parameter values. If False model.guess function is used instead.
independent_vars (dict[str, ndarray]) – kwargs for the names of the independent variables in the fit.
- Returns:
outlier indices
- Return type: