def fit(self, X, y=None, **kwargs):
    'Fit encoder according to X.\n\n        Parameters\n        ----------\n        X : array-like, shape = [n_samples, n_features]\n            Training vectors, where n_samples is the number of samples\n            and n_features is the number of features.\n        y : array-like, shape = [n_samples]\n            Target values.\n\n        Returns\n        -------\n        self : encoder\n            Returns self.\n        '
    X = util.convert_input(X)
    self._dim = X.shape[1]
    if (self.cols is None):
        self.cols = util.get_obj_cols(X)
    else:
        self.cols = util.convert_cols_to_list(self.cols)
    self._check_set_create_dict_attrs()
    self._fit_count_encode(X, y)
    if self.drop_invariant:
        self.drop_cols = []
        X_temp = self.transform(X)
        generated_cols = util.get_generated_cols(X, X_temp, self.cols)
        self.drop_cols = [x for x in generated_cols if (X_temp[x].var() <= 0.0001)]
    return self
Fit encoder according to X.

Parameters
----------
X : array-like, shape = [n_samples, n_features]
    Training vectors, where n_samples is the number of samples
    and n_features is the number of features.
y : array-like, shape = [n_samples]
    Target values.

Returns
-------
self : encoder
    Returns self.
def fit(self, X, y=None, **kwargs):
    'Fit encoder according to X.\n\n        Parameters\n        ----------\n        X : array-like, shape = [n_samples, n_features]\n            Training vectors, where n_samples is the number of samples\n            and n_features is the number of features.\n        y : array-like, shape = [n_samples]\n            Target values.\n\n        Returns\n        -------\n        self : encoder\n            Returns self.\n        '
    X = util.convert_input(X)
    self._dim = X.shape[1]
    if (self.cols is None):
        self.cols = util.get_obj_cols(X)
    else:
        self.cols = util.convert_cols_to_list(self.cols)
    self._check_set_create_dict_attrs()
    self._fit_count_encode(X, y)
    if self.drop_invariant:
        self.drop_cols = []
        X_temp = self.transform(X)
        generated_cols = util.get_generated_cols(X, X_temp, self.cols)
        self.drop_cols = [x for x in generated_cols if (X_temp[x].var() <= 0.0001)]
    return self