def fit_transform(self, X, y=None):
        return _transform_selected(X, self._fit_transform,
                                   self.categorical_features, copy=True)
Fit OneHotEncoder to X, then transform X.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/preprocessing/data.py/OneHotEncoder.fit_transform