-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Description of the feature
The LBFGS solver currently doesn't support fit_intercept=True
. A use case of this was described in Issue #320
Considered alternatives
Manual data centering works but complicates the optimization and user experience. In many use cases sklearn is currently is stil the faster alternative.
Additional context
np.random.seed(42)
X = np.random.randn(1000, 50)
y = np.random.poisson(np.exp(X.sum(axis=1) * 0.01 - 1))
# This should work but currently fails as its not supported
estimator = GeneralizedLinearEstimator(
datafit=Poisson(),
penalty=L2(alpha=0.01),
solver=LBFGS(fit_intercept=True) # <- Currently not supported
)
estimator.fit(X, y)
# Compare with sklearn (works fine)
sklearn_model = PoissonRegressor(alpha=0.01, fit_intercept=True, solver='lbfgs')
sklearn_model.fit(X, y)
Note: Pattern exists in anderson_cd.py
(lines 163-166) and other solvers to see how to implement fit_intercept method.
Metadata
Metadata
Assignees
Labels
No labels