code: def test_front_page_model_agnostic_rank():
      """Test the rank regularized explanation of the ReadMe example."""
  
      # print the JS visualization code to the notebook
      shap.initjs()
  
      # train a SVM classifier
      (
          X_train,
          X_test,
          Y_train,
          _,
      ) = sklearn.model_selection.train_test_split(
          *shap.datasets.iris(), test_size=0.1, random_state=0
      )
      svm = sklearn.svm.SVC(kernel="rbf", probability=True)
      svm.fit(X_train, Y_train)
  
      # use Kernel SHAP to explain test set predictions
      explainer = shap.KernelExplainer(
          svm.predict_proba,
          X_train,
          nsamples=100,
          link="logit",
          l1_reg="rank(3)",
      )
      shap_values = explainer.shap_values(X_test)
  
      # plot the SHAP values for the Setosa output of the first instance
      shap.force_plot(
          explainer.expected_value[0],
          shap_values[0][0, :],
          X_test.iloc[0, :],
          link="logit",
      )
  
file_path: shap/tests/explainers/test_kernel.py
imports: import numpy
  import pandas
  import scipy.sparse
  import sklearn
  import shap
label_desc: Use image node_id 4 for calling a global function with example usage: test_front_page_model_agnostic_rank() without return types