4341a7775df1d34798dafa9cc7c8b480ccce21d6,fancyimpute/bayesian_ridge_regression.py,BayesianRidgeRegression,fit,#BayesianRidgeRegression#Any#Any#Any#,45

Before Change


        self.beta_estimate = multi_dot([self.inverse_covariance, X_ones.T, y])
        // now we need the estimate of the noise variance
        // reference: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/summary.lm.html
        residuals = (y - self.predict(X))
        // square all the residuals
        residuals **= 2
        self.sigma_squared_estimate = residuals.sum() / max((n - d), 1)
        self.covar = self.sigma_squared_estimate * self.inverse_covariance

After Change


        // get the residual of the predictions and square it
        pred -= y
        pred **= 2
        sum_squared_residuals = pred.sum()
        self.sigma_squared_estimate = sum_squared_residuals / max((n - d), 1)
        self.covar = self.sigma_squared_estimate * self.inverse_covariance

    def predict(self, X, random_draw=False):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


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


Project Name: Calamari-OCR/calamari
Commit Name: 1b305c86dc2ff6b3461c42f4428460b66a8bff8b
Time: 2020-01-31
Author: wick.chr.info@gmail.com
File Name: calamari_ocr/ocr/backends/tensorflow_backend/tensorflow_model.py
Class Name: TensorflowModel
Method Name: predict_dataset


Project Name: donlnz/nonconformist
Commit Name: ad8f38c5c2687793d88c990a54bf9f3c9aeecf42
Time: 2018-01-19
Author: giovanni.cherubin@gmail.com
File Name: nonconformist/cp.py
Class Name: TcpClassifier
Method Name: predict


Project Name: explosion/thinc
Commit Name: 01449ed3c3b81abf84c7ffd78c5a57855421e146
Time: 2017-08-14
Author: honnibal+gh@gmail.com
File Name: thinc/neural/_classes/hash_embed.py
Class Name: HashEmbed
Method Name: begin_update