class_docstr: HOG1D transform.
  
  This class is to calculate the HOG1D transform of a
  dataframe of time series data. Works by splitting
  the time series num_intervals times, and calculate
  a histogram of gradients within each interval.
  
  Parameters
  ----------
      num_intervals   : int, length of interval.
      num_bins        : int, num bins in the histogram.
      scaling_factor  : float, a constant that is multiplied
                        to modify the distribution.
class_docstr_tok: ["HOG1D","transform",".","This","class","is","to","calculate","the","HOG1D","transform","of","a","dataframe","of","time","series","data",".","Works","by","splitting","the","time","series","num_intervals","times",",","and","calculate","a","histogram","of","gradients","within","each","interval",".","Parameters","--","--","--","--","--","num_intervals",":","int",",","length","of","interval",".","num_bins",":","int",",","num","bins","in","the","histogram",".","scaling_factor",":","float",",","a","constant","that","is","multiplied","to","modify","the","distribution","."]
docstr: Get the HOG1D given a portion of a time series.
  
  X : a numpy array of shape = [interval_size]
  
  Returns
  -------
  histogram : a numpy array of shape = [num_bins].
docstr_tok: ["Get","the","HOG1D","given","a","portion","of","a","time","series",".","X",":","a","numpy","array","of","shape","=","[","interval_size","]","Returns","--","--","--","-","histogram",":","a","numpy","array","of","shape","=","[","num_bins","]","."]
code: def _get_hog1d(self, X):
      """Get the HOG1D given a portion of a time series.
  
      X : a numpy array of shape = [interval_size]
  
      Returns
      -------
      histogram : a numpy array of shape = [num_bins].
      """
      # First step is to pad the portion on both ends once.
      gradients = [0.0] * (len(X))
      X = np.pad(X, 1, mode="edge")
      histogram = [0.0] * self.num_bins
  
      # Calculate the gradients of each element
      for i in range(1, len(X) - 1):
          gradients[(i - 1)] = (
              self.scaling_factor * 0.5 * (X[(i + 1)] - X[(i - 1)])
          )
  
      # Calculate the orientations
      orients = [math.degrees(math.atan(x)) for x in gradients]
  
      # Calculate the boundaries of the histogram
      hisBoundaries = [
          -90 + (180 / self.num_bins) + ((180 / self.num_bins) * x)
          for x in range(self.num_bins)
      ]
  
      # Construct the histogram
      for x in range(len(orients)):
          orientToAdd = orients[x]
          for y in range(len(hisBoundaries)):
              if orientToAdd <= hisBoundaries[y]:
                  histogram[y] += 1.0
                  break
  
      return histogram
  
file_path: sktime/sktime/transformations/panel/hog1d.py
imports: import math
  import numbers
  import numpy
  import pandas
  from sktime.datatypes._panel._convert import from_nested_to_2d_array
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 4 for calling the HOG1DTransformer obj's underlying member method code with example usage: obj._get_hog1d(X) and returns: histogram