def transform(self, X, y=None):
    'Perform the transformation to new categorical data.\n\n        Parameters\n        ----------\n        X : array-like, shape = [n_samples, n_features]\n        y : array-like, shape = [n_samples]\n            \n        Returns\n        -------\n        p : array, shape = [n_samples, n_numeric + N]\n            Transformed values with encoding applied.\n        '
    if (self._dim is None):
        raise ValueError('Must train encoder before it can be used to transform data.')
    X = util.convert_input(X)
    if (X.shape[1] != self._dim):
        raise ValueError(('Unexpected input dimension %d, expected %d' % (X.shape[1], self._dim)))
    if (not self.cols):
        return X
    (X, _) = self._transform_count_encode(X, y)
    if self.drop_invariant:
        for col in self.drop_cols:
            X.drop(col, 1, inplace=True)
    if self.return_df:
        return X
    else:
        return X.values
Perform the transformation to new categorical data.

Parameters
----------
X : array-like, shape = [n_samples, n_features]
y : array-like, shape = [n_samples]
    
Returns
-------
p : array, shape = [n_samples, n_numeric + N]
    Transformed values with encoding applied.
def transform(self, X, y=None):
    'Perform the transformation to new categorical data.\n\n        Parameters\n        ----------\n        X : array-like, shape = [n_samples, n_features]\n        y : array-like, shape = [n_samples]\n            \n        Returns\n        -------\n        p : array, shape = [n_samples, n_numeric + N]\n            Transformed values with encoding applied.\n        '
    if (self._dim is None):
        raise ValueError('Must train encoder before it can be used to transform data.')
    X = util.convert_input(X)
    if (X.shape[1] != self._dim):
        raise ValueError(('Unexpected input dimension %d, expected %d' % (X.shape[1], self._dim)))
    if (not self.cols):
        return X
    (X, _) = self._transform_count_encode(X, y)
    if self.drop_invariant:
        for col in self.drop_cols:
            X.drop(col, 1, inplace=True)
    if self.return_df:
        return X
    else:
        return X.values