class _BaseRidge(six.with_metaclass(ABCMeta, LinearModel)):
@abstractmethod
def __init__(self, alpha = 1.0, fit_intercept = True, normalize = False,
copy_X = True, max_iter = None, tol = 1e-3, solver = "auto", random_state = None):
self.alpha = alpha
self.fit_intercept = fit_intercept
self.normalize = normalize
self.copy_X = copy_X
self.max_iter = max_iter
self.solver = solver
self.random_state = random_state
def fit(self, X, y, sample_weight = None):
X, y = check_X_y(X, y, ['csr', 'csc', 'coo'], dtype = np.float64,
multi_output = True, y_numeric = True)
if ((sample_weight is not None) and np.atleast_1d(sample_weight).ndim > 1):
raise ValueError("Sample weights must be 1D array or scalar")
X, y, X_offset, y_offset, X_scale = self._preprocess_data(X, y, self.fit_interce