9439f5215fde61ee40910b0320ff4dd8d28571e2,fancyimpute/bayesian_ridge_regression.py,BayesianRidgeRegression,fit,#BayesianRidgeRegression#Any#Any#Any#,28

Before Change


                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:
            self.inverse_covariance = inverse_covariance
        // estimate of the parameters
        self.beta_estimate = np.dot(np.dot(self.inverse_covariance, X_ones.T), y)        

After Change


            else:
                lambda_reg = self.lambda_reg

            for i in range(d - 1):
                // Replacing `outer_product + lambda_reg * eye(d)` with
                // a direct modification of the outer_product matrix
                //
                // 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:
            self.inverse_covariance = inverse_covariance
        // estimate of the parameters
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: iskandr/fancyimpute
Commit Name: 9439f5215fde61ee40910b0320ff4dd8d28571e2
Time: 2016-01-10
Author: alex.rubinsteyn@gmail.com
File Name: fancyimpute/bayesian_ridge_regression.py
Class Name: BayesianRidgeRegression
Method Name: fit


Project Name: data61/python-paillier
Commit Name: eb4ffb6cdaf6f04f978fc57e32c95c8b4a33bcb6
Time: 2017-06-20
Author: giorgio.patrini@anu.edu.au
File Name: examples/federated_learning_with_encryption.py
Class Name: Client
Method Name: fit


Project Name: pymanopt/pymanopt
Commit Name: a1be7bf2f0926707e25b02570c17ba373878f768
Time: 2016-03-14
Author: jamiehntownsend@gmail.com
File Name: pymanopt/manifolds/psd.py
Class Name: PositiveDefinite
Method Name: exp