Skip to content

TargetDataMismatchError

Bases: ValueError

Raised when the target column of a test dataset mismatches with the target column of the training dataset.

Currently only used in the Baseline Models.

Parameters:

Name Type Description Default
actual_target_name str

The actual target column of the dataset.

required
missing_target_name str

The name of the missing target column.

required
Source code in src/safeds/exceptions/_ml.py
class TargetDataMismatchError(ValueError):
    """
    Raised when the target column of a test dataset mismatches with the target column of the training dataset.

    Currently only used in the Baseline Models.

    Parameters
    ----------
    actual_target_name:
        The actual target column of the dataset.
    missing_target_name:
        The name of the missing target column.
    """

    def __init__(self, actual_target_name: str, missing_target_name: str):
        super().__init__(
            f"The provided target column '{actual_target_name}' does not match the target column of the training set '{missing_target_name}'.",
        )