data_check_action_option

Recommended action returned by a DataCheck.

Module Contents

Classes Summary

DataCheckActionOption

A recommended action option returned by a DataCheck.

Contents

class evalml.data_checks.data_check_action_option.DataCheckActionOption(action_code, data_check_name, parameters=None, metadata=None)[source]

A recommended action option returned by a DataCheck.

It contains an action code that indicates what the action should be, a data check name that indicates what data check was used to generate the action, and parameters and metadata which can be used to further refine the action.

Parameters
  • action_code (DataCheckActionCode) – Action code associated with the action option.

  • data_check_name (str) – Name of the data check that produced this option.

  • parameters (dict) – Parameters associated with the action option. Defaults to None.

  • metadata (dict, optional) – Additional useful information associated with the action option. Defaults to None.

Examples

>>> parameters = {
...     "global_parameter_name": {
...         "parameter_type": "global",
...         "type": "float",
...         "default_value": 0.0,
...     },
...     "column_parameter_name": {
...         "parameter_type": "column",
...         "columns": {
...             "a": {
...                 "impute_strategy": {
...                     "categories": ["mean", "mode"],
...                     "type": "category",
...                     "default_value": "mean",
...                 },
...             "constant_fill_value": {"type": "float", "default_value": 0},
...             },
...         },
...     },
... }
>>> data_check_action = DataCheckActionOption(DataCheckActionCode.DROP_COL, None, metadata={}, parameters=parameters)

Methods

convert_dict_to_action

Convert a dictionary into a DataCheckActionOption.

to_dict

Return a dictionary form of the data check action option.

static convert_dict_to_action(action_dict)[source]

Convert a dictionary into a DataCheckActionOption.

Parameters

action_dict – Dictionary to convert into action. Should have keys “code”, “data_check_name”, and “metadata”.

Raises

ValueError – If input dictionary does not have keys code and metadata and if the metadata dictionary does not have keys columns and rows.

Returns

DataCheckActionOption object from the input dictionary.

to_dict(self)[source]

Return a dictionary form of the data check action option.