Repository: scikit-learn/scikit-learn
File: sklearn/preprocessing/_target_encoder.py (Python)

Code before:
        .. versionchanged:: 1.4
           Added the option 'multiclass'.

    smooth : "auto" or float, default="auto"
        The amount of mixing of the target mean conditioned on the value of the
        category with the global target mean. A larger `smooth` value will put
        more weight on the global target mean.
        If `"auto"`, then `smooth` is set to an empirical Bayes estimate.

    cv : int, cross-validation generator or an iterable, default=None
        Determines the splitting strategy used in the internal :term:`cross fitting`
        during :meth:`fit_transform`. Splitters where each sample index doesn't appear
        in a validation fold exactly once, raise a `ValueError`.
        Possible inputs for cv are:

        - None, to use a 5-fold cross-validation chosen internally based on
            `target_type` and `groups`,
        - integer, to specify the number of folds for the cross-validation chosen
            internally based on `target_type`,
        - :term:`CV splitter` that does not repeat samples across test folds,
        - an iterable yielding (train, test) splits as arrays of indices.

        For integer/None inputs, if `target_type` is `"continuous"`, :class:`KFold` is
        used, otherwise :class:`StratifiedKFold` is used. After calling
        :meth:`fit_transform`, the `cv_` attribute stores the name of the
        cross-validation strategy used.

        Refer :ref:`User Guide <cross_validation>` for mor information on
        cross-validation strategies.

        .. versionchanged:: 1.9
            Cross-validation generators and iterables can also be passed as `cv`.

    shuffle : bool, default=True
        Whether to shuffle the data in :meth:`fit_transform` before splitting into
        folds. Note that the samples within each split will not be shuffled. Only
        applies if `cv` is an int or `None`. If `cv` is a cross-validation generator or
        an iterable, `shuffle` is ignored.

    random_state : int, RandomState instance or None, default=None
        When `shuffle` is True, `random_state` affects the ordering of the
        indices, which controls the randomness of each fold. Otherwise, this
        parameter has no effect.
        Pass an int for reproducible output across multiple function calls.
        See :term:`Glossary <random_state>`.

    Attributes
    ----------
    encodings_ : list of shape (n_features,) or (n_features * n_classes) of \
                    ndarray
        Encodings learnt on all of `X`.

Review comment (refactor):
we don't really do this in other places, and thinking of our conventions, if I see `obj.cv_` I'd expect the actual instance, not the name. So I'd remove this attribute.

Code after:
        .. versionchanged:: 1.4
           Added the option 'multiclass'.

    smooth : "auto" or float, default="auto"
        The amount of mixing of the target mean conditioned on the value of the
        category with the global target mean. A larger `smooth` value will put
        more weight on the global target mean.
        If `"auto"`, then `smooth` is set to an empirical Bayes estimate.

    cv : int, cross-validation generator or an iterable, default=None
        Determines the splitting strategy used in the internal :term:`cross fitting`
        during :meth:`fit_transform`. Splitters where each sample index doesn't appear
        in the validation fold exactly once, raise a `ValueError`.
        Possible inputs for cv are:

        - `None`, to use a 5-fold cross-validation chosen internally based on
            `target_type`,
        - integer, to specify the number of folds for the cross-validation chosen
            internally based on `target_type`,
        - :term:`CV splitter` that does not repeat samples across validation folds,
        - an iterable yielding (train, test) splits as arrays of indices.

        For integer/None inputs, if `target_type` is `"continuous"`, :class:`KFold` is
        used, otherwise :class:`StratifiedKFold` is used.

        Refer :ref:`User Guide <cross_validation>` for more information on
        cross-validation strategies.

        .. versionchanged:: 1.9
            Cross-validation generators and iterables can also be passed as `cv`.

    shuffle : bool, default=True
        Whether to shuffle the data in :meth:`fit_transform` before splitting into
        folds. Note that the samples within each split will not be shuffled. Only
        applies if `cv` is an int or `None`. If `cv` is a cross-validation generator or
        an iterable, `shuffle` is ignored.

    random_state : int, RandomState instance or None, default=None
        When `shuffle` is True, `random_state` affects the ordering of the
        indices, which controls the randomness of each fold. Otherwise, this
        parameter has no effect.
        Pass an int for reproducible output across multiple function calls.
        See :term:`Glossary <random_state>`.

    Attributes
    ----------
    encodings_ : list of shape (n_features,) or (n_features * n_classes) of \
                    ndarray
        Encodings learnt on all of `X`.
        For feature `i`, `encodings_[i]` are the encodings matching the
        categories listed in `categories_[i]`. When `target_type_` is