data_check_action_option#
Recommended action returned by a DataCheck.
Module Contents#
Classes Summary#
A recommended action option returned by a DataCheck. |
|
Enum for data check action option parameter allowed values type. |
|
Enum for data check action option parameter type. |
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", "most_frequent"], ... "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 a dictionary into a DataCheckActionOption.
Returns an action based on the defaults parameters.
Return a dictionary form of the data check action option.
- static convert_dict_to_option(action_dict)[source]#
Convert a dictionary into a DataCheckActionOption.
- Parameters
action_dict – Dictionary to convert into an action option. 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.
- class evalml.data_checks.data_check_action_option.DCAOParameterAllowedValuesType[source]#
Enum for data check action option parameter allowed values type.
Attributes
CATEGORICAL
Categorical allowed values type. Parameters that have a set of allowed values.
NUMERICAL
Numerical allowed values type. Parameters that have a range of allowed values.
Methods
- name(self)#
The name of the Enum member.
- value(self)#
The value of the Enum member.
- class evalml.data_checks.data_check_action_option.DCAOParameterType[source]#
Enum for data check action option parameter type.
Attributes
COLUMN
Column parameter type. Parameters that apply to a specific column in the data set.
GLOBAL
Global parameter type. Parameters that apply to the entire data set.
Methods
Get a list of all defined parameter types.
Handles the data check action option parameter type by either returning the DCAOParameterType enum or converting from a str.
The name of the Enum member.
The value of the Enum member.
- all_parameter_types(cls)#
Get a list of all defined parameter types.
- Returns
List of all defined parameter types.
- Return type
list(DCAOParameterType)
- static handle_dcao_parameter_type(dcao_parameter_type)[source]#
Handles the data check action option parameter type by either returning the DCAOParameterType enum or converting from a str.
- Parameters
dcao_parameter_type (str or DCAOParameterType) – Data check action option parameter type that needs to be handled.
- Returns
DCAOParameterType enum
- Raises
KeyError – If input is not a valid DCAOParameterType enum value.
ValueError – If input is not a string or DCAOParameterType object.
- name(self)#
The name of the Enum member.
- value(self)#
The value of the Enum member.