Skip to content

n_bins Argument Not Used in _psi Function #1400

Description

@santiagomaass

The n_bins argument is defined in the _psi stat test function signature but is not utilized in the function's logic. This issue creates confusion for developers expecting the n_bins parameter to influence the calculation of PSI (Population Stability Index).

The get_binned_data function is called within _psi, and while it presumably requires the number of bins for binning the data, the n_bins argument is not used by it (check here)

Suggested change in get_binned_data :

  • Pass the n argument directly to np.histogram_bin_edges as the number of bins:
    So line 30 changes to:

bins = np.histogram_bin_edges(pd.concat([reference_data, current_data], axis=0).values, bins=n)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions