prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  BUG: confusion matrix chart displays wrong output
  To reproduce:  https://www.kaggle.com/itay94/notebook05f499eb19
  
  ![image](https://user-images.githubusercontent.com/20860465/147875903-9701bdc8-a094-4fb5-807b-d99e66befa37.png)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `deepchecks/checks/performance/confusion_matrix_report.py`
  Content:
  ```
  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 """The confusion_matrix_report check module."""
  12 import numpy as np
  13 import sklearn
  14 from sklearn.base import BaseEstimator
  15 
  16 import plotly.figure_factory as ff
  17 from deepchecks import CheckResult, Dataset
  18 from deepchecks.base.check import SingleDatasetBaseCheck
  19 from deepchecks.utils.metrics import ModelType, task_type_validation
  20 
  21 
  22 __all__ = ['ConfusionMatrixReport']
  23 
  24 
  25 class ConfusionMatrixReport(SingleDatasetBaseCheck):
  26     """Calculate the confusion matrix of the model on the given dataset."""
  27 
  28     def run(self, dataset: Dataset, model: BaseEstimator) -> CheckResult:
  29         """Run check.
  30 
  31         Args:
  32             model (BaseEstimator): A scikit-learn-compatible fitted estimator instance
  33             dataset: a Dataset object
  34 
  35         Returns:
  36             CheckResult: value is numpy array of the confusion matrix, displays the confusion matrix
  37 
  38         Raises:
  39             DeepchecksValueError: If the object is not a Dataset instance with a label
  40         """
  41         return self._confusion_matrix_report(dataset, model)
  42 
  43     def _confusion_matrix_report(self, dataset: Dataset, model):
  44         Dataset.validate_dataset(dataset)
  45         dataset.validate_label()
  46         task_type_validation(model, dataset, [ModelType.MULTICLASS, ModelType.BINARY])
  47 
  48         label = dataset.label_name
  49         ds_x = dataset.data[dataset.features]
  50         ds_y = dataset.data[label]
  51         y_pred = model.predict(ds_x)
  52 
  53         confusion_matrix = sklearn.metrics.confusion_matrix(ds_y, y_pred)
  54 
  55         labels = [str(val) for val in np.unique(ds_y)]
  56         fig = ff.create_annotated_heatmap(confusion_matrix, x=labels, y=labels, colorscale='Viridis')
  57         fig.update_layout(width=600, height=600)
  58         fig.update_xaxes(title='Predicted Value')
  59         fig.update_yaxes(title='True value', autorange='reversed')
  60         fig['data'][0]['showscale'] = True
  61         fig['layout']['xaxis']['side'] = 'bottom'
  62 
  63         return CheckResult(confusion_matrix, display=fig)
  64
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/deepchecks/checks/performance/confusion_matrix_report.py b/deepchecks/checks/performance/confusion_matrix_report.py
  --- a/deepchecks/checks/performance/confusion_matrix_report.py
  +++ b/deepchecks/checks/performance/confusion_matrix_report.py
  @@ -9,11 +9,10 @@
   # ----------------------------------------------------------------------------
   #
   """The confusion_matrix_report check module."""
  -import numpy as np
   import sklearn
   from sklearn.base import BaseEstimator
   
  -import plotly.figure_factory as ff
  +import plotly.express as px
   from deepchecks import CheckResult, Dataset
   from deepchecks.base.check import SingleDatasetBaseCheck
   from deepchecks.utils.metrics import ModelType, task_type_validation
  @@ -49,15 +48,12 @@
           ds_x = dataset.data[dataset.features]
           ds_y = dataset.data[label]
           y_pred = model.predict(ds_x)
  -
           confusion_matrix = sklearn.metrics.confusion_matrix(ds_y, y_pred)
   
  -        labels = [str(val) for val in np.unique(ds_y)]
  -        fig = ff.create_annotated_heatmap(confusion_matrix, x=labels, y=labels, colorscale='Viridis')
  +        # Figure
  +        fig = px.imshow(confusion_matrix, x=dataset.classes, y=dataset.classes, text_auto=True)
           fig.update_layout(width=600, height=600)
  -        fig.update_xaxes(title='Predicted Value')
  -        fig.update_yaxes(title='True value', autorange='reversed')
  -        fig['data'][0]['showscale'] = True
  -        fig['layout']['xaxis']['side'] = 'bottom'
  +        fig.update_xaxes(title='Predicted Value', type='category')
  +        fig.update_yaxes(title='True value', type='category')
   
           return CheckResult(confusion_matrix, display=fig)
  
verification_info: {"golden_diff": "diff --git a/deepchecks/checks/performance/confusion_matrix_report.py b/deepchecks/checks/performance/confusion_matrix_report.py\n--- a/deepchecks/checks/performance/confusion_matrix_report.py\n+++ b/deepchecks/checks/performance/confusion_matrix_report.py\n@@ -9,11 +9,10 @@\n # ----------------------------------------------------------------------------\n #\n \"\"\"The confusion_matrix_report check module.\"\"\"\n-import numpy as np\n import sklearn\n from sklearn.base import BaseEstimator\n \n-import plotly.figure_factory as ff\n+import plotly.express as px\n from deepchecks import CheckResult, Dataset\n from deepchecks.base.check import SingleDatasetBaseCheck\n from deepchecks.utils.metrics import ModelType, task_type_validation\n@@ -49,15 +48,12 @@\n         ds_x = dataset.data[dataset.features]\n         ds_y = dataset.data[label]\n         y_pred = model.predict(ds_x)\n-\n         confusion_matrix = sklearn.metrics.confusion_matrix(ds_y, y_pred)\n \n-        labels = [str(val) for val in np.unique(ds_y)]\n-        fig = ff.create_annotated_heatmap(confusion_matrix, x=labels, y=labels, colorscale='Viridis')\n+        # Figure\n+        fig = px.imshow(confusion_matrix, x=dataset.classes, y=dataset.classes, text_auto=True)\n         fig.update_layout(width=600, height=600)\n-        fig.update_xaxes(title='Predicted Value')\n-        fig.update_yaxes(title='True value', autorange='reversed')\n-        fig['data'][0]['showscale'] = True\n-        fig['layout']['xaxis']['side'] = 'bottom'\n+        fig.update_xaxes(title='Predicted Value', type='category')\n+        fig.update_yaxes(title='True value', type='category')\n \n         return CheckResult(confusion_matrix, display=fig)\n", "issue": "BUG: confusion matrix chart displays wrong output\nTo reproduce:  https://www.kaggle.com/itay94/notebook05f499eb19\r\n\r\n![image](https://user-images.githubusercontent.com/20860465/147875903-9701bdc8-a094-4fb5-807b-d99e66befa37.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\"\"\"The confusion_matrix_report check module.\"\"\"\nimport numpy as np\nimport sklearn\nfrom sklearn.base import BaseEstimator\n\nimport plotly.figure_factory as ff\nfrom deepchecks import CheckResult, Dataset\nfrom deepchecks.base.check import SingleDatasetBaseCheck\nfrom deepchecks.utils.metrics import ModelType, task_type_validation\n\n\n__all__ = ['ConfusionMatrixReport']\n\n\nclass ConfusionMatrixReport(SingleDatasetBaseCheck):\n    \"\"\"Calculate the confusion matrix of the model on the given dataset.\"\"\"\n\n    def run(self, dataset: Dataset, model: BaseEstimator) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            model (BaseEstimator): A scikit-learn-compatible fitted estimator instance\n            dataset: a Dataset object\n\n        Returns:\n            CheckResult: value is numpy array of the confusion matrix, displays the confusion matrix\n\n        Raises:\n            DeepchecksValueError: If the object is not a Dataset instance with a label\n        \"\"\"\n        return self._confusion_matrix_report(dataset, model)\n\n    def _confusion_matrix_report(self, dataset: Dataset, model):\n        Dataset.validate_dataset(dataset)\n        dataset.validate_label()\n        task_type_validation(model, dataset, [ModelType.MULTICLASS, ModelType.BINARY])\n\n        label = dataset.label_name\n        ds_x = dataset.data[dataset.features]\n        ds_y = dataset.data[label]\n        y_pred = model.predict(ds_x)\n\n        confusion_matrix = sklearn.metrics.confusion_matrix(ds_y, y_pred)\n\n        labels = [str(val) for val in np.unique(ds_y)]\n        fig = ff.create_annotated_heatmap(confusion_matrix, x=labels, y=labels, colorscale='Viridis')\n        fig.update_layout(width=600, height=600)\n        fig.update_xaxes(title='Predicted Value')\n        fig.update_yaxes(title='True value', autorange='reversed')\n        fig['data'][0]['showscale'] = True\n        fig['layout']['xaxis']['side'] = 'bottom'\n\n        return CheckResult(confusion_matrix, display=fig)\n", "path": "deepchecks/checks/performance/confusion_matrix_report.py"}], "after_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\"\"\"The confusion_matrix_report check module.\"\"\"\nimport sklearn\nfrom sklearn.base import BaseEstimator\n\nimport plotly.express as px\nfrom deepchecks import CheckResult, Dataset\nfrom deepchecks.base.check import SingleDatasetBaseCheck\nfrom deepchecks.utils.metrics import ModelType, task_type_validation\n\n\n__all__ = ['ConfusionMatrixReport']\n\n\nclass ConfusionMatrixReport(SingleDatasetBaseCheck):\n    \"\"\"Calculate the confusion matrix of the model on the given dataset.\"\"\"\n\n    def run(self, dataset: Dataset, model: BaseEstimator) -> CheckResult:\n        \"\"\"Run check.\n\n        Args:\n            model (BaseEstimator): A scikit-learn-compatible fitted estimator instance\n            dataset: a Dataset object\n\n        Returns:\n            CheckResult: value is numpy array of the confusion matrix, displays the confusion matrix\n\n        Raises:\n            DeepchecksValueError: If the object is not a Dataset instance with a label\n        \"\"\"\n        return self._confusion_matrix_report(dataset, model)\n\n    def _confusion_matrix_report(self, dataset: Dataset, model):\n        Dataset.validate_dataset(dataset)\n        dataset.validate_label()\n        task_type_validation(model, dataset, [ModelType.MULTICLASS, ModelType.BINARY])\n\n        label = dataset.label_name\n        ds_x = dataset.data[dataset.features]\n        ds_y = dataset.data[label]\n        y_pred = model.predict(ds_x)\n        confusion_matrix = sklearn.metrics.confusion_matrix(ds_y, y_pred)\n\n        # Figure\n        fig = px.imshow(confusion_matrix, x=dataset.classes, y=dataset.classes, text_auto=True)\n        fig.update_layout(width=600, height=600)\n        fig.update_xaxes(title='Predicted Value', type='category')\n        fig.update_yaxes(title='True value', type='category')\n\n        return CheckResult(confusion_matrix, display=fig)\n", "path": "deepchecks/checks/performance/confusion_matrix_report.py"}]}