Skip to content

ImputerStrategy

Bases: ABC

The abstract base class of the different imputation strategies supported by the Imputer.

This class is only needed for type annotations. Use the subclasses nested inside Imputer.Strategy instead.

Source code in src/safeds/data/tabular/typing/_imputer_strategy.py
class ImputerStrategy(ABC):
    """
    The abstract base class of the different imputation strategies supported by the `Imputer`.

    This class is only needed for type annotations. Use the subclasses nested inside `Imputer.Strategy` instead.
    """

    @abstractmethod
    def _augment_imputer(self, imputer: sk_SimpleImputer) -> None:
        """
        Set the imputer strategy of the given imputer.

        Parameters
        ----------
        imputer: SimpleImputer
            The imputer to augment.
        """

    @abstractmethod
    def __eq__(self, other: object) -> bool:
        """
        Compare two imputer strategies.

        Parameters
        ----------
        other:
            other object to compare to

        Returns
        -------
        equals:
            Whether the two imputer strategies are equal
        """

    def __hash__(self) -> int:
        """
        Return a deterministic hash value for this imputer strategy.

        Returns
        -------
        hash:
            The hash value.
        """
        return _structural_hash(self.__class__.__qualname__)

__eq__(other) abstractmethod

Compare two imputer strategies.

Parameters:

Name Type Description Default
other object

other object to compare to

required

Returns:

Name Type Description
equals bool

Whether the two imputer strategies are equal

Source code in src/safeds/data/tabular/typing/_imputer_strategy.py
@abstractmethod
def __eq__(self, other: object) -> bool:
    """
    Compare two imputer strategies.

    Parameters
    ----------
    other:
        other object to compare to

    Returns
    -------
    equals:
        Whether the two imputer strategies are equal
    """

__hash__()

Return a deterministic hash value for this imputer strategy.

Returns:

Name Type Description
hash int

The hash value.

Source code in src/safeds/data/tabular/typing/_imputer_strategy.py
def __hash__(self) -> int:
    """
    Return a deterministic hash value for this imputer strategy.

    Returns
    -------
    hash:
        The hash value.
    """
    return _structural_hash(self.__class__.__qualname__)