prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  BUG: model info check fails when model is sklearn pipeline
  to reproduce:
  https://www.kaggle.com/itay94/notebook6f16624759
  
  ![image](https://user-images.githubusercontent.com/20860465/147880701-f8edc031-bc19-4a1b-a30b-6f9f8b89b782.png)
  
  
  </issue>
  <code>
  [start of deepchecks/checks/overview/model_info.py]
  1 # ----------------------------------------------------------------------------
  2 # Copyright (C) 2021 Deepchecks (https://www.deepchecks.com)
  3 #
  4 # This file is part of Deepchecks.
  5 # Deepchecks is distributed under the terms of the GNU Affero General
  6 # Public License (version 3 or later).
  7 # You should have received a copy of the GNU Affero General Public License
  8 # along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.
  9 # ----------------------------------------------------------------------------
  10 #
  11 """Module contains model_info check."""
  12 import pandas as pd
  13 from sklearn.base import BaseEstimator
  14 
  15 from deepchecks import ModelOnlyBaseCheck, CheckResult
  16 from deepchecks.utils.validation import model_type_validation
  17 
  18 
  19 __all__ = ['ModelInfo']
  20 
  21 
  22 class ModelInfo(ModelOnlyBaseCheck):
  23     """Summarize given model parameters."""
  24 
  25     def run(self, model: BaseEstimator) -> CheckResult:
  26         """Run check.
  27 
  28         Args:
  29             model (BaseEstimator): A scikit-learn-compatible fitted estimator instance
  30 
  31         Returns:
  32             CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}
  33         """
  34         return self._model_info(model)
  35 
  36     def _model_info(self, model: BaseEstimator):
  37         model_type_validation(model)
  38         model_type = type(model).__name__
  39         model_params = model.get_params()
  40         default_params = type(model)().get_params()
  41 
  42         # Create dataframe to show
  43         model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])
  44         model_param_df['Default'] = model_param_df['Parameter'].map(lambda x: default_params.get(x, ''))
  45 
  46         def highlight_not_default(data):
  47             n = len(data)
  48             if data['Value'] != data['Default']:
  49                 return n * ['background-color: lightblue']
  50             else:
  51                 return n * ['']
  52 
  53         model_param_df = model_param_df.style.apply(highlight_not_default, axis=1).hide_index()
  54 
  55         value = {'type': model_type, 'params': model_params}
  56         footnote = '<p style="font-size:0.7em"><i>Colored rows are parameters with non-default values</i></p>'
  57         display = [f'Model Type: {model_type}', model_param_df, footnote]
  58 
  59         return CheckResult(value, header='Model Info', display=display)
  60
  [end of deepchecks/checks/overview/model_info.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/deepchecks/checks/overview/model_info.py b/deepchecks/checks/overview/model_info.py
  --- a/deepchecks/checks/overview/model_info.py
  +++ b/deepchecks/checks/overview/model_info.py
  @@ -14,6 +14,7 @@
   
   from deepchecks import ModelOnlyBaseCheck, CheckResult
   from deepchecks.utils.validation import model_type_validation
  +from deepchecks.utils.model import get_model_of_pipeline
   
   
   __all__ = ['ModelInfo']
  @@ -31,13 +32,11 @@
           Returns:
               CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}
           """
  -        return self._model_info(model)
  -
  -    def _model_info(self, model: BaseEstimator):
           model_type_validation(model)
  -        model_type = type(model).__name__
  -        model_params = model.get_params()
  -        default_params = type(model)().get_params()
  +        estimator = get_model_of_pipeline(model)
  +        model_type = type(estimator).__name__
  +        model_params = estimator.get_params()
  +        default_params = type(estimator)().get_params()
   
           # Create dataframe to show
           model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])
  
verification_info: {"golden_diff": "diff --git a/deepchecks/checks/overview/model_info.py b/deepchecks/checks/overview/model_info.py\n--- a/deepchecks/checks/overview/model_info.py\n+++ b/deepchecks/checks/overview/model_info.py\n@@ -14,6 +14,7 @@\n \n from deepchecks import ModelOnlyBaseCheck, CheckResult\n from deepchecks.utils.validation import model_type_validation\n+from deepchecks.utils.model import get_model_of_pipeline\n \n \n __all__ = ['ModelInfo']\n@@ -31,13 +32,11 @@\n         Returns:\n             CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}\n         \"\"\"\n-        return self._model_info(model)\n-\n-    def _model_info(self, model: BaseEstimator):\n         model_type_validation(model)\n-        model_type = type(model).__name__\n-        model_params = model.get_params()\n-        default_params = type(model)().get_params()\n+        estimator = get_model_of_pipeline(model)\n+        model_type = type(estimator).__name__\n+        model_params = estimator.get_params()\n+        default_params = type(estimator)().get_params()\n \n         # Create dataframe to show\n         model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])\n", "issue": "BUG: model info check fails when model is sklearn pipeline\nto reproduce:\r\nhttps://www.kaggle.com/itay94/notebook6f16624759\r\n\r\n![image](https://user-images.githubusercontent.com/20860465/147880701-f8edc031-bc19-4a1b-a30b-6f9f8b89b782.png)\r\n\n", "before_files": [{"content": "# ----------------------------------------------------------------------------\n# Copyright (C) 2021 Deepchecks (https://www.deepchecks.com)\n#\n# This file is part of Deepchecks.\n# Deepchecks is distributed under the terms of the GNU Affero General\n# Public License (version 3 or later).\n# You should have received a copy of the GNU Affero General Public License\n# along with Deepchecks.  If not, see <http://www.gnu.org/licenses/>.\n# ----------------------------------------------------------------------------\n#\n\"\"\"Module contains model_info check.\"\"\"\nimport pandas as pd\nfrom sklearn.base import BaseEstimator\n\nfrom deepchecks import ModelOnlyBaseCheck, CheckResult\nfrom deepchecks.utils.validation import model_type_validation\n\n\n__all__ = ['ModelInfo']\n\n\nclass ModelInfo(ModelOnlyBaseCheck):\n    \"\"\"Summarize given model parameters.\"\"\"\n\n    def run(self, model: BaseEstimator) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            model (BaseEstimator): A scikit-learn-compatible fitted estimator instance\n\n        Returns:\n            CheckResult: value is dictionary in format {type: <model_type>, params: <model_params_dict>}\n        \"\"\"\n        return self._model_info(model)\n\n    def _model_info(self, model: BaseEstimator):\n        model_type_validation(model)\n        model_type = type(model).__name__\n        model_params = model.get_params()\n        default_params = type(model)().get_params()\n\n        # Create dataframe to show\n        model_param_df = pd.DataFrame(model_params.items(), columns=['Parameter', 'Value'])\n        model_param_df['Default'] = model_param_df['Parameter'].map(lambda x: default_params.get(x, ''))\n\n        def highlight_not_default(data):\n            n = len(data)\n            if data['Value'] != data['Default']:\n                return n * ['background-color: lightblue']\n            else:\n                return n * ['']\n\n        model_param_df = model_param_df.style.apply(highlight_not_default, axis=1).hide_index()\n\n        value = {'type': model_type, 'params': model_params}\n        footnote = '<p style=\"font-size:0.7em\"><i>Colored rows are parameters with non-default values</i></p>'\n        display = [f'Model Type: {model_type}', model_param_df, footnote]\n\n        return CheckResult(value, header='Model Info', display=display)\n", "path": "deepchecks/checks/overview/model_info.py"}]}