class_docstr: Calculate predict-level variable attributions as Break Down
  
  Parameters
  -----------
  type : {'break_down_interactions', 'break_down'}
      Type of variable attributions (default is `'break_down_interactions'`).
  order : list of int or str, optional
      Use a fixed order of variables for attribution calculation. Use integer values
      or string variable names (default is `None` which means order by importance).
  interaction_preference : int, optional
      Specify which interactions will be present in an explanation. The larger the
      integer, the more frequently interactions will be presented (default is `1`).
  keep_distributions : bool, optional
      Save the distribution of partial predictions (default is `False`).
  
  Attributes
  -----------
  result : pd.DataFrame
      Main result attribute of an explanation.
  type : {'break_down_interactions', 'break_down'}
      Type of variable attributions.
  order : list of int or str or None
      Order of variables used in attribution calculation.
  interaction_preference : int
      Frequency of interaction use.
  keep_distributions : bool
      Save the distribution of partial predictions.
  yhats_distributions : pd.DataFrame or None
      The distribution of partial predictions.
  
  Notes
  --------
  - https://pbiecek.github.io/ema/breakDown.html
  - https://pbiecek.github.io/ema/iBreakDown.html
class_docstr_tok: ["Calculate","predict-level","variable","attributions","as","Break","Down","Parameters","--","--","--","--","--","-","type",":","{","'break_down_interactions","'",",","'break_down","'","}","Type","of","variable","attributions","(","default","is","`","'break_down_interactions","'","`",")",".","order",":","list","of","int","or","str",",","optional","Use","a","fixed","order","of","variables","for","attribution","calculation",".","Use","integer","values","or","string","variable","names","(","default","is","`","None","`","which","means","order","by","importance",")",".","interaction_preference",":","int",",","optional","Specify","which","interactions","will","be","present","in","an","explanation",".","The","larger","the","integer",",","the","more","frequently","interactions","will","be","presented","(","default","is","`","1","`",")",".","keep_distributions",":","bool",",","optional","Save","the","distribution","of","partial","predictions","(","default","is","`","False","`",")",".","Attributes","--","--","--","--","--","-","result",":","pd.DataFrame","Main","result","attribute","of","an","explanation",".","type",":","{","'break_down_interactions","'",",","'break_down","'","}","Type","of","variable","attributions",".","order",":","list","of","int","or","str","or","None","Order","of","variables","used","in","attribution","calculation",".","interaction_preference",":","int","Frequency","of","interaction","use",".","keep_distributions",":","bool","Save","the","distribution","of","partial","predictions",".","yhats_distributions",":","pd.DataFrame","or","None","The","distribution","of","partial","predictions",".","Notes","--","--","--","--","-","https",":","\/\/pbiecek.github.io\/ema\/breakDown.html","-","https",":","\/\/pbiecek.github.io\/ema\/iBreakDown.html"]
docstr: Calculate the result of explanation
  
  Fit method makes calculations in place and changes the attributes.
  
  Parameters
  -----------
  explainer : Explainer object
      Model wrapper created using the Explainer class.
  new_observation : pd.Series or np.ndarray
      An observation for which a prediction needs to be explained.
  
  Returns
  -----------
  None
docstr_tok: ["Calculate","the","result","of","explanation","Fit","method","makes","calculations","in","place","and","changes","the","attributes",".","Parameters","--","--","--","--","--","-","explainer",":","Explainer","object","Model","wrapper","created","using","the","Explainer","class",".","new_observation",":","pd.Series","or","np.ndarray","An","observation","for","which","a","prediction","needs","to","be","explained",".","Returns","--","--","--","--","--","-","None"]
code: def fit(self, explainer, new_observation):
      """Calculate the result of explanation
  
      Fit method makes calculations in place and changes the attributes.
  
      Parameters
      -----------
      explainer : Explainer object
          Model wrapper created using the Explainer class.
      new_observation : pd.Series or np.ndarray
          An observation for which a prediction needs to be explained.
  
      Returns
      -----------
      None
      """
  
      _new_observation = checks.check_new_observation(
          new_observation, explainer
      )
      if _new_observation.shape[0] != 1:
          warnings.warn(
              "You should pass only one new_observation, taken only first"
          )
          _new_observation = _new_observation.iloc[0, :]
  
      if self.type == "break_down_interactions":
          result, yhats_distributions = utils.local_interactions(
              explainer,
              _new_observation,
              self.interaction_preference,
              "2d",
              self.order,
              self.keep_distributions,
          )
      elif self.type == "break_down":
          result, yhats_distributions = utils.local_interactions(
              explainer,
              _new_observation,
              self.interaction_preference,
              "1d",
              self.order,
              self.keep_distributions,
          )
      else:
          raise ValueError(
              "'type' must be one of {'break_down_interactions', 'break_down'}"
          )
  
      self.result = result
      self.yhats_distributions = yhats_distributions
  
file_path: DALEX/python/dalex/dalex/predict_explanations/_break_down/object.py
imports: import numpy
  import pandas
  from plotly.subplots import make_subplots
  import warnings
  from .None import checks, plot, utils
  from ...None import _theme, _global_checks
  from ..._explanation import Explanation
label_desc: Use image node_id 3 for calling the BreakDown obj's underlying member method code with example usage: obj.fit(explainer, new_observation) without return types