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:
                    if not pd.api.types.is_categorical_dtype(Xi.dtype):
                        raise ValueError(
                            "All columns must be Categorical dtype when "
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

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: mne-tools/mne-python
Commit Name: fa91217b895957c4106d6175e27d72a48f4f05dc
Time: 2019-01-12
Author: jnu@iki.fi
File Name: mne/viz/topo.py
Class Name:
Method Name: _plot_evoked_topo


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