31f768dd2cd555649d2b0e494935cb37cf223142,category_encoders/one_hot.py,OneHotEncoder,reverse_dummies,#OneHotEncoder#Any#Any#,360

Before Change


                X.loc[X[existing_col] == 1, col] = val
                mapped_columns.append(existing_col)

        out_cols = [col0 for col0 in out_cols if col0 not in mapped_columns]

        return X.reindex(columns=out_cols + cols)

    def get_feature_names(self):

After Change


        for switch in mapping:
            col = switch.get("col")
            mod = switch.get("mapping")
            insert_at = out_cols.index(mod.columns[0])

            X.insert(insert_at, col, 0)
            positive_indexes = mod.index[mod.index > 0]
            for i in range(positive_indexes.shape[0]):
                existing_col = mod.columns[i]
                val = positive_indexes[i]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 31f768dd2cd555649d2b0e494935cb37cf223142
Time: 2019-03-22
Author: datarian@againstthecurrent.ch
File Name: category_encoders/one_hot.py
Class Name: OneHotEncoder
Method Name: reverse_dummies


Project Name: EpistasisLab/tpot
Commit Name: 61c14212f3bc3e9be868e8c2f3f59ba53756ebf1
Time: 2016-08-08
Author: supacoofoo@gmail.com
File Name: tests.py
Class Name:
Method Name: test_combine_dfs


Project Name: osmr/imgclsmob
Commit Name: d852c93925137c7bfcc7c78559f1b0e66acbdabb
Time: 2019-04-11
Author: osemery@gmail.com
File Name: convert_models.py
Class Name:
Method Name: convert_pt2pt