code: def test_explain_weights(iris_train):
      X, y, feature_names, target_names = iris_train
      kwargs = dict(n_iter=20, random_state=42)
      for perm in [
          PermutationImportance(SVC(C=10).fit(X, y), **kwargs),
          PermutationImportance(SVC(C=10), cv=None, **kwargs),
          PermutationImportance(SVC(C=10), cv=3, **kwargs),
      ]:
          perm.fit(X, y)
          print(perm.score(X, y))
          expl = eli5.explain_weights(
              perm,
              target_names=target_names,
              feature_names=feature_names,
          )
          assert "generalization" in expl.description
          imp = expl.feature_importances.importances
          assert len(imp) == 4
          assert [n.feature.startswith("petal") for n in imp[:2]]
          assert [n.feature.startswith("sepal") for n in imp[2:]]
  
          res = format_as_all(expl, perm.wrapped_estimator_)
          for _expl in res:
              assert "petal width (cm)" in _expl
  
imports: import pytest
  import numpy
  from sklearn.base import is_classifier, is_regressor
  from sklearn.svm import SVR, SVC
  from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
  from sklearn.model_selection import train_test_split, cross_val_score
  from sklearn.pipeline import make_pipeline
  from sklearn.feature_selection import SelectFromModel
  from sklearn.linear_model import LogisticRegression
  import eli5
  from eli5.sklearn import PermutationImportance
  from .utils import format_as_all
label_desc: Use image node_id 11 for calling a global function with example usage: test_explain_weights(iris_train) without return types