class_docstr: Weighted dynamic time warping (WDTW) distance between two time series.
  
  WDTW uses DTW with a weighted pairwise distance matrix rather than a window. When
  creating the distance matrix :math:'M', a weight penalty  :math:'w_{|i-j|}' for a
  warping distance of :math:'|i-j|' is applied, so that for series
  :math:'a = <a_1, ..., a_m>' and :math:'b=<b_1,...,b_m>',
  .. math:: M_{i,j}=  w(|i-j|) (a_i-b_j)^2.
  A logistic weight function, proposed in [1] is used, so that a warping of :math:'x'
  places imposes a weighting of
  .. math:: w(x)=\frac{w_{max}}{1+e^{-g(x-m/2)}},
  where :math:'w_{max}' is an upper bound on the weight (set to 1), :math:'m' is
  the series length and :math:'g' is a parameter that controls the penalty level
  for larger warpings. The greater :math:'g' is, the greater the penalty for warping.
  Once :math:'M' is found, standard dynamic time warping is applied.
  
  WDTW is set up so you can use it with a bounding box in addition to the weight
  function is so desired. This is for consistency with the other distance functions.
  
  References
  ----------
  .. [1] Jeong, Y., Jeong, M., Omitaomu, O.: Weighted dynamic time warping for time
  series classification. Pattern Recognition 44, 2231–2240 (2011)
docstr: Create a no_python compiled wdtw distance callable.
  
  Parameters
  ----------
  x: np.ndarray (2d array of shape (d,m1)).
      First time series.
  y: np.ndarray (2d array of shape (d,m2)).
      Second time series.
  window: float, defaults = None
      Integer that is the radius of the sakoe chiba window (if using Sakoe-Chiba
      lower bounding). Must be between 0 and 1.
  itakura_max_slope: float, defaults = None
      Gradient of the slope for itakura parallelogram (if using Itakura
      Parallelogram lower bounding). Must be between 0 and 1.
  bounding_matrix: np.ndarray (2d array of shape (m1,m2)), defaults = None
      Custom bounding matrix to use. If defined then other lower_bounding params
      are ignored. The matrix should be structure so that indexes considered in
      bound should be the value 0. and indexes outside the bounding matrix should
      be infinity.
  g: float, defaults = 0.
      Constant that controls the curvature (slope) of the function; that is, g
      controls the level of penalisation for the points with larger phase
      difference.
  kwargs: Any
      Extra kwargs.
  
  
  Returns
  -------
  Callable[[np.ndarray, np.ndarray], float]
      No_python compiled wdtw distance callable.
  
  Raises
  ------
  ValueError
      If the input time series are not numpy array.
      If the input time series do not have exactly 2 dimensions.
      If the sakoe_chiba_window_radius is not an integer.
      If the itakura_max_slope is not a float or int.
      If the value of g is not a float
docstr_tok: ["Create","a","no_python","compiled","wdtw","distance","callable",".","Parameters","--","--","--","--","--","x",":","np.ndarray","(","2d","array","of","shape","(","d",",","m1",")",")",".","First","time","series",".","y",":","np.ndarray","(","2d","array","of","shape","(","d",",","m2",")",")",".","Second","time","series",".","window",":","float",",","defaults","=","None","Integer","that","is","the","radius","of","the","sakoe","chiba","window","(","if","using","Sakoe-Chiba","lower","bounding",")",".","Must","be","between","0","and","1.","itakura_max_slope",":","float",",","defaults","=","None","Gradient","of","the","slope","for","itakura","parallelogram","(","if","using","Itakura","Parallelogram","lower","bounding",")",".","Must","be","between","0","and","1.","bounding_matrix",":","np.ndarray","(","2d","array","of","shape","(","m1",",","m2",")",")",",","defaults","=","None","Custom","bounding","matrix","to","use",".","If","defined","then","other","lower_bounding","params","are","ignored",".","The","matrix","should","be","structure","so","that","indexes","considered","in","bound","should","be","the","value","0.","and","indexes","outside","the","bounding","matrix","should","be","infinity",".","g",":","float",",","defaults","=","0",".","Constant","that","controls","the","curvature","(","slope",")","of","the","function",";","that","is",",","g","controls","the","level","of","penalisation","for","the","points","with","larger","phase","difference",".","kwargs",":","Any","Extra","kwargs",".","Returns","--","--","--","-","Callable","[","[","np.ndarray",",","np.ndarray","]",",","float","]","No_python","compiled","wdtw","distance","callable",".","Raises","--","--","--","ValueError","If","the","input","time","series","are","not","numpy","array",".","If","the","input","time","series","do","not","have","exactly","2","dimensions",".","If","the","sakoe_chiba_window_radius","is","not","an","integer",".","If","the","itakura_max_slope","is","not","a","float","or","int",".","If","the","value","of","g","is","not","a","float"]
code: def _distance_factory(
      self,
      x: np.ndarray,
      y: np.ndarray,
      window: int = None,
      itakura_max_slope: float = None,
      bounding_matrix: np.ndarray = None,
      g: float = 0.05,
      **kwargs: Any,
  ) -> DistanceCallable:
      """Create a no_python compiled wdtw distance callable.
  
      Parameters
      ----------
      x: np.ndarray (2d array of shape (d,m1)).
          First time series.
      y: np.ndarray (2d array of shape (d,m2)).
          Second time series.
      window: float, defaults = None
          Integer that is the radius of the sakoe chiba window (if using Sakoe-Chiba
          lower bounding). Must be between 0 and 1.
      itakura_max_slope: float, defaults = None
          Gradient of the slope for itakura parallelogram (if using Itakura
          Parallelogram lower bounding). Must be between 0 and 1.
      bounding_matrix: np.ndarray (2d array of shape (m1,m2)), defaults = None
          Custom bounding matrix to use. If defined then other lower_bounding params
          are ignored. The matrix should be structure so that indexes considered in
          bound should be the value 0. and indexes outside the bounding matrix should
          be infinity.
      g: float, defaults = 0.
          Constant that controls the curvature (slope) of the function; that is, g
          controls the level of penalisation for the points with larger phase
          difference.
      kwargs: Any
          Extra kwargs.
  
  
      Returns
      -------
      Callable[[np.ndarray, np.ndarray], float]
          No_python compiled wdtw distance callable.
  
      Raises
      ------
      ValueError
          If the input time series are not numpy array.
          If the input time series do not have exactly 2 dimensions.
          If the sakoe_chiba_window_radius is not an integer.
          If the itakura_max_slope is not a float or int.
          If the value of g is not a float
      """
      from sktime.distances._wdtw_numba import _weighted_cost_matrix
      from sktime.distances.lower_bounding import (
          resolve_bounding_matrix,
      )
      from sktime.utils.numba.njit import njit
  
      _bounding_matrix = resolve_bounding_matrix(
          x, y, window, itakura_max_slope, bounding_matrix
      )
  
      if not isinstance(g, float):
          raise ValueError(
              f"The value of g must be a float. The current value is {g}"
          )
  
      @njit(cache=True)
      def numba_wdtw_distance(
          _x: np.ndarray,
          _y: np.ndarray,
      ) -> float:
          cost_matrix = _weighted_cost_matrix(
              _x, _y, _bounding_matrix, g
          )
          return cost_matrix[-1, -1]
  
      return numba_wdtw_distance
  
imports: from typing import Any, List, Tuple
  import numpy
  from sktime.distances.base import DistanceAlignmentPathCallable, DistanceCallable, NumbaDistance
label_desc: Use image node_id 2 for calling the _WdtwDistance obj's underlying member method code with example usage: obj._distance_factory(x, y, window, itakura_max_slope, bounding_matrix, g) and returns: numba_wdtw_distance, cost_matrix