class_docstr: Test the DroppingCurve visualizer
docstr: Test that visualizer can be accessed within a sklearn pipeline
docstr_tok: ["Test","that","visualizer","can","be","accessed","within","a","sklearn","pipeline"]
code: def test_within_pipeline(self):
      """
      Test that visualizer can be accessed within a sklearn pipeline
      """
      X, y = load_mushroom(return_dataset=True).to_numpy()
      X = OneHotEncoder().fit_transform(X).toarray()
  
      model = Pipeline(
          [
              ("minmax", MinMaxScaler()),
              ("matrix", DroppingCurve(BernoulliNB(), random_state=42)),
          ]
      )
  
      model.fit(X, y)
      model["matrix"].finalize()
      self.assert_images_similar(model["matrix"], tol=12)
  
imports: import sys
  import pytest
  import numpy
  from unittest.mock import patch
  from tests.base import VisualTestCase
  from sklearn.svm import SVC
  from sklearn.naive_bayes import BernoulliNB, MultinomialNB
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.preprocessing import OneHotEncoder, MinMaxScaler
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.model_selection import ShuffleSplit, StratifiedKFold
  from sklearn.pipeline import Pipeline
  from yellowbrick.datasets import load_mushroom
  from yellowbrick.exceptions import YellowbrickValueError
  from yellowbrick.model_selection import DroppingCurve, dropping_curve
label_desc: Use image node_id 8 for calling the TestDroppingCurve obj's underlying member method code with example usage: obj.test_within_pipeline() without return types