fc4917ae8a7320fc9a258b50d82a177ed2124a91,category_encoders/basen.py,BaseNEncoder,fit_base_n_encoding,#BaseNEncoder#,148

Before Change


            digits = self.calc_required_digits(X, col)
            X_unique = pd.DataFrame(index=values)

            X_unique_to_cols = X_unique.index.map(lambda x: self.col_transform(x, digits))

            for dig in range(digits):
                X_unique[str(col) + "_%d" % (dig,)] = X_unique_to_cols.map(
                    lambda r: int(r[dig]) if r is not None else None)

After Change


            digits = self.calc_required_digits(values)
            X_unique = pd.DataFrame(index=values,
                                    columns=[str(col) + "_%d" % x for x in range(digits)],
                                    data=np.array([self.col_transform(x, digits) for x in range(1, len(values) + 1)]))

            if self.handle_unknown == "return_nan":
                X_unique.loc[-1] = np.nan
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: fc4917ae8a7320fc9a258b50d82a177ed2124a91
Time: 2018-12-21
Author: jcastaldo08@gmail.com
File Name: category_encoders/basen.py
Class Name: BaseNEncoder
Method Name: fit_base_n_encoding


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: soft-matter/trackpy
Commit Name: 0ad4e0c8dd5f918c2cdb29186b8212a3107cca57
Time: 2014-07-25
Author: daniel.b.allan@gmail.com
File Name: trackpy/tests/test_feature.py
Class Name:
Method Name: draw_gaussian_spot