class_docstr: Test FeatureImportances visualizer
docstr: Test that visualizer properly handles an already-fitted model
docstr_tok: ["Test","that","visualizer","properly","handles","an","already-fitted","model"]
code: def test_with_fitted(self):
      """
      Test that visualizer properly handles an already-fitted model
      """
      X, y = load_concrete(return_dataset=True).to_numpy()
  
      model = Lasso().fit(X, y)
  
      with mock.patch.object(model, "fit") as mockfit:
          oz = FeatureImportances(model)
          oz.fit(X, y)
          mockfit.assert_not_called()
  
      with mock.patch.object(model, "fit") as mockfit:
          oz = FeatureImportances(model, is_fitted=True)
          oz.fit(X, y)
          mockfit.assert_not_called()
  
      with mock.patch.object(model, "fit") as mockfit:
          oz = FeatureImportances(model, is_fitted=False)
          oz.fit(X, y)
          mockfit.assert_called_once_with(X, y)
  
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 22 for calling the TestFeatureImportancesVisualizer obj's underlying member method code with example usage: obj.test_with_fitted() without return types