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

Standardize does not handle constant columns #1058

Open
Markopolo141 opened this issue Jul 19, 2023 · 0 comments
Open

Standardize does not handle constant columns #1058

Markopolo141 opened this issue Jul 19, 2023 · 0 comments
Labels

Comments

@Markopolo141
Copy link

Describe the bug

calling standardize() does not properly handle columns which are constant

Steps/Code to Reproduce

import numpy as np
Z = np.array([[0,1,2,5],[1,2,3,5],[3,1,2,5]])
print(standardize(Z))

outputs a column of -5.

Suggested Fix

Insert below line 130 in scaling.py

parameters["avgs"][c] = 0.0

Expected Results

should have column of zeros instead of -5.

Actual Results

has a column of -5s when it should have column of zero

Versions

MLxtend 0.22.0
Linux-5.19.0-46-generic-x86_64-with-glibc2.35
Python 3.9.17 (main, Jun 6 2023, 20:11:21)
[GCC 11.3.0]
Scikit-learn 1.2.2
NumPy 1.23.5
SciPy 1.10.0

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

No branches or pull requests

1 participant