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: Transform X and return a transformed version.
  
  private _transform containing core logic, called from transform
  
  Parameters
  ----------
  X : nested pandas DataFrame of shape [n_instances, n_features]
      each cell of X must contain pandas.Series
      Data to fit transform to
  y : ignored argument for interface compatibility
      Additional data, e.g., labels for transformation
  
  Returns
  -------
  Xt : nested pandas DataFrame of shape [n_instances, n_features]
      each cell of Xt contains pandas.Series
      transformed version of X
docstr_tok: ["Transform","X","and","return","a","transformed","version",".","private","_transform","containing","core","logic",",","called","from","transform","Parameters","--","--","--","--","--","X",":","nested","pandas","DataFrame","of","shape","[","n_instances",",","n_features","]","each","cell","of","X","must","contain","pandas.Series","Data","to","fit","transform","to","y",":","ignored","argument","for","interface","compatibility","Additional","data",",","e.g.",",","labels","for","transformation","Returns","--","--","--","-","Xt",":","nested","pandas","DataFrame","of","shape","[","n_instances",",","n_features","]","each","cell","of","Xt","contains","pandas.Series","transformed","version","of","X"]
code: def _transform(self, X, y=None):
      """Transform X and return a transformed version.
  
      private _transform containing core logic, called from transform
  
      Parameters
      ----------
      X : nested pandas DataFrame of shape [n_instances, n_features]
          each cell of X must contain pandas.Series
          Data to fit transform to
      y : ignored argument for interface compatibility
          Additional data, e.g., labels for transformation
  
      Returns
      -------
      Xt : nested pandas DataFrame of shape [n_instances, n_features]
          each cell of Xt contains pandas.Series
          transformed version of X
      """
      # Get information about the dataframe
      num_insts = X.shape[0]
      col_names = X.columns
      num_atts = len(X.iloc[0, 0])
  
      # Check the parameters are appropriate
      self._check_parameters(num_atts)
  
      df = pd.DataFrame()
  
      for x in col_names:
          # Convert one of the columns in the dataframe to a numpy array
          arr = from_nested_to_2d_array(
              pd.DataFrame(X[x]), return_numpy=True
          )
  
          # Get the HOG1Ds of each time series
          transformedData = []
          for y in range(num_insts):
              inst = self._calculate_hog1ds(arr[y])
              transformedData.append(inst)
  
          # Convert to numpy array
          transformedData = np.asarray(transformedData)
  
          # Add it to the dataframe
          colToAdd = []
          for i in range(len(transformedData)):
              inst = transformedData[i]
              colToAdd.append(pd.Series(inst))
  
          df[x] = colToAdd
  
      return df
  
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 2 for calling the HOG1DTransformer obj's underlying member method code with example usage: obj._transform(X, y) and returns: df