evalml.data_checks.InvalidTargetDataCheck.validate

InvalidTargetDataCheck.validate(X, y)[source]

Checks if the target labels contain missing or invalid data.

Parameters
  • X (pd.DataFrame, pd.Series, np.array, list) – Features. Ignored.

  • y – Target labels to check for invalid data.

Returns

list with DataCheckErrors if any invalid data is found in target labels.

Return type

list (DataCheckError)

Example

>>> X = pd.DataFrame({})
>>> y = pd.Series([0, 1, None, None])
>>> target_check = InvalidTargetDataCheck()
>>> assert target_check.validate(X, y) == [DataCheckError("2 row(s) (50.0%) of target values are null", "InvalidTargetDataCheck")]