utils#

Utility methods for the data checks in EvalML.

Module Contents#

Functions#

handle_data_check_action_code

Handles data check action codes by either returning the DataCheckActionCode or converting from a str.

Contents#

evalml.data_checks.utils.handle_data_check_action_code(action_code)[source]#

Handles data check action codes by either returning the DataCheckActionCode or converting from a str.

Parameters

action_code (str or DataCheckActionCode) – Data check action code that needs to be handled.

Returns

DataCheckActionCode enum

Raises
  • KeyError – If input is not a valid DataCheckActionCode enum value.

  • ValueError – If input is not a string or DatCheckActionCode object.

Examples

>>> assert handle_data_check_action_code("drop_col") == DataCheckActionCode.DROP_COL
>>> assert handle_data_check_action_code("DROP_ROWS") == DataCheckActionCode.DROP_ROWS
>>> assert handle_data_check_action_code("Impute_col") == DataCheckActionCode.IMPUTE_COL