lsapy.standardize.fit#

lsapy.standardize.fit(x, y=None, kind='all', plot=False, verbose=False)[source]#

Fit standardization functions to data.

This function fits membership functions to the provided data. It helps to determine the best membership function to use on the data.

Parameters:
  • x (any) – Input values to fit the functions on.

  • y (any, optional) – Target values to fit the functions. Should be the same length as x. If not provided, the default values are used (0, 0.25, 0.5, 0.75, 1).

  • kind (str | list[str]) – List of functions or function types to fit. If ‘{TYPES}_like’, all equations corresponding to the type are fitted (available types: ‘sigmoid’, ‘gaussian’). If ‘all’, all available equations are fitted.

  • plot (bool) – Whether to plot the fitted functions. Default is False.

  • verbose (bool) – Whether to print the fitting results. Default is False.

Returns:

A tuple containing the best fitting function and its parameters.

Return type:

tuple