|
| 1 | +from typing import ClassVar, Literal |
| 2 | +from typing_extensions import Self |
| 3 | + |
| 4 | +from numpy import ndarray |
| 5 | + |
| 6 | +from .._typing import ArrayLike, Int, MatrixLike |
| 7 | +from ..base import OneToOneFeatureMixin |
| 8 | +from ._encoders import _BaseEncoder |
| 9 | + |
| 10 | +class TargetEncoder(OneToOneFeatureMixin, _BaseEncoder): |
| 11 | + encodings_: list[ndarray] |
| 12 | + categories_: list[ndarray] |
| 13 | + target_type_: str |
| 14 | + target_mean_: float |
| 15 | + n_features_in_: int |
| 16 | + feature_names_in_: ndarray |
| 17 | + classes_: ndarray | None |
| 18 | + |
| 19 | + _parameter_constraints: ClassVar[dict] = ... |
| 20 | + |
| 21 | + def __init__( |
| 22 | + self, |
| 23 | + categories: list[ArrayLike] | Literal["auto"] = "auto", |
| 24 | + target_type: Literal["auto", "continuous", "binary", "multiclass"] = "auto", |
| 25 | + smooth: Literal["auto"] | float = "auto", |
| 26 | + cv: int = 5, |
| 27 | + shuffle: bool = True, |
| 28 | + random_state: Int | None = None, |
| 29 | + ) -> None: ... |
| 30 | + def fit(self, X: MatrixLike, y: ArrayLike) -> Self: ... |
| 31 | + def fit_transform(self, X: MatrixLike, y: ArrayLike) -> ndarray: ... |
| 32 | + def transform(self, X: MatrixLike) -> ndarray: ... |
| 33 | + def get_feature_names_out(self, input_features: ArrayLike | None = None) -> ndarray: ... |
| 34 | + def __sklearn_tags__(self) -> dict: ... |
0 commit comments