-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
SplineTransformer raises when passing knots explicity for n_knots=None #19598
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
Comments
Another example: from sklearn.ensemble import GradientBoostingRegressor
g = GradientBoostingRegressor(alpha=None)
g.fit([[1]], [2]) throws an error, even if @mlondschien Why do you think I'd be interested in the opinion of others. Do we have a general pattern that we usually follow? |
Currently import numpy as np
from sklearn.preprocessing import SplineTransformer
X = np.linspace(0, 1, 10)[:, None]
splt = SplineTransformer(
knots=[[0], [1], [2], [3], [4]],
n_knots=2,
degree=3
)
splt.fit(X) works. IMO this is "more incorrect" than Raising an error that |
As the 2 constructor parameters are mutually exclusive, we could collapse them into the As |
If |
@mlondschien I'm fine with allowing |
On master,
currently raises
IMO the
n_knots
argument should be allowed to beNone
(or any other value) if theknots
are passed explicity.cc: @lorentzenchr @ogrisel
xref #18368 and #19483
The text was updated successfully, but these errors were encountered: