b5034279b48ae96ffdd4714f96e0f62b0f4807fc,category_encoders/ordinal.py,OrdinalEncoder,ordinal_encoding,#Any#Any#Any#Any#Any#,239

Before Change


            for switch in mapping:
                categories_dict = dict(switch.get("mapping"))
                column = switch.get("col")
                transformed_column = X[column].map(lambda x: categories_dict.get(x, np.nan))

                try:
                    transformed_column = transformed_column.astype(int)
                except ValueError as e:

After Change


                try:
                    X[column] = X[column].astype(int)
                except ValueError as e:
                    X[column] = X[column].astype(float)

                if impute_missing:
                    if handle_unknown == "impute":
                        X[column].fillna(0, inplace=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: b5034279b48ae96ffdd4714f96e0f62b0f4807fc
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/ordinal.py
Class Name: OrdinalEncoder
Method Name: ordinal_encoding


Project Name: erikbern/ann-benchmarks
Commit Name: e192e7c8155546ab549773cdaa2de943b0614038
Time: 2018-09-30
Author: maau@itu.dk
File Name: ann_benchmarks/algorithms/bruteforce.py
Class Name: BruteForceBLAS
Method Name: fit


Project Name: fgnt/pb_bss
Commit Name: 0d14271f97027c458ad7af1c057ff22f2acd2656
Time: 2019-08-01
Author: cbj@mail.uni-paderborn.de
File Name: pb_bss/evaluation/module_mir_eval.py
Class Name:
Method Name: mir_eval_sources