class_docstr: Unit test Contributions Class
  TODO: Docstring
  Parameters
  ----------
  unittest : [type]
      [description]
  Returns
  -------
  [type]
      [description]
class_docstr_tok: ["Unit","test","Contributions","Class","TODO",":","Docstring","Parameters","--","--","--","--","--","unittest",":","[","type","]","[","description","]","Returns","--","--","--","-","[","type","]","[","description","]"]
docstr: Unit test rank contributions 1
docstr_tok: ["Unit","test","rank","contributions","1"]
code: def test_rank_contributions_1(self):
      """
      Unit test rank contributions 1
      """
      model = RandomForestClassifier(n_estimators=3)
      model.fit(self.x_train, self.y_train)
      explainer = shap.TreeExplainer(model)
      shap_values = explainer.shap_values(self.x_test)
      slist = [
          pd.DataFrame(
              data=tab,
              index=self.x_test.index,
              columns=self.x_test.columns,
          )
          for tab in shap_values
      ]
  
      for i in range(3):
          s_ord, x_ord, s_dict = rank_contributions(
              slist[i], pd.DataFrame(data=self.x_test)
          )
          assert np.all(np.diff(np.abs(s_ord), axis=1) <= 0) == 1
          assert np.array_equal(
              x_ord.values,
              np.take_along_axis(
                  self.x_test.values, s_dict.values, axis=1
              ),
          )
  
file_path: shapash/tests/integration_tests/test_contributions_multiclass.py
imports: import unittest
  import shap
  from sklearn.datasets import load_iris
  from sklearn.model_selection import train_test_split
  from sklearn.ensemble import RandomForestClassifier
  import numpy
  import pandas
  from shapash.decomposition.contributions import rank_contributions
label_desc: Use image node_id 5 for calling the TestContributions obj's underlying member method code with example usage: obj.test_rank_contributions_1() without return types