class_docstr: Slope-by-segment transformation.
  
  Class to perform the Slope transformation on a time series
  dataframe. It splits a time series into num_intervals segments.
  Then within each segment, it performs a total least
  squares regression to extract the gradient of the segment.
  
  Parameters
  ----------
  num_intervals : int, number of approx equal segments
                  to split the time series into.
class_docstr_tok: ["Slope-by-segment","transformation",".","Class","to","perform","the","Slope","transformation","on","a","time","series","dataframe",".","It","splits","a","time","series","into","num_intervals","segments",".","Then","within","each","segment",",","it","performs","a","total","least","squares","regression","to","extract","the","gradient","of","the","segment",".","Parameters","--","--","--","--","--","num_intervals",":","int",",","number","of","approx","equal","segments","to","split","the","time","series","into","."]
docstr: Get gradients of lines.
  
  Function to get the gradients of the line of best fits
  given a time series.
  
  Parameters
  ----------
  X : a numpy array of shape = [time_series_length]
  
  Returns
  -------
  gradients : a numpy array of shape = [num_intervals].
              It contains the gradients of the line of best fit
              for each interval in a time series.
docstr_tok: ["Get","gradients","of","lines",".","Function","to","get","the","gradients","of","the","line","of","best","fits","given","a","time","series",".","Parameters","--","--","--","--","--","X",":","a","numpy","array","of","shape","=","[","time_series_length","]","Returns","--","--","--","-","gradients",":","a","numpy","array","of","shape","=","[","num_intervals","]",".","It","contains","the","gradients","of","the","line","of","best","fit","for","each","interval","in","a","time","series","."]
code: def _get_gradients_of_lines(self, X):
      """Get gradients of lines.
  
      Function to get the gradients of the line of best fits
      given a time series.
  
      Parameters
      ----------
      X : a numpy array of shape = [time_series_length]
  
      Returns
      -------
      gradients : a numpy array of shape = [num_intervals].
                  It contains the gradients of the line of best fit
                  for each interval in a time series.
      """
      # Firstly, split the time series into approx equal length intervals
      splitTimeSeries = self._split_time_series(X)
      gradients = []
  
      for x in range(len(splitTimeSeries)):
          gradients.append(self._get_gradient(splitTimeSeries[x]))
  
      return gradients
  
file_path: sktime/sktime/transformations/panel/slope.py
imports: import math
  import statistics
  import numpy
  import pandas
  from sktime.datatypes import convert
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 3 for calling the SlopeTransformer obj's underlying member method code with example usage: obj._get_gradients_of_lines(X) and returns: gradients