pyreal.explanation_types.base.Explanation#

class pyreal.explanation_types.base.Explanation(explanation, values=None)[source]#

A type wrapper for outputs from explanation algorithms. Validates that an object is a valid explanation output.

__init__(explanation, values=None)[source]#

Set the wrapped explanation to explanation and values to values and validate :param explanation: wrapped explanation :type explanation: object :param values: Values corresponding with the object being explained :type values: DataFrame of shape (n_instances, n_features) or None

Methods

__init__(explanation[, values])

Set the wrapped explanation to explanation and values to values and validate :param explanation: wrapped explanation :type explanation: object :param values: Values corresponding with the object being explained :type values: DataFrame of shape (n_instances, n_features) or None

apply_feature_descriptions(feature_descriptions)

Apply feature descriptions to explanation and values

get()

Get the explanation wrapped by this type.

get_all()

Get the explanation and wrapped values as a tuple.

get_explanation()

Get the explanation wrapped by this type

get_values()

Return the values associated with the explanation

update_explanation(new_explanation[, ...])

Sets this object's explanation to the new value.

update_values(values[, inplace])

Updates this objects values, and validates

validate()

Validate that self.explanation is a valid object of type Explanation.

validate_values()

Validate that self.values are valid values for this Explanation.