f4838c7408b81ad960c047df5984901927a86d86,category_encoders/one_hot.py,OneHotEncoder,inverse_transform,#OneHotEncoder#Any#,221

Before Change


                                     "the unknown category -1 when encode %s"%(col,))

        for switch in self.ordinal_encoder.mapping:
            col_dict = {col_pair[1] : col_pair[0] for col_pair in switch.get("mapping")}
            X[switch.get("col")] = X[switch.get("col")].apply(lambda x: col_dict.get(x)).astype(switch.get("data_type"))

        return X if self.return_df else X.values

After Change


                                     "the unknown category -1 when encode %s"%(col,))

        for switch in self.ordinal_encoder.mapping:
            column_mapping = switch.get("mapping")
            inverse = pd.Series(data=column_mapping.index, index=column_mapping.get_values())
            X[switch.get("col")] = X[switch.get("col")].map(inverse).astype(switch.get("data_type"))

        return X if self.return_df else X.values
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 13

Instances


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: f4838c7408b81ad960c047df5984901927a86d86
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/one_hot.py
Class Name: OneHotEncoder
Method Name: inverse_transform


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


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: f4838c7408b81ad960c047df5984901927a86d86
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/basen.py
Class Name: BaseNEncoder
Method Name: inverse_transform


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: f4838c7408b81ad960c047df5984901927a86d86
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/binary.py
Class Name: BinaryEncoder
Method Name: inverse_transform


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: f4838c7408b81ad960c047df5984901927a86d86
Time: 2018-10-26
Author: jcastaldo08@gmail.com
File Name: category_encoders/one_hot.py
Class Name: OneHotEncoder
Method Name: inverse_transform