Ridge sample weights: fixes #1489

This fixes #1489 (wrong behavior in ridge for sample weights) by fixing the formulas of the ridge when sample weights are passed, and by shifting the intercept.