"""Base class for all data checks."""fromabcimportABC,abstractmethodfromevalml.utilsimportclassproperty
[docs]classDataCheck(ABC):"""Base class for all data checks. Data checks are a set of heuristics used to determine if there are problems with input data. """@classpropertydefname(cls):"""Return a name describing the data check."""returnstr(cls.__name__)
[docs]@abstractmethoddefvalidate(self,X,y=None):"""Inspect and validate the input data, runs any necessary calculations or algorithms, and returns a list of warnings and errors if applicable. Args: X (pd.DataFrame): The input data of shape [n_samples, n_features] y (pd.Series, optional): The target data of length [n_samples] Returns: dict (DataCheckMessage): Dictionary of DataCheckError and DataCheckWarning messages """