Skip to content

API Adds feature_names_in_ to kernel_approximation #20841

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

Merged

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Follow up to #18010

@@ -3722,6 +3722,7 @@ def check_dataframe_column_names_consistency(name, estimator_orig):
set_random_state(estimator)

X_orig = rng.normal(size=(150, 8))
X_orig -= X_orig.min() + 0.5
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this because the original fails for SkewedChi2Sampler.transform with skewedness=1.0:

if (X <= -self.skewedness).any():
raise ValueError("X may not contain entries smaller than -skewedness.")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stumbled upon the same issue when trying to tackle this module. I am fine with your solution because I could not find a better idea...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment for that line? And maybe use X_orig += X_orig.abs().max() + 0.5 to be sure it's positive.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment. I left the -= .min() pattern because it is used several times elsewhere in the test file.

Copy link
Member

@lorentzenchr lorentzenchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -3722,6 +3722,7 @@ def check_dataframe_column_names_consistency(name, estimator_orig):
set_random_state(estimator)

X_orig = rng.normal(size=(150, 8))
X_orig -= X_orig.min() + 0.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment for that line? And maybe use X_orig += X_orig.abs().max() + 0.5 to be sure it's positive.

@ogrisel ogrisel merged commit baa90d4 into scikit-learn:main Aug 26, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants