class_docstr: Test FeatureImportances visualizer
docstr: Check the various xlabels are sensical
docstr_tok: ["Check","the","various","xlabels","are","sensical"]
code: def test_xlabel(self):
      """
      Check the various xlabels are sensical
      """
      model = MockEstimator()
      model.make_importance_param("feature_importances_")
      visualizer = FeatureImportances(
          model, xlabel="foo", relative=True
      )
  
      # Assert the visualizer uses the user supplied xlabel
      assert (
          visualizer._get_xlabel() == "foo"
      ), "could not set user xlabel"
  
      # Check the visualizer default relative xlabel
      visualizer.set_params(xlabel=None)
      assert "relative" in visualizer._get_xlabel()
  
      # Check value xlabel with default
      visualizer.set_params(relative=False)
      assert "relative" not in visualizer._get_xlabel()
  
      # Check coeficients
      model = MockEstimator()
      model.make_importance_param("coef_")
      visualizer = FeatureImportances(
          model, xlabel="baz", relative=True
      )
  
      # Assert the visualizer uses the user supplied xlabel
      assert (
          visualizer._get_xlabel() == "baz"
      ), "could not set user xlabel"
  
      # Check the visualizer default relative xlabel
      visualizer.set_params(xlabel=None)
      assert "coefficient" in visualizer._get_xlabel()
      assert "relative" in visualizer._get_xlabel()
  
      # Check value xlabel with default
      visualizer.set_params(relative=False)
      assert "coefficient" in visualizer._get_xlabel()
      assert "relative" not in visualizer._get_xlabel()
  
imports: import pytest
  import numpy
  import numpy.testing
  import matplotlib.pyplot
  from yellowbrick.exceptions import NotFitted
  from yellowbrick.model_selection.importances import *
  from yellowbrick.datasets import load_occupancy, load_concrete
  from sklearn.datasets import load_iris
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.ensemble import GradientBoostingClassifier
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.linear_model import LogisticRegression, Lasso
  from sklearn.impute import SimpleImputer
  from sklearn.pipeline import Pipeline
  from unittest import mock
  from tests.base import VisualTestCase
label_desc: Use image node_id 20 for calling the TestFeatureImportancesVisualizer obj's underlying member method code with example usage: obj.test_xlabel() without return types