class_docstr: Kernel function obtained from a distance function.
  
  Formal details (for real valued objects, mixed typed rows in analogy):
  Let :math:`d: \mathbb{R}^D \times \mathbb{R}^D\rightarrow \mathbb{R}`
  be the pairwise function in `dist`, when applied to `D`-vectors.
  If `dist_diag=None`, then `KernelFromDist(dist)` corresponds to the kernel function
  :math:`k(x, y) := d(x, x)^2 + d(y, y)^2 - 0.5 \cdot d(x, y)^2`.
  If `dist_diag` is provided,
  and corresponds to a function :math:`f:\mathbb{R}^D \rightarrow \mathbb{R}`,
  then `KernelFromDist(dist)` corresponds to the kernel function
  :math:`k(x, y) := f(x, x)^2 + f(y, y)^2 - 0.5 \cdot d(x, y)^2`.
  
  It should be noted that :math:`k` is, in general, not positive semi-definite.
  
  Parameters
  ----------
  dist : pairwise transformer of BasePairwiseTransformer scitype, or
      callable np.ndarray (n_samples, nd) x (n_samples, nd) -> (n_samples x n_samples)
  dist_diag : pairwise transformer of BasePairwiseTransformer scitype, or
      series-to-panel transformer of Basetransformer scitype, or
      callable np.ndarray (n_samples, nd) -> (n_samples, )
class_docstr_tok: ["Kernel","function","obtained","from","a","distance","function",".","Formal","details","(","for","real","valued","objects",",","mixed","typed","rows","in","analogy",")",":","Let",":","math",":","`","d",":","\\mathbb","{","R","}","^D","\\times","\\mathbb","{","R","}","^D\\rightarrow","\\mathbb","{","R","}","`","be","the","pairwise","function","in","`","dist","`",",","when","applied","to","`","D","`","-vectors",".","If","`","dist_diag=None","`",",","then","`","KernelFromDist","(","dist",")","`","corresponds","to","the","kernel","function",":","math",":","`","k","(","x",",","y",")",":","=","d","(","x",",","x",")","^2","+","d","(","y",",","y",")","^2","-","0.5","\\cdot","d","(","x",",","y",")","^2","`",".","If","`","dist_diag","`","is","provided",",","and","corresponds","to","a","function",":","math",":","`","f",":","\\mathbb","{","R","}","^D","\\rightarrow","\\mathbb","{","R","}","`",",","then","`","KernelFromDist","(","dist",")","`","corresponds","to","the","kernel","function",":","math",":","`","k","(","x",",","y",")",":","=","f","(","x",",","x",")","^2","+","f","(","y",",","y",")","^2","-","0.5","\\cdot","d","(","x",",","y",")","^2","`",".","It","should","be","noted","that",":","math",":","`","k","`","is",",","in","general",",","not","positive","semi-definite",".","Parameters","--","--","--","--","--","dist",":","pairwise","transformer","of","BasePairwiseTransformer","scitype",",","or","callable","np.ndarray","(","n_samples",",","nd",")","x","(","n_samples",",","nd",")","-",">","(","n_samples","x","n_samples",")","dist_diag",":","pairwise","transformer","of","BasePairwiseTransformer","scitype",",","or","series-to-panel","transformer","of","Basetransformer","scitype",",","or","callable","np.ndarray","(","n_samples",",","nd",")","-",">","(","n_samples",",",")"]
code: def __init__(self, dist, dist_diag=None):
      self.dist = dist
      self.dist_diag = dist_diag
  
      super().__init__()
  
      # set property tags based on tags of components
      missing = True
      multi = True
      unequal = True
      if isinstance(dist, BasePairwiseTransformerPanel):
          missing = missing and dist.get_tag(
              "capability:missing_values"
          )
          multi = multi and dist.get_tag("capability:multivariate")
          unequal = unequal and dist.get_tag(
              "capability:unequal_length"
          )
  
      tag_dict = {
          "capability:missing_values": missing,
          "capability:multivariate": multi,
          "capability:unequal_length": unequal,
      }
  
      self.set_tags(**tag_dict)
  
file_path: sktime/sktime/dists_kernels/dist_to_kern.py
imports: import numpy
  from sktime.dists_kernels.base import BasePairwiseTransformerPanel
label_desc: Use image node_id 1 to create a new KernelFromDist object from inherited base classes: BasePairwiseTransformerPanel with example: obj = KernelFromDist(dist, dist_diag)