class_docstr: Calculate model-level variable importance
  
  Parameters
  -----------
  loss_function : {'rmse', '1-auc', 'mse', 'mae', 'mad'} or function, optional
      If string, then such loss function will be used to assess variable importance
      (default is `'rmse'` or `'1-auc'`, depends on `model_type` attribute).
  type : {'variable_importance', 'ratio', 'difference'}, optional
      Type of transformation that will be applied to dropout loss.
  N : int, optional
      Number of observations that will be sampled from the `data` attribute before
      the calculation of variable importance. 
      `None` means all `data` (default is `1000`).
  B : int, optional
      Number of permutation rounds to perform on each variable (default is `10`).
  variables : array_like of str, optional
      Variables for which the importance will be calculated
      (default is `None`, which means all of the variables).
      NOTE: Ignored if `variable_groups` is not None.
  variable_groups : dict of lists, optional
      Group the variables to calculate their joint variable importance
      e.g. `{'X': ['x1', 'x2'], 'Y': ['y1', 'y2']}` (default is `None`).
  keep_raw_permutations: bool, optional
      Save results for all permutation rounds (default is `True`).
  processes : int, optional
      Number of parallel processes to use in calculations. Iterated over `B`
      (default is `1`, which means no parallel computation).
  random_state : int, optional
      Set seed for random number generator (default is random seed).
  
  Attributes
  -----------
  result : pd.DataFrame
      Main result attribute of an explanation.
  loss_function : function
      Loss function used to assess the variable importance.
  type : {'variable_importance', 'ratio', 'difference'}
      Type of transformation that will be applied to dropout loss.
  N : int
      Number of observations that will be sampled from the `data` attribute 
      before the calculation of variable importance.
  B : int
      Number of permutation rounds to perform on each variable.
  variables : array_like of str or None
      Variables for which the importance will be calculated
  variable_groups : dict of lists or None
      Grouped variables to calculate their joint variable importance.
  keep_raw_permutations: bool
      Save the results for all permutation rounds.
  permutation : pd.DataFrame or None
      The results for all permutation rounds.
  processes : int
      Number of parallel processes to use in calculations. Iterated over `B`.
  random_state : int or None
      Set seed for random number generator.
  
  Notes
  --------
  - https://pbiecek.github.io/ema/featureImportance.html
code: def __init__(
      self,
      loss_function="rmse",
      type="variable_importance",
      N=1000,
      B=10,
      variables=None,
      variable_groups=None,
      keep_raw_permutations=True,
      processes=1,
      random_state=None,
  ):
      _loss_function = checks.check_loss_function(loss_function)
      _B = checks.check_B(B)
      _type = checks.check_type(type)
      _random_state = checks.check_random_state(random_state)
      _keep_raw_permutations = checks.check_keep_raw_permutations(
          keep_raw_permutations, B
      )
      _processes = checks.check_processes(processes)
  
      self.loss_function = _loss_function
      self.type = _type
      self.N = N
      self.B = _B
      self.variables = variables
      self.variable_groups = variable_groups
      self.random_state = _random_state
      self.keep_raw_permutations = _keep_raw_permutations
      self.result = pd.DataFrame()
      self.permutation = None
      self.processes = _processes
  
file_path: DALEX/python/dalex/dalex/model_explanations/_variable_importance/object.py
imports: import numpy
  import pandas
  from plotly.subplots import make_subplots
  from .None import checks, plot, utils
  from ...None import _theme, _global_checks
  from ..._explanation import Explanation
label_desc: Use image node_id 1 to create a new VariableImportance object from inherited base classes: Explanation with example: obj = VariableImportance(loss_function, type, N, B, variables, variable_groups, keep_raw_permutations, processes, random_state)