(self, lr_weights: LinearModelWeights, gradient)
return new_param
For l2 regularization, the regular term has been added in gradients.
For l2 regularization, the regular term has been added in gradients.
For l2 regularization the regular term has been added in gradients .
def _l2_updator(self, lr_weights: LinearModelWeights, gradient):
        """
        For l2 regularization, the regular term has been added in gradients.
        """

        new_weights = lr_weights.unboxed - gradient
        new_param = LinearModelWeights(new_weights, lr_weights.fit_intercept, lr_weights.raise_overflow_error)

        return new_param
def _l2_updator ( self , lr_weights : LinearModelWeights , gradient ) : new_weights = lr_weights . unboxed - gradient new_param = LinearModelWeights ( new_weights , lr_weights . fit_intercept , lr_weights . raise_overflow_error ) return new_param