code: def sklearn_segmentation(self, x, cluster_fn):
          
          peaks, prominences = get_signal_peaks_and_prominences(x)
          
          # sklearn fix: reshape to (-1, 1)
          sklearn_idx = cluster_fn.fit_predict(prominences.reshape(-1, 1))
          
          return peaks, prominences, sklearn_idx
docs: Divide a univariate time-series, data_frame, into states contiguous segments, using sk-learn clustering algorithms on the peak prominences of the data.
          
              :param x: The time series to assess freeze of gait on. This could be x, y, z or mag_sum_acc.
              :type x: pandas.Series
              :param cluster_fn: Any unsupervised learning algorithm from the sklearn library. It needs to have the `fit_predict` method.
              :param cluster_fn: sklearn.aglorithm
              :return peaks: The peaks in our data_frame.
              :rtype peaks: list
              :return prominences: Peaks prominences.
              :rtype prominences: list
              :return sklearn_idx: The indices of the segments.
              :rtype sklearn_idx: list