class_docstr: Test FeatureImportances visualizer
docstr: On fit, sorted features_ and feature_importances_ params are created
docstr_tok: ["On","fit",",","sorted","features_","and","feature_importances_","params","are","created"]
code: def test_fit_sorted_params(self):
      """
      On fit, sorted features_ and feature_importances_ params are created
      """
      coefs = np.array(
          [0.4, 0.2, 0.08, 0.07, 0.16, 0.23, 0.38, 0.1, 0.05]
      )
      names = np.array(["a", "b", "c", "d", "e", "f", "g", "h", "i"])
  
      model = MockEstimator()
      model.make_importance_param(value=coefs)
  
      visualizer = FeatureImportances(model, labels=names)
      visualizer.fit(
          np.random.rand(100, len(names)), np.random.rand(100)
      )
  
      assert hasattr(visualizer, "features_")
      assert hasattr(visualizer, "feature_importances_")
  
      # get the expected sort index
      sort_idx = np.argsort(coefs)
  
      # assert sorted
      npt.assert_array_equal(names[sort_idx], visualizer.features_)
      npt.assert_array_equal(
          coefs[sort_idx], visualizer.feature_importances_
      )
  
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 5 for calling the TestFeatureImportancesVisualizer obj's underlying member method code with example usage: obj.test_fit_sorted_params() without return types