class_docstr: Test FeatureImportances visualizer
docstr: Test fit with absolute values
docstr_tok: ["Test","fit","with","absolute","values"]
code: def test_fit_absolute(self):
      """
      Test fit with absolute values
      """
      coefs = np.array(
          [0.4, 0.2, -0.08, 0.07, 0.16, 0.23, -0.38, 0.1, -0.05]
      )
  
      model = MockEstimator()
      model.make_importance_param(value=coefs)
  
      # Test absolute value
      visualizer = FeatureImportances(
          model, absolute=True, relative=False
      )
      visualizer.fit(
          np.random.rand(100, len(coefs)), np.random.rand(100)
      )
  
      expected = np.array(
          [0.05, 0.07, 0.08, 0.1, 0.16, 0.2, 0.23, 0.38, 0.4]
      )
      npt.assert_array_equal(visualizer.feature_importances_, expected)
  
      # Test no absolute value
      visualizer = FeatureImportances(
          model, absolute=False, relative=False
      )
      visualizer.fit(
          np.random.rand(100, len(coefs)), np.random.rand(100)
      )
  
      expected = np.array(
          [-0.38, -0.08, -0.05, 0.07, 0.1, 0.16, 0.2, 0.23, 0.4]
      )
      npt.assert_array_equal(visualizer.feature_importances_, expected)
  
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 8 for calling the TestFeatureImportancesVisualizer obj's underlying member method code with example usage: obj.test_fit_absolute() without return types