class_docstr: Test the ValidationCurve visualizer
class_docstr_tok: ["Test","the","ValidationCurve","visualizer"]
docstr: Test image closeness on a regression dataset with a DecisionTree
docstr_tok: ["Test","image","closeness","on","a","regression","dataset","with","a","DecisionTree"]
code: def test_regression(self):
      """
      Test image closeness on a regression dataset with a DecisionTree
      """
      X, y = self.regression
  
      cv = ShuffleSplit(3, random_state=938)
      param_range = np.arange(3, 10)
  
      oz = ValidationCurve(
          DecisionTreeRegressor(random_state=23),
          param_name="max_depth",
          param_range=param_range,
          cv=cv,
          scoring="r2",
      )
  
      oz.fit(X, y)
      oz.finalize()
  
      self.assert_images_similar(oz, tol=12.0)
  
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
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.preprocessing import OneHotEncoder
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.model_selection import ShuffleSplit, StratifiedKFold
  from yellowbrick.datasets import load_mushroom
  from yellowbrick.exceptions import YellowbrickValueError
  from yellowbrick.model_selection.validation_curve import *
label_desc: Use image node_id 3 for calling the TestValidationCurve obj's underlying member method code with example usage: obj.test_regression() without return types