prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  ClassificationScoreVisualizers should return accuracy
  See #358 and #213  -- classification score visualizers should return accuracy when `score()` is called. If F1 or accuracy is not in the figure it should also be included in the figure. 
  
  </issue>
  <code>
  [start of yellowbrick/classifier/base.py]
  1 # yellowbrick.classifier.base
  2 # API for classification visualizer hierarchy.
  3 #
  4 # Author:   Rebecca Bilbro <rbilbro@districtdatalabs.com>
  5 # Author:   Benjamin Bengfort <bbengfort@districtdatalabs.com>
  6 # Author:   Neal Humphrey
  7 # Created:  Wed May 18 12:39:40 2016 -0400
  8 #
  9 # Copyright (C) 2016 District Data Labs
  10 # For license information, see LICENSE.txt
  11 #
  12 # ID: base.py [5388065] neal@nhumphrey.com $
  13 
  14 """
  15 API for classification visualizer hierarchy.
  16 """
  17 
  18 ##########################################################################
  19 ## Imports
  20 ##########################################################################
  21 
  22 import numpy as np
  23 
  24 from ..utils import isclassifier
  25 from ..base import ScoreVisualizer
  26 from ..style.palettes import color_palette
  27 from ..exceptions import YellowbrickTypeError
  28 
  29 
  30 ##########################################################################
  31 ## Base Classification Visualizer
  32 ##########################################################################
  33 
  34 class ClassificationScoreVisualizer(ScoreVisualizer):
  35 
  36     def __init__(self, model, ax=None, classes=None, **kwargs):
  37         """
  38         Check to see if model is an instance of a classifer.
  39         Should return an error if it isn't.
  40 
  41         .. todo:: document this class.
  42         .. tood:: accept as input classes as all visualizers need this.
  43         """
  44         # A bit of type checking
  45         if not isclassifier(model):
  46             raise YellowbrickTypeError(
  47                 "This estimator is not a classifier; "
  48                 "try a regression or clustering score visualizer instead!"
  49         )
  50 
  51         # Initialize the super method.
  52         super(ClassificationScoreVisualizer, self).__init__(model, ax=ax, **kwargs)
  53 
  54         # Convert to array if necessary to match estimator.classes_
  55         if classes is not None:
  56             classes = np.array(classes)
  57 
  58         # Set up classifier score visualization properties
  59         if classes is not None:
  60             n_colors = len(classes)
  61         else:
  62             n_colors = None
  63 
  64         self.colors    = color_palette(kwargs.pop('colors', None), n_colors)
  65         self.classes_  = classes
  66 
  67     @property
  68     def classes_(self):
  69         """
  70         Proxy property to smartly access the classes from the estimator or
  71         stored locally on the score visualizer for visualization.
  72         """
  73         if self.__classes is None:
  74             try:
  75                 return self.estimator.classes_
  76             except AttributeError:
  77                 return None
  78         return self.__classes
  79 
  80     @classes_.setter
  81     def classes_(self, value):
  82         self.__classes = value
  83 
  84     def fit(self, X, y=None, **kwargs):
  85         """
  86         Parameters
  87         ----------
  88 
  89         X : ndarray or DataFrame of shape n x m
  90             A matrix of n instances with m features
  91 
  92         y : ndarray or Series of length n
  93             An array or series of target or class values
  94 
  95         kwargs: keyword arguments passed to Scikit-Learn API.
  96 
  97         Returns
  98         -------
  99         self : instance
  100             Returns the instance of the classification score visualizer
  101 
  102         """
  103         # Fit the inner estimator
  104         self.estimator.fit(X, y)
  105 
  106         # Extract the classes from the estimator
  107         if self.classes_ is None:
  108             self.classes_ = self.estimator.classes_
  109 
  110         # Always return self from fit
  111         return self
  112 
  113     #TODO during refactoring this can be used to generalize ClassBalance
  114     def class_counts(self, y):
  115         unique, counts = np.unique(y, return_counts=True)
  116         return dict(zip(unique, counts))
  117
  [end of yellowbrick/classifier/base.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/yellowbrick/classifier/base.py b/yellowbrick/classifier/base.py
  --- a/yellowbrick/classifier/base.py
  +++ b/yellowbrick/classifier/base.py
  @@ -110,6 +110,28 @@
           # Always return self from fit
           return self
   
  +
  +    def score(self, X, y, **kwargs):
  +        """
  +        The score function is the hook for visual interaction. Pass in test
  +        data and the visualizer will create predictions on the data and
  +        evaluate them with respect to the test values. The evaluation will
  +        then be passed to draw() and the result of the estimator score will
  +        be returned.
  +        Parameters
  +        ----------
  +        X : array-like
  +            X (also X_test) are the dependent variables of test set to predict
  +        y : array-like
  +            y (also y_test) is the independent actual variables to score against
  +        Returns
  +        -------
  +        score : float
  +        """
  +        self.score_ =  self.estimator.score(X, y, **kwargs)
  +
  +        return self.score_
  +
       #TODO during refactoring this can be used to generalize ClassBalance
       def class_counts(self, y):
           unique, counts = np.unique(y, return_counts=True)
  
verification_info: {"golden_diff": "diff --git a/yellowbrick/classifier/base.py b/yellowbrick/classifier/base.py\n--- a/yellowbrick/classifier/base.py\n+++ b/yellowbrick/classifier/base.py\n@@ -110,6 +110,28 @@\n         # Always return self from fit\n         return self\n \n+\n+    def score(self, X, y, **kwargs):\n+        \"\"\"\n+        The score function is the hook for visual interaction. Pass in test\n+        data and the visualizer will create predictions on the data and\n+        evaluate them with respect to the test values. The evaluation will\n+        then be passed to draw() and the result of the estimator score will\n+        be returned.\n+        Parameters\n+        ----------\n+        X : array-like\n+            X (also X_test) are the dependent variables of test set to predict\n+        y : array-like\n+            y (also y_test) is the independent actual variables to score against\n+        Returns\n+        -------\n+        score : float\n+        \"\"\"\n+        self.score_ =  self.estimator.score(X, y, **kwargs)\n+\n+        return self.score_\n+\n     #TODO during refactoring this can be used to generalize ClassBalance\n     def class_counts(self, y):\n         unique, counts = np.unique(y, return_counts=True)\n", "issue": "ClassificationScoreVisualizers should return accuracy\nSee #358 and #213  -- classification score visualizers should return accuracy when `score()` is called. If F1 or accuracy is not in the figure it should also be included in the figure. \n", "before_files": [{"content": "# yellowbrick.classifier.base\n# API for classification visualizer hierarchy.\n#\n# Author:   Rebecca Bilbro <rbilbro@districtdatalabs.com>\n# Author:   Benjamin Bengfort <bbengfort@districtdatalabs.com>\n# Author:   Neal Humphrey\n# Created:  Wed May 18 12:39:40 2016 -0400\n#\n# Copyright (C) 2016 District Data Labs\n# For license information, see LICENSE.txt\n#\n# ID: base.py [5388065] neal@nhumphrey.com $\n\n\"\"\"\nAPI for classification visualizer hierarchy.\n\"\"\"\n\n##########################################################################\n## Imports\n##########################################################################\n\nimport numpy as np\n\nfrom ..utils import isclassifier\nfrom ..base import ScoreVisualizer\nfrom ..style.palettes import color_palette\nfrom ..exceptions import YellowbrickTypeError\n\n\n##########################################################################\n## Base Classification Visualizer\n##########################################################################\n\nclass ClassificationScoreVisualizer(ScoreVisualizer):\n\n    def __init__(self, model, ax=None, classes=None, **kwargs):\n        \"\"\"\n        Check to see if model is an instance of a classifer.\n        Should return an error if it isn't.\n\n        .. todo:: document this class.\n        .. tood:: accept as input classes as all visualizers need this.\n        \"\"\"\n        # A bit of type checking\n        if not isclassifier(model):\n            raise YellowbrickTypeError(\n                \"This estimator is not a classifier; \"\n                \"try a regression or clustering score visualizer instead!\"\n        )\n\n        # Initialize the super method.\n        super(ClassificationScoreVisualizer, self).__init__(model, ax=ax, **kwargs)\n\n        # Convert to array if necessary to match estimator.classes_\n        if classes is not None:\n            classes = np.array(classes)\n\n        # Set up classifier score visualization properties\n        if classes is not None:\n            n_colors = len(classes)\n        else:\n            n_colors = None\n\n        self.colors    = color_palette(kwargs.pop('colors', None), n_colors)\n        self.classes_  = classes\n\n    @property\n    def classes_(self):\n        \"\"\"\n        Proxy property to smartly access the classes from the estimator or\n        stored locally on the score visualizer for visualization.\n        \"\"\"\n        if self.__classes is None:\n            try:\n                return self.estimator.classes_\n            except AttributeError:\n                return None\n        return self.__classes\n\n    @classes_.setter\n    def classes_(self, value):\n        self.__classes = value\n\n    def fit(self, X, y=None, **kwargs):\n        \"\"\"\n        Parameters\n        ----------\n\n        X : ndarray or DataFrame of shape n x m\n            A matrix of n instances with m features\n\n        y : ndarray or Series of length n\n            An array or series of target or class values\n\n        kwargs: keyword arguments passed to Scikit-Learn API.\n\n        Returns\n        -------\n        self : instance\n            Returns the instance of the classification score visualizer\n\n        \"\"\"\n        # Fit the inner estimator\n        self.estimator.fit(X, y)\n\n        # Extract the classes from the estimator\n        if self.classes_ is None:\n            self.classes_ = self.estimator.classes_\n\n        # Always return self from fit\n        return self\n\n    #TODO during refactoring this can be used to generalize ClassBalance\n    def class_counts(self, y):\n        unique, counts = np.unique(y, return_counts=True)\n        return dict(zip(unique, counts))\n", "path": "yellowbrick/classifier/base.py"}]}