DashAI.back.explainability.PermutationFeatureImportance

class PermutationFeatureImportance(model: BaseModel, scoring: str | List[str] | None = None, n_repeats: int = 5, random_state: int | None = None, max_samples: int = 1)[source]

Permutation Feature Importance is a explanation method to asses the importance of each feature in a model by evaluating how much the model’s performance decreases when the values of a specific feature are randomly shuffled.

__init__(model: BaseModel, scoring: str | List[str] | None = None, n_repeats: int = 5, random_state: int | None = None, max_samples: int = 1)[source]

Initialize a new instance of PermutationFeatureImportance explainer.

Parameters:
  • model (BaseModel) – Model to be explained

  • scoring (Union[str, List[str], None]) – Scorer to evaluate how the perfomance of the model changes when a particular feature is shuffled

  • n_repeats (int) – Numer of times to permute a feature

  • random_state (Union[int, None]) – Seed for the random number generator to control the permutations of each feature

  • max_samples (int) – The number of samples to draw from the dataset to calculate feature importance at each repetition

Methods

__init__(model[, scoring, n_repeats, ...])

Initialize a new instance of PermutationFeatureImportance explainer.

explain(dataset)

Method for calculating the importance of features in the model

get_schema()

Generates the component related Json Schema.

plot(explanation)

Method to create the explanation plot.

validate_and_transform(raw_data)

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Attributes

COMPATIBLE_COMPONENTS

TYPE