f7bc62ca710f2433273c437be40241f133af2cf4,bambi/models.py,Model,build,#Model#,57

Before Change


        self.R2Y = pd.Series({x:sm.OLS(self.y.data, sm.add_constant(X.drop(x, axis=1))).fit().rsquared
            for x in list(X.columns)})
        self.SDX = X.std()
        self.SDY = self.y.data.std()
        self.meanX = X.mean(0)

        for t in self.terms.values():
            t._setup() 

After Change


            "r2_y":pd.Series({x:pd.stats.api.ols(y=self.y.data.squeeze(), x=X.drop(x, axis=1)).r2
                for x in list(X.columns)}),
            "sd_x":X.std(),
            "sd_y":self.y.data.std(),
            "mean_x":X.mean(axis=0),
            "mean_y":self.y.data.mean()
        }

        // save some info possibly useful for diagnostics, and send to ModelResults
        // mat = correlation matrix of X, w/ diagonal replaced by X means
        mat = X.corr()
        for x in list(mat.columns): mat.loc[x,x] = default_prior_info["mean_x"][x]
        self._diagnostics = {
            // the Variance Inflation Factors (VIF), which is possibly useful for diagnostics
            "VIF":1/(1 - default_prior_info["r2_x"]),
            "corr_mean_X":mat
        }
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 7

Non-data size: 3

Instances


Project Name: bambinos/bambi
Commit Name: f7bc62ca710f2433273c437be40241f133af2cf4
Time: 2016-08-25
Author: jake.a.westfall@gmail.com
File Name: bambi/models.py
Class Name: Model
Method Name: build


Project Name: kengz/SLM-Lab
Commit Name: 51aa4e53db36b1a008729d1aa595b0abe8d0510b
Time: 2019-03-27
Author: kengzwl@gmail.com
File Name: slm_lab/lib/math_util.py
Class Name:
Method Name: standardize


Project Name: apache/incubator-tvm
Commit Name: 417c5980854b17f18a3ef5b40d3180c51be2d46a
Time: 2021-04-06
Author: 2keepconnected@gmail.com
File Name: python/tvm/driver/tvmc/runner.py
Class Name:
Method Name: format_times


Project Name: GPflow/GPflowOpt
Commit Name: 58a41d3ead7475b83e2a0c5551b0e8635607975d
Time: 2017-05-05
Author: joachim.vanderherten@ugent.be
File Name: testing/test_optimizers.py
Class Name: TestBayesianOptimizer
Method Name: setUp


Project Name: NervanaSystems/coach
Commit Name: d302168c8c817e5d4f4a59d9f5dfe283a4150cb1
Time: 2018-05-24
Author: 30383381+itaicaspi-intel@users.noreply.github.com
File Name: agents/clipped_ppo_agent.py
Class Name: ClippedPPOAgent
Method Name: fill_advantages


Project Name: CamDavidsonPilon/lifelines
Commit Name: 9ff8d886d2d96f5505b7509bdd492f18f7ba654f
Time: 2019-12-19
Author: cam.davidson.pilon@gmail.com
File Name: lifelines/fitters/generalized_gamma_fitter.py
Class Name: GeneralizedGammaFitter
Method Name: _create_initial_point


Project Name: arnomoonens/yarll
Commit Name: 31f3b951b2ef1bafc0efafdeb2c8e3b7da2480be
Time: 2019-08-08
Author: arno.moonens@gmail.com
File Name: yarll/agents/ppo/ppo.py
Class Name: PPO
Method Name: learn