3b7a3e628b0dea98f0dcaad6d91b22c7c137d04d,bambi/models.py,Model,add,#Model#Any#Any#Any#Any#Any#Any#Any#,266

Before Change


                        lev_data = grpr_df.multiply(pred_df.iloc[:, ind],
                                                    axis=0)
                        // Skip terms with no columns left
                        if lev_data.shape[1] == 0:
                            continue

                        // Also rename intercepts and skip if already added.
                        // This can happen if user specifies something like
                        // random=["1|school", "student|school"].
                        if col == "Intercept":
                            if grpr in self.terms:
                                continue
                            label = "1|%s" % grpr

After Change



                    for col, i in pred_df.design_info.column_name_indexes.items():
                        pred_data = pred_df.iloc[:, i]
                        lev_data = grpr_df.multiply(pred_data, axis=0)

                        // Also rename intercepts and skip if already added.
                        // This can happen if user specifies something like
                        // random=["1|school", "student|school"].
                        if col == "Intercept":
                            if grpr in self.terms:
                                continue
                            label = "1|%s" % grpr
                        else:
                            label = col + "|" + grpr

                        prior = priors.pop(label, priors.get("random", None))

                        // Categorical or continuous is determined from data
                        ld = lev_data.values
                        if ((ld == 0) | (ld == 1)).all():
                            lev_data = lev_data.astype(int)
                            cat = True
                        else:
                            cat = False

                        pred_data = pred_data[:, None]  // Must be 2D later
                        term = RandomTerm(self, label, lev_data, pred_data,
                                          grpr_df.values, categorical=cat)
                        self.terms[label] = term

        self.built = False

    def _add_y(self, variable, prior=None, family="gaussian", link=None, *args,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: bambinos/bambi
Commit Name: 3b7a3e628b0dea98f0dcaad6d91b22c7c137d04d
Time: 2017-03-24
Author: tyarkoni@gmail.com
File Name: bambi/models.py
Class Name: Model
Method Name: add


Project Name: shenweichen/DeepCTR
Commit Name: 266090580c44c480d559a15ce2df012eb401adb6
Time: 2020-07-18
Author: iofficium@163.com
File Name: deepctr/layers/interaction.py
Class Name: BilinearInteraction
Method Name: call


Project Name: biolab/orange3
Commit Name: 8a76580ec839cf6fff9364ff1f4794e86834cbe6
Time: 2016-07-15
Author: niko.colneric@gmail.com
File Name: Orange/statistics/util.py
Class Name:
Method Name: stats


Project Name: theislab/scanpy
Commit Name: 0f9f71e7494c7c0db8b48c3c7ae15efe159b5d0d
Time: 2019-10-08
Author: ivirshup@gmail.com
File Name: scanpy/preprocessing/_utils.py
Class Name:
Method Name: _get_mean_var