68c9bab4a5c6821c2a4395763c676ba796406c49,dask_ml/preprocessing/_encoders.py,OneHotEncoder,_fit,#OneHotEncoder#Any#Any#,157

Before Change


                self.categories_.append(cats)
                self.dtypes_.append(None)
        else:
            if not (X.dtypes == "category").all():
                raise ValueError("All columns must be Categorical dtype.")
            if self.categories == "auto":
                for col in X.columns:
                    Xi = X[col]
                    cats = _encode(Xi, uniques=Xi.cat.categories)
                    self.categories_.append(cats)
                    self.dtypes_.append(Xi.dtype)
            else:
                raise ValueError(
                    "Cannot specify "categories" with DataFrame input. "
                    "Use a categorical dtype instead."
                )

        self.categories_ = dask.compute(self.categories_)[0]

    def transform(

After Change


                self.dtypes_.append(None)
        else:
            for i in range(len(X.columns)):
                Xi = X.iloc[:, i]
                if self.categories != "auto":
                    categories = self.categories[i]
                    Xi = Xi.astype(pd.CategoricalDtype(categories))
                else:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dask/dask-ml
Commit Name: 68c9bab4a5c6821c2a4395763c676ba796406c49
Time: 2020-08-17
Author: TomAugspurger@users.noreply.github.com
File Name: dask_ml/preprocessing/_encoders.py
Class Name: OneHotEncoder
Method Name: _fit


Project Name: dask/dask-ml
Commit Name: 68c9bab4a5c6821c2a4395763c676ba796406c49
Time: 2020-08-17
Author: TomAugspurger@users.noreply.github.com
File Name: dask_ml/preprocessing/_encoders.py
Class Name: OneHotEncoder
Method Name: _transform


Project Name: deepgram/kur
Commit Name: 1f1adbf4aa47514d0ce857398fa0d1cb2956e267
Time: 2017-01-03
Author: ajsyp@syptech.net
File Name: kur/providers/shuffle_provider.py
Class Name: ShuffleProvider
Method Name: __init__