374ca541aaf62aba88a144acbbc7398ca3e995ef,category_encoders/ordinal.py,OrdinalEncoder,ordinal_encoding,#Any#Any#Any#Any#Any#,255

Before Change


                else:
                    categories = [x if x is not None else np.nan for x in pd.unique(X[col].values)]

                data = {}

                if handle_missing == "value":
                    data[np.nan] = -2

                for i in range(len(categories)):
                    data[categories[i]] = i + 1

                if handle_missing == "return_nan":
                    data[np.nan] = -2

                mapping = pd.Series(data)
                mapping_out.append({"col": col, "mapping": mapping, "data_type": X[col].dtype}, )

        return X, mapping_out

After Change



                index = pd.Series(categories).fillna(nan_identity).unique()

                data = pd.Series(index=index, data=range(1, len(index) + 1))

                if handle_missing == "value" and ~data.index.isnull().any():
                    data.loc[nan_identity] = -2
                elif handle_missing == "return_nan":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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


Project Name: nilmtk/nilmtk
Commit Name: b523b464d8cafe29e352981c1c6df941f205592a
Time: 2014-07-09
Author: jack-list@xlk.org.uk
File Name: nilmtk/metrics.py
Class Name:
Method Name: mean_normalized_error_power


Project Name: sassoftware/python-dlpy
Commit Name: d04b0d52e8789d32d71c099e904a0617756884ac
Time: 2019-09-17
Author: Xiangqian.Hu@SAS.COM
File Name: dlpy/metrics.py
Class Name:
Method Name: accuracy_score