class_docstr: Calculate model-level hierarchical aspect importance
  
  Parameters
  ----------
  loss_function :  {'rmse', '1-auc', 'mse', 'mae', 'mad'} or function, optional
      If string, then such loss function will be used to assess aspect importance
      (default is `'rmse'` or `'1-auc'`, depends on `explainer.model_type` attribute).
  type : {'variable_importance', 'ratio', 'difference'}, optional
      Type of transformation that will be applied to dropout loss
      (default is `'variable_importance'`, which is Permutational Variable Importance).
  N : int, optional
      Number of observations that will be sampled from the `explainer.data` attribute before
      the calculation of aspect importance. `None` means all `data` (default is `1000`).
  B : int, optional
      Number of permutation rounds to perform on each variable (default is `10`).
  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.
  single_variable_importance : pd.DataFrame
      Additional result attribute of an explanation (it contains information 
      about the importance of individual variables).
  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 `explainer.data` attribute before
      the calculation of aspect importance. `None` means all `data` (default is `1000`).
  B : int
      Number of permutation rounds to perform on each variable (default is `10`).
  processes : int
      Number of parallel processes to use in calculations. Iterated over `B`
      (default is `1`, which means no parallel computation).
  random_state : int or None
      Set seed for random number generator.
  
  Notes
  -----
  - https://arxiv.org/abs/2104.03403
class_docstr_tok: ["Calculate","model-level","hierarchical","aspect","importance","Parameters","--","--","--","--","--","loss_function",":","{","'rmse","'",",","'","1-auc","'",",","'mse","'",",","'mae","'",",","'mad","'","}","or","function",",","optional","If","string",",","then","such","loss","function","will","be","used","to","assess","aspect","importance","(","default","is","`","'rmse","'","`","or","`","'","1-auc","'","`",",","depends","on","`","explainer.model_type","`","attribute",")",".","type",":","{","'variable_importance","'",",","'ratio","'",",","'difference","'","}",",","optional","Type","of","transformation","that","will","be","applied","to","dropout","loss","(","default","is","`","'variable_importance","'","`",",","which","is","Permutational","Variable","Importance",")",".","N",":","int",",","optional","Number","of","observations","that","will","be","sampled","from","the","`","explainer.data","`","attribute","before","the","calculation","of","aspect","importance",".","`","None","`","means","all","`","data","`","(","default","is","`","1000","`",")",".","B",":","int",",","optional","Number","of","permutation","rounds","to","perform","on","each","variable","(","default","is","`","10","`",")",".","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",".","single_variable_importance",":","pd.DataFrame","Additional","result","attribute","of","an","explanation","(","it","contains","information","about","the","importance","of","individual","variables",")",".","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","`","explainer.data","`","attribute","before","the","calculation","of","aspect","importance",".","`","None","`","means","all","`","data","`","(","default","is","`","1000","`",")",".","B",":","int","Number","of","permutation","rounds","to","perform","on","each","variable","(","default","is","`","10","`",")",".","processes",":","int","Number","of","parallel","processes","to","use","in","calculations",".","Iterated","over","`","B","`","(","default","is","`","1","`",",","which","means","no","parallel","computation",")",".","random_state",":","int","or","None","Set","seed","for","random","number","generator",".","Notes","--","--","-","-","https",":","\/\/arxiv.org\/abs\/2104.03403"]
docstr: Calculate the result of explanation
  Fit method makes calculations in place and changes the attributes.
  
  Parameters
  ----------
  aspect : Aspect object
      Explainer wrapper created using the Aspect class.
  
  Returns
  -----------
  None
docstr_tok: ["Calculate","the","result","of","explanation","Fit","method","makes","calculations","in","place","and","changes","the","attributes",".","Parameters","--","--","--","--","--","aspect",":","Aspect","object","Explainer","wrapper","created","using","the","Aspect","class",".","Returns","--","--","--","--","--","-","None"]
code: def fit(self, aspect):
      """Calculate the result of explanation
      Fit method makes calculations in place and changes the attributes.
  
      Parameters
      ----------
      aspect : Aspect object
          Explainer wrapper created using the Aspect class.
  
      Returns
      -----------
      None
      """
      _loss_function = checks.check_method_loss_function(
          aspect.explainer, self.loss_function
      )
      self.loss_function = checks.check_loss_function(_loss_function)
  
      self._hierarchical_clustering_dendrogram = (
          aspect._hierarchical_clustering_dendrogram
      )
  
      ## middle plot
      (
          self.result,
          aspect._full_hierarchical_aspect_importance,
      ) = utils.calculate_model_hierarchical_importance(
          aspect,
          self.loss_function,
          self.type,
          self.N,
          self.B,
          self.processes,
          self.random_state,
      )
  
      ## left plot data
      (
          self.single_variable_importance,
          svi_full,
      ) = utils.calculate_single_variable_importance(
          aspect,
          self.loss_function,
          self.type,
          self.N,
          self.B,
          self.processes,
          self.random_state,
      )
  
      aspect._full_hierarchical_aspect_importance = pd.concat(
          [aspect._full_hierarchical_aspect_importance, svi_full]
      )
  
file_path: DALEX/python/dalex/dalex/aspect/_model_triplot/object.py
imports: import numpy
  import pandas
  from copy import deepcopy
  import plotly.graph_objs
  from dalex import _theme, _global_checks
  from dalex._explanation import Explanation
  from .None import checks, plot, utils
label_desc: Use image node_id 3 for calling the ModelTriplot obj's underlying member method code with example usage: obj.fit(aspect) without return types