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

Before Change


        if mapping is not None:
            mapping_out = mapping
            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:

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: 5

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: scikit-learn-contrib/categorical-encoding
Commit Name: 94ab93f25cc8bc648b561923a3ce85206e050e3d
Time: 2018-09-25
Author: jcastaldo08@gmail.com
File Name: category_encoders/ordinal.py
Class Name: OrdinalEncoder
Method Name: ordinal_encoding


Project Name: EducationalTestingService/skll
Commit Name: ca10c185d94470054d693f19e7691523dbe3ec55
Time: 2019-03-05
Author: jbiggs@ets.org
File Name: skll/data/readers.py
Class Name: NDJReader
Method Name: _sub_read