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)

After Change


                else:
                    categories = X[col].unique()

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

                data = pd.Series(index=index, data=range(1, len(index) + 1))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: facebookresearch/Horizon
Commit Name: 9cf8f6cdf6a2008843cb37da6e34b8d10353b0bf
Time: 2019-12-12
Author: kittipat@fb.com
File Name: ml/rl/preprocessing/sparse_to_dense.py
Class Name: PythonSparseToDenseProcessor
Method Name: process


Project Name: jeongyoonlee/Kaggler
Commit Name: 897636a15789e621da899879972f0ae2a70446e4
Time: 2018-07-13
Author: jeongyoon.lee1@gmail.com
File Name: kaggler/preprocessing/data.py
Class Name: LabelEncoder
Method Name: _transform_col