Skip to content

DatasetContainsTargetError

Bases: ValueError

Raised when a dataset contains the target column already.

Parameters:

Name Type Description Default
target_name str

The name of the target column.

required
Source code in src/safeds/exceptions/_ml.py
class DatasetContainsTargetError(ValueError):
    """
    Raised when a dataset contains the target column already.

    Parameters
    ----------
    target_name: str
        The name of the target column.
    """

    def __init__(self, target_name: str):
        super().__init__(f"Dataset already contains the target column '{target_name}'.")

__init__(target_name)

Source code in src/safeds/exceptions/_ml.py
def __init__(self, target_name: str):
    super().__init__(f"Dataset already contains the target column '{target_name}'.")