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

[feature request] allow transform to avoid Z-score transforming when sigma=0 #910

Open
SimonEnsemble opened this issue Dec 28, 2023 · 1 comment

Comments

@SimonEnsemble
Copy link

my design matrix Φ has a column of one's to handle the intercept. so anytime I Z-score transform, I get NaNs after dividing by a zero variance. would be nice if transform had an option to handle this, ie. not transform when sigma=0.0.

feature_transform = fit(ZScoreTransform, Φ, dims=1)
Φ̂ = StatsBase.transform(feature_transform, Φ)
@SimonEnsemble
Copy link
Author

eg. in scikit-learn's StandardScaler: "If a variance is zero, we can’t achieve unit variance, and the data is left as-is, giving a scaling factor of 1."

https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.StandardScaler.html#sklearn.preprocessing.StandardScaler

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