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

Before Change


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

                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))

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

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

        return X, mapping_out
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: scikit-learn-contrib/categorical-encoding
Commit Name: 970491cd9b3cb21b043c22b50b4d09f9dd2481a7
Time: 2018-10-19
Author: jan@motl.us
File Name: category_encoders/woe.py
Class Name: WOEEncoder
Method Name: _score


Project Name: biocore/scikit-bio
Commit Name: 477d91fafb5ecdc5e680ac70b32e9ea247a3be00
Time: 2014-05-07
Author: jai.rideout@gmail.com
File Name: skbio/maths/stats/distance/base.py
Class Name: CategoricalStats
Method Name: _df_to_vector