prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [model:regressor] AttributeError: 'IsotonicRegressionCalibrator' object has no attribute 'n_features_in_'
  https://community-tc.services.mozilla.com/tasks/HncpjvKKRcSnxL_GJ8PV9A/runs/0/logs/public/logs/live.log
  ```
  Traceback (most recent call last):
    File "/usr/local/bin/bugbug-train", line 8, in <module>
      sys.exit(main())
    File "/usr/local/lib/python3.10/site-packages/scripts/trainer.py", line 141, in main
      retriever.go(args)
    File "/usr/local/lib/python3.10/site-packages/scripts/trainer.py", line 41, in go
      metrics = model_obj.train(limit=args.limit)
    File "/usr/local/lib/python3.10/site-packages/bugbug/model.py", line 418, in train
      logger.info("Number of features: %d", self.clf.steps[-1][1].n_features_in_)
  AttributeError: 'IsotonicRegressionCalibrator' object has no attribute 'n_features_in_'
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `bugbug/model_calibration.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 # This Source Code Form is subject to the terms of the Mozilla Public
  3 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
  4 # You can obtain one at http://mozilla.org/MPL/2.0/.
  5 
  6 from sklearn.base import BaseEstimator, ClassifierMixin
  7 from sklearn.calibration import CalibratedClassifierCV
  8 from sklearn.model_selection import train_test_split
  9 
  10 
  11 class IsotonicRegressionCalibrator(BaseEstimator, ClassifierMixin):
  12     def __init__(self, base_clf):
  13         self.base_clf = base_clf
  14         self.calibrated_clf = CalibratedClassifierCV(
  15             base_clf, cv="prefit", method="isotonic"
  16         )
  17 
  18     def fit(self, X_train, y_train):
  19         X_train, X_val, y_train, y_val = train_test_split(
  20             X_train, y_train, test_size=0.2, random_state=42
  21         )
  22         self.base_clf.fit(X_train, y_train)
  23         self.calibrated_clf.fit(X_val, y_val)
  24 
  25     def predict(self, X):
  26         return self.calibrated_clf.predict(X)
  27 
  28     def predict_proba(self, X):
  29         return self.calibrated_clf.predict_proba(X)
  30
  ```
  --- 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/bugbug/model_calibration.py b/bugbug/model_calibration.py
  --- a/bugbug/model_calibration.py
  +++ b/bugbug/model_calibration.py
  @@ -27,3 +27,7 @@
   
       def predict_proba(self, X):
           return self.calibrated_clf.predict_proba(X)
  +
  +    @property
  +    def n_features_in_(self):
  +        return self.base_clf.n_features_in_
  
verification_info: {"golden_diff": "diff --git a/bugbug/model_calibration.py b/bugbug/model_calibration.py\n--- a/bugbug/model_calibration.py\n+++ b/bugbug/model_calibration.py\n@@ -27,3 +27,7 @@\n \n     def predict_proba(self, X):\n         return self.calibrated_clf.predict_proba(X)\n+\n+    @property\n+    def n_features_in_(self):\n+        return self.base_clf.n_features_in_\n", "issue": "[model:regressor] AttributeError: 'IsotonicRegressionCalibrator' object has no attribute 'n_features_in_'\nhttps://community-tc.services.mozilla.com/tasks/HncpjvKKRcSnxL_GJ8PV9A/runs/0/logs/public/logs/live.log\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/bugbug-train\", line 8, in <module>\r\n    sys.exit(main())\r\n  File \"/usr/local/lib/python3.10/site-packages/scripts/trainer.py\", line 141, in main\r\n    retriever.go(args)\r\n  File \"/usr/local/lib/python3.10/site-packages/scripts/trainer.py\", line 41, in go\r\n    metrics = model_obj.train(limit=args.limit)\r\n  File \"/usr/local/lib/python3.10/site-packages/bugbug/model.py\", line 418, in train\r\n    logger.info(\"Number of features: %d\", self.clf.steps[-1][1].n_features_in_)\r\nAttributeError: 'IsotonicRegressionCalibrator' object has no attribute 'n_features_in_'\r\n```\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.org/MPL/2.0/.\n\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom sklearn.model_selection import train_test_split\n\n\nclass IsotonicRegressionCalibrator(BaseEstimator, ClassifierMixin):\n    def __init__(self, base_clf):\n        self.base_clf = base_clf\n        self.calibrated_clf = CalibratedClassifierCV(\n            base_clf, cv=\"prefit\", method=\"isotonic\"\n        )\n\n    def fit(self, X_train, y_train):\n        X_train, X_val, y_train, y_val = train_test_split(\n            X_train, y_train, test_size=0.2, random_state=42\n        )\n        self.base_clf.fit(X_train, y_train)\n        self.calibrated_clf.fit(X_val, y_val)\n\n    def predict(self, X):\n        return self.calibrated_clf.predict(X)\n\n    def predict_proba(self, X):\n        return self.calibrated_clf.predict_proba(X)\n", "path": "bugbug/model_calibration.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this file,\n# You can obtain one at http://mozilla.org/MPL/2.0/.\n\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom sklearn.model_selection import train_test_split\n\n\nclass IsotonicRegressionCalibrator(BaseEstimator, ClassifierMixin):\n    def __init__(self, base_clf):\n        self.base_clf = base_clf\n        self.calibrated_clf = CalibratedClassifierCV(\n            base_clf, cv=\"prefit\", method=\"isotonic\"\n        )\n\n    def fit(self, X_train, y_train):\n        X_train, X_val, y_train, y_val = train_test_split(\n            X_train, y_train, test_size=0.2, random_state=42\n        )\n        self.base_clf.fit(X_train, y_train)\n        self.calibrated_clf.fit(X_val, y_val)\n\n    def predict(self, X):\n        return self.calibrated_clf.predict(X)\n\n    def predict_proba(self, X):\n        return self.calibrated_clf.predict_proba(X)\n\n    @property\n    def n_features_in_(self):\n        return self.base_clf.n_features_in_\n", "path": "bugbug/model_calibration.py"}]}