This error occurs when you pass the argument 'normalize' to the Ridge class constructor (init method), which is not a valid argument for the Ridge class.
The Ridge class has several valid arguments, such as alpha, fit_intercept, solver, etc. but 'normalize' is not one of them.
To resolve this error, simply remove the 'normalize' argument from the Ridge class constructor call. Alternatively, you can use a different class that supports the 'normalize' argument, such as RidgeCV or LassoCV.
Example of incorrect usage:
from sklearn.linear_model import Ridge
model = Ridge(normalize=True)
Example of correct usage:
from sklearn.linear_model import Ridge
model = Ridge(alpha=0.5, fit_intercept=True)
Alternatively, using RidgeCV:
from sklearn.linear_model import RidgeCV
model = RidgeCV(normalize=True)
Asked: 2022-01-16 11:00:00 +0000
Seen: 25 times
Last updated: Apr 12 '21