Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n_bins Argument Not Used in _psi Function #1400

Open
santiagomaass opened this issue Dec 18, 2024 · 0 comments
Open

n_bins Argument Not Used in _psi Function #1400

santiagomaass opened this issue Dec 18, 2024 · 0 comments

Comments

@santiagomaass
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant