Skip to content

MNT move PolynomialFeatures from _data.py to _polynomial.py #19611

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
merged 9 commits into from
Mar 18, 2021

Conversation

avigupta2612
Copy link
Contributor

Reference Issues/PRs

Fixes #19574

What does this implement/fix? Explain your changes.

I moved class PolynomialFeatures from _data.py to _polynomial.py as
mentioned in the issue. I also moved all tests relevant to PolynomialFeatures
from tests_data.py to tests_polynomial.py

Any other comments?

Please mention if I left something.

@avigupta2612 avigupta2612 changed the title moved Polynomialfeatures to polynomial moved Polynomialfeatures to _polynomial.py Mar 3, 2021
@avigupta2612
Copy link
Contributor Author

Is changelog entry required here?

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.

Could you also deal with test_polynomial_and_spline_array_order and its comment?

Comment on lines 37 to 38
from ._polynomial import SplineTransformer
from ._polynomial import PolynomialFeatures
Copy link
Member

Choose a reason for hiding this comment

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

Change the order`

@@ -427,3 +432,290 @@ def transform(self, X):
j for j in range(XBS.shape[1]) if (j + 1) % n_splines != 0
]
return XBS[:, indices]


class PolynomialFeatures(TransformerMixin, BaseEstimator):
Copy link
Member

Choose a reason for hiding this comment

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

I would place it before the splines.

Comment on lines 11 to 12
from sklearn.preprocessing import KBinsDiscretizer, SplineTransformer
from sklearn.preprocessing import PolynomialFeatures
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from sklearn.preprocessing import KBinsDiscretizer, SplineTransformer
from sklearn.preprocessing import PolynomialFeatures
from sklearn.preprocessing import (
KBinsDiscretizer, PolynomialFeatures, SplineTransformer
)

@lorentzenchr lorentzenchr changed the title moved Polynomialfeatures to _polynomial.py MNT move PolynomialFeatures from _data.py to _polynomial.py Mar 16, 2021
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

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks!

@rth rth merged commit ca9618c into scikit-learn:main Mar 18, 2021
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
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.

MAINT Move PolynomialFeatures to _polynomial.py
5 participants