edac1ed27ba8a4db58f526af053d6cd2b4f50497,category_encoders/basen.py,BaseNEncoder,basen_to_integer,#BaseNEncoder#Any#Any#Any#,335

Before Change


                value_array = np.array([base ** (len0 - 1 - i) for i in range(len0)])

            X[col] = np.dot(X[col_list].values, value_array.T)
            out_cols = [col0 for col0 in out_cols if col0 not in col_list]

        X = X.reindex(columns=out_cols + cols)

        return X

    def col_transform(self, col, digits):

After Change



        for col in cols:
            col_list = [col0 for col0 in out_cols if str(col0).startswith(str(col))]
            insert_at = out_cols.index(col_list[0])

            if base == 1:
                value_array = np.array([int(col0.split("_")[-1]) for col0 in col_list])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: edac1ed27ba8a4db58f526af053d6cd2b4f50497
Time: 2019-03-22
Author: datarian@againstthecurrent.ch
File Name: category_encoders/basen.py
Class Name: BaseNEncoder
Method Name: basen_to_integer


Project Name: etal/cnvkit
Commit Name: 7c03f6dd8be4ee7de7f4a120984db889fafe9c28
Time: 2016-05-19
Author: eric.talevich@gmail.com
File Name: cnvlib/commands.py
Class Name:
Method Name: do_gainloss


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: be4714db73202347a07044f2e26920e0da95fff3
Time: 2019-03-23
Author: datarian@againstthecurrent.ch
File Name: category_encoders/basen.py
Class Name: BaseNEncoder
Method Name: basen_to_integer