prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  [BUG] ShapeletTransformClassifier numba error when dtype is not float64
  **Describe the bug**
  Seems that when using `ShapeletTransformClassifier` there is some Numba accelerated functions that break if the data in the input data frame are of type `int32`.
  
  **To Reproduce**
  MRE as below:
  
  ```python
  import warnings
  warnings.simplefilter('ignore', category=FutureWarning)
  
  import numpy as np
  import pandas as pd
  
  from sklearn.model_selection import train_test_split
  
  from sktime.classification.shapelet_based import ShapeletTransformClassifier
  from sktime.contrib.vector_classifiers._rotation_forest import RotationForest
  
  # make fake data
  data = pd.DataFrame(np.random.random((5000, 250))).astype(np.float32)
  
  # reshape to input into Shapelet Classifier
  data4train = data.apply(lambda row: pd.Series({
    'time-series': pd.Series(row.values)
  }), axis=1)
  
  # make targets
  targets = pd.Series(2500 * [1] + 2500 * [0])
  
  # train test split
  X_train, X_test, y_train, y_test = train_test_split(
    data4train, targets, test_size=0.7, random_state=42
  )
  
  # train
  clf = ShapeletTransformClassifier(
      estimator=RotationForest(n_estimators=3),
      n_shapelet_samples=500,
      max_shapelets=20,
      batch_size=100,
  )
  
  clf.fit(X_train, y_train)
  ```
  
  **Expected behavior**
  will not throw an error, and also enforce conversion to float32 or float64 within the classifier?
  **Additional context**
  removing conversion to `float32` (hence `dtype == float64`) will make the code running without issues.
  
  **Versions**
  numba 0.55.1
  sklearn 0.24.1
  sktime 0.11.0
  pandas 1.4.2
  python 3.8.10
  
  **Stacktrace output**
  ```bash
  TypingError: Failed in nopython mode pipeline (step: nopython frontend)
  Cannot unify array(float64, 1d, C) and array(float32, 1d, C) for 'X_n.2', defined at /path_to_mypython/python/lib/python3.8/site-packages/sktime/utils/numba/general.py (39)
  
  File "../python/lib/python3.8/site-packages/sktime/utils/numba/general.py", line 39:
  def z_normalise_series(X):
      <source elided>
  
      return X_n
  ```
  
  </issue>
  <code>
  [start of sktime/utils/numba/general.py]
  1 # -*- coding: utf-8 -*-
  2 """General numba utilities."""
  3 
  4 import numpy as np
  5 from numba import njit
  6 
  7 
  8 @njit(fastmath=True, cache=True)
  9 def unique_count(X):
  10     """Numba unique count function for a 1D array."""
  11     if len(X) > 0:
  12         X = np.sort(X)
  13         unique = np.zeros(len(X))
  14         unique[0] = X[0]
  15         counts = np.zeros(len(X), dtype=np.int_)
  16         counts[0] = 1
  17         unique_count = 0
  18 
  19         for i in X[1:]:
  20             if i != unique[unique_count]:
  21                 unique_count += 1
  22                 unique[unique_count] = i
  23                 counts[unique_count] = 1
  24             else:
  25                 counts[unique_count] += 1
  26         return unique[: unique_count + 1], counts[: unique_count + 1]
  27     return None, np.zeros(0, dtype=np.int_)
  28 
  29 
  30 @njit(fastmath=True, cache=True)
  31 def z_normalise_series(X):
  32     """Numba z-normalisation function for a single time series."""
  33     std = np.std(X)
  34     if std > 0:
  35         X_n = (X - np.mean(X)) / std
  36     else:
  37         X_n = np.zeros(len(X))
  38 
  39     return X_n
  40
  [end of sktime/utils/numba/general.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/sktime/utils/numba/general.py b/sktime/utils/numba/general.py
  --- a/sktime/utils/numba/general.py
  +++ b/sktime/utils/numba/general.py
  @@ -34,6 +34,5 @@
       if std > 0:
           X_n = (X - np.mean(X)) / std
       else:
  -        X_n = np.zeros(len(X))
  -
  +        X_n = X - np.mean(X)
       return X_n
  
verification_info: {"golden_diff": "diff --git a/sktime/utils/numba/general.py b/sktime/utils/numba/general.py\n--- a/sktime/utils/numba/general.py\n+++ b/sktime/utils/numba/general.py\n@@ -34,6 +34,5 @@\n     if std > 0:\n         X_n = (X - np.mean(X)) / std\n     else:\n-        X_n = np.zeros(len(X))\n-\n+        X_n = X - np.mean(X)\n     return X_n\n", "issue": "[BUG] ShapeletTransformClassifier numba error when dtype is not float64\n**Describe the bug**\r\nSeems that when using `ShapeletTransformClassifier` there is some Numba accelerated functions that break if the data in the input data frame are of type `int32`.\r\n\r\n**To Reproduce**\r\nMRE as below:\r\n\r\n```python\r\nimport warnings\r\nwarnings.simplefilter('ignore', category=FutureWarning)\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nfrom sklearn.model_selection import train_test_split\r\n\r\nfrom sktime.classification.shapelet_based import ShapeletTransformClassifier\r\nfrom sktime.contrib.vector_classifiers._rotation_forest import RotationForest\r\n\r\n# make fake data\r\ndata = pd.DataFrame(np.random.random((5000, 250))).astype(np.float32)\r\n\r\n# reshape to input into Shapelet Classifier\r\ndata4train = data.apply(lambda row: pd.Series({\r\n  'time-series': pd.Series(row.values)\r\n}), axis=1)\r\n\r\n# make targets\r\ntargets = pd.Series(2500 * [1] + 2500 * [0])\r\n\r\n# train test split\r\nX_train, X_test, y_train, y_test = train_test_split(\r\n  data4train, targets, test_size=0.7, random_state=42\r\n)\r\n\r\n# train\r\nclf = ShapeletTransformClassifier(\r\n    estimator=RotationForest(n_estimators=3),\r\n    n_shapelet_samples=500,\r\n    max_shapelets=20,\r\n    batch_size=100,\r\n)\r\n\r\nclf.fit(X_train, y_train)\r\n```\r\n\r\n**Expected behavior**\r\nwill not throw an error, and also enforce conversion to float32 or float64 within the classifier?\r\n**Additional context**\r\nremoving conversion to `float32` (hence `dtype == float64`) will make the code running without issues.\r\n\r\n**Versions**\r\nnumba 0.55.1\r\nsklearn 0.24.1\r\nsktime 0.11.0\r\npandas 1.4.2\r\npython 3.8.10\r\n\r\n**Stacktrace output**\r\n```bash\r\nTypingError: Failed in nopython mode pipeline (step: nopython frontend)\r\nCannot unify array(float64, 1d, C) and array(float32, 1d, C) for 'X_n.2', defined at /path_to_mypython/python/lib/python3.8/site-packages/sktime/utils/numba/general.py (39)\r\n\r\nFile \"../python/lib/python3.8/site-packages/sktime/utils/numba/general.py\", line 39:\r\ndef z_normalise_series(X):\r\n    <source elided>\r\n\r\n    return X_n\r\n```\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"General numba utilities.\"\"\"\n\nimport numpy as np\nfrom numba import njit\n\n\n@njit(fastmath=True, cache=True)\ndef unique_count(X):\n    \"\"\"Numba unique count function for a 1D array.\"\"\"\n    if len(X) > 0:\n        X = np.sort(X)\n        unique = np.zeros(len(X))\n        unique[0] = X[0]\n        counts = np.zeros(len(X), dtype=np.int_)\n        counts[0] = 1\n        unique_count = 0\n\n        for i in X[1:]:\n            if i != unique[unique_count]:\n                unique_count += 1\n                unique[unique_count] = i\n                counts[unique_count] = 1\n            else:\n                counts[unique_count] += 1\n        return unique[: unique_count + 1], counts[: unique_count + 1]\n    return None, np.zeros(0, dtype=np.int_)\n\n\n@njit(fastmath=True, cache=True)\ndef z_normalise_series(X):\n    \"\"\"Numba z-normalisation function for a single time series.\"\"\"\n    std = np.std(X)\n    if std > 0:\n        X_n = (X - np.mean(X)) / std\n    else:\n        X_n = np.zeros(len(X))\n\n    return X_n\n", "path": "sktime/utils/numba/general.py"}]}