else:
lambda_reg = self.lambda_reg
regularization_matrix = lambda_reg * np.eye(d)
regularization_matrix[-1, -1] = 0 // don"t need to regularize the intercept
self.inverse_covariance = np.linalg.inv(
outer_product + regularization_matrix)
else:
After Change
//
// We"re trading a little more time spent in the Python
// interpreter with a savings of allocated arrays.
outer_product[i, i] += lambda_reg
self.inverse_covariance = inv(outer_product)
else: