class_docstr: Heteregeneous Intrinsic Dimensionality Algorithm (Hidalgo) model.
  
  Hidalgo is a robust approach in discriminating regions with
  different local intrinsic dimensionality (topological feature
  measuring complexity). Hidalgo offers unsupervised segmentation
  of high-dimensional data.
  
  Parameters
  ----------
  metric : str, or callable, optional, default="euclidean"
      directly passed to sklearn KNearestNeighbors,
      must be str or callable that can be passed to KNearestNeighbors
      distance used in the nearest neighbors part of the algorithm
  K : int, optional, default=2
      number of manifolds used in algorithm
  zeta : float, optional, default=0.8
      "local homogeneity level" used in the algorithm, see equation (4)
  q : int, optional, default=3
      number of points for local Z interaction, "local homogeneity range"
      see equation (4)
  n_iter : int, optional, default=1000
      number of Gibbs sampling iterations
  n_replicas : int, optional, default=1
      number of random starts to run Gibbs sampling
  burn_in : float, optional, default=0.9
      percentage of Gibbs sampling iterations discarded, "burn-in fraction"
  fixed_Z : bool, optional, default=False
      estimate parameters with fixed z (joint posterior approximation via Gibbs)
      z = (z_1, ..., z_K) is a latent variable introduced, where z_i = k
      indicates point i belongs to manifold K
  use_Potts : bool, optional, default=True
      if using local interaction between z, see equation (4)
  estimate_zeta : bool, optional, default=False
      update zeta in the sampling
  sampling_rate: int, optional, default=10
      rate at which to save samples for each n_iter
  a : np.ArrayLike, optional, default=None
      prior parameters of d, the dimensionality of manifold k
  b : np.ArrayLike, optional, default=None
      prior parameters of d, the dimensionality of manifold k
  c : np.ArrayLike, optional, default=None
      prior parameters of p, the probability that point belongs to manifold k
  f : np.ArrayLike, optional, default=None
      parameters of zeta
  seed : int, optional, default = 1
      generate random numbers with seed
  
  References
  ----------
  Allegra, Michele, et al. "Data segmentation based on the local
  intrinsic dimension." Scientific reports 10.1 (2020): 1-12.
  https://www.nature.com/articles/s41598-020-72222-0
  
  
  Examples
  --------
  >>> from sktime.transformations.series.hidalgo import Hidalgo
  >>> import numpy as np
  >>> np.random.seed(123)
  >>> X = np.random.rand(10,3)
  >>> X[:6, 1:] += 10
  >>> X[6:, 1:] = 0
  >>> model = Hidalgo(K=2, burn_in=0.8, n_iter=100, seed=10)
  >>> fitted_model = model.fit(X)
  >>> Z = fitted_model.transform(X)
  >>> Z.tolist()
  [1, 1, 1, 1, 1, 1, 0, 0, 0, 0]
class_docstr_tok: ["Heteregeneous","Intrinsic","Dimensionality","Algorithm","(","Hidalgo",")","model",".","Hidalgo","is","a","robust","approach","in","discriminating","regions","with","different","local","intrinsic","dimensionality","(","topological","feature","measuring","complexity",")",".","Hidalgo","offers","unsupervised","segmentation","of","high-dimensional","data",".","Parameters","--","--","--","--","--","metric",":","str",",","or","callable",",","optional",",","default=","''","euclidean","''","directly","passed","to","sklearn","KNearestNeighbors",",","must","be","str","or","callable","that","can","be","passed","to","KNearestNeighbors","distance","used","in","the","nearest","neighbors","part","of","the","algorithm","K",":","int",",","optional",",","default=2","number","of","manifolds","used","in","algorithm","zeta",":","float",",","optional",",","default=0.8","``","local","homogeneity","level","''","used","in","the","algorithm",",","see","equation","(","4",")","q",":","int",",","optional",",","default=3","number","of","points","for","local","Z","interaction",",","``","local","homogeneity","range","''","see","equation","(","4",")","n_iter",":","int",",","optional",",","default=1000","number","of","Gibbs","sampling","iterations","n_replicas",":","int",",","optional",",","default=1","number","of","random","starts","to","run","Gibbs","sampling","burn_in",":","float",",","optional",",","default=0.9","percentage","of","Gibbs","sampling","iterations","discarded",",","``","burn-in","fraction","''","fixed_Z",":","bool",",","optional",",","default=False","estimate","parameters","with","fixed","z","(","joint","posterior","approximation","via","Gibbs",")","z","=","(","z_1",",","...",",","z_K",")","is","a","latent","variable","introduced",",","where","z_i","=","k","indicates","point","i","belongs","to","manifold","K","use_Potts",":","bool",",","optional",",","default=True","if","using","local","interaction","between","z",",","see","equation","(","4",")","estimate_zeta",":","bool",",","optional",",","default=False","update","zeta","in","the","sampling","sampling_rate",":","int",",","optional",",","default=10","rate","at","which","to","save","samples","for","each","n_iter","a",":","np.ArrayLike",",","optional",",","default=None","prior","parameters","of","d",",","the","dimensionality","of","manifold","k","b",":","np.ArrayLike",",","optional",",","default=None","prior","parameters","of","d",",","the","dimensionality","of","manifold","k","c",":","np.ArrayLike",",","optional",",","default=None","prior","parameters","of","p",",","the","probability","that","point","belongs","to","manifold","k","f",":","np.ArrayLike",",","optional",",","default=None","parameters","of","zeta","seed",":","int",",","optional",",","default","=","1","generate","random","numbers","with","seed","References","--","--","--","--","--","Allegra",",","Michele",",","et","al",".","``","Data","segmentation","based","on","the","local","intrinsic","dimension",".","''","Scientific","reports","10.1","(","2020",")",":","1-12.","https",":","\/\/www.nature.com\/articles\/s41598-020-72222-0","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.hidalgo","import","Hidalgo",">",">",">","import","numpy","as","np",">",">",">","np.random.seed","(","123",")",">",">",">","X","=","np.random.rand","(","10,3",")",">",">",">","X","[",":6",",","1",":","]","+=","10",">",">",">","X","[","6",":",",","1",":","]","=","0",">",">",">","model","=","Hidalgo","(","K=2",",","burn_in=0.8",",","n_iter=100",",","seed=10",")",">",">",">","fitted_model","=","model.fit","(","X",")",">",">",">","Z","=","fitted_model.transform","(","X",")",">",">",">","Z.tolist","(",")","[","1",",","1",",","1",",","1",",","1",",","1",",","0",",","0",",","0",",","0","]"]
docstr: Neighbourhood information from input data X.
  
  Parameters
  ----------
  X : 2D np.ndarray of shape (N, dim), where dim > 1
      data to fit the algorithm to
  
  Returns
  -------
  N : int
      number of rows of X
  mu : 1D np.ndarray of length N
      paramerer in Pereto distribution estimated by r2/r1
  Iin : 1D np.ndarray of length N * q
      encodes the q neighbour index values for point index i in 0:N-1
      e.g. popint i=0 has neighbours 2, 4, 7 and point i=1
      has neighbours 3, 9, 4
      Iin = np.array([2, 4, 7, 3, 9, 4,...])
  Iout : 1D np.ndarray of length N * q
      array of indices for which i is neighbour for i in 0:N-1
      e.g. point i=0 is also neighbour of points 2, 4 and
      point i=1 is a neighbour of point 3 only
      Iout = np.array([2, 4, 3,...])
  Iout_count : 1D np.ndarray of length N
      count of how many neighbours point i has for i in 0:N-1
      e.g. Iout_count = np.array([2, 1, 1,...])
  Iout_track : 1D np.ndarray of length N
      cumulative sum of Iout_count at i-1 for i in 1:N-1
      e.g. Iout_track = np.array([0, 2, 3, 4,...])
docstr_tok: ["Neighbourhood","information","from","input","data","X.","Parameters","--","--","--","--","--","X",":","2D","np.ndarray","of","shape","(","N",",","dim",")",",","where","dim",">","1","data","to","fit","the","algorithm","to","Returns","--","--","--","-","N",":","int","number","of","rows","of","X","mu",":","1D","np.ndarray","of","length","N","paramerer","in","Pereto","distribution","estimated","by","r2\/r1","Iin",":","1D","np.ndarray","of","length","N","*","q","encodes","the","q","neighbour","index","values","for","point","index","i","in","0",":","N-1","e.g",".","popint","i=0","has","neighbours","2",",","4",",","7","and","point","i=1","has","neighbours","3",",","9",",","4","Iin","=","np.array","(","[","2",",","4",",","7",",","3",",","9",",","4",",","...","]",")","Iout",":","1D","np.ndarray","of","length","N","*","q","array","of","indices","for","which","i","is","neighbour","for","i","in","0",":","N-1","e.g",".","point","i=0","is","also","neighbour","of","points","2",",","4","and","point","i=1","is","a","neighbour","of","point","3","only","Iout","=","np.array","(","[","2",",","4",",","3",",","...","]",")","Iout_count",":","1D","np.ndarray","of","length","N","count","of","how","many","neighbours","point","i","has","for","i","in","0",":","N-1","e.g",".","Iout_count","=","np.array","(","[","2",",","1",",","1",",","...","]",")","Iout_track",":","1D","np.ndarray","of","length","N","cumulative","sum","of","Iout_count","at","i-1","for","i","in","1",":","N-1","e.g",".","Iout_track","=","np.array","(","[","0",",","2",",","3",",","4",",","...","]",")"]
code: def _get_neighbourhood_params(self, X):
      """Neighbourhood information from input data X.
  
      Parameters
      ----------
      X : 2D np.ndarray of shape (N, dim), where dim > 1
          data to fit the algorithm to
  
      Returns
      -------
      N : int
          number of rows of X
      mu : 1D np.ndarray of length N
          paramerer in Pereto distribution estimated by r2/r1
      Iin : 1D np.ndarray of length N * q
          encodes the q neighbour index values for point index i in 0:N-1
          e.g. popint i=0 has neighbours 2, 4, 7 and point i=1
          has neighbours 3, 9, 4
          Iin = np.array([2, 4, 7, 3, 9, 4,...])
      Iout : 1D np.ndarray of length N * q
          array of indices for which i is neighbour for i in 0:N-1
          e.g. point i=0 is also neighbour of points 2, 4 and
          point i=1 is a neighbour of point 3 only
          Iout = np.array([2, 4, 3,...])
      Iout_count : 1D np.ndarray of length N
          count of how many neighbours point i has for i in 0:N-1
          e.g. Iout_count = np.array([2, 1, 1,...])
      Iout_track : 1D np.ndarray of length N
          cumulative sum of Iout_count at i-1 for i in 1:N-1
          e.g. Iout_track = np.array([0, 2, 3, 4,...])
      """
      q = self.q
      metric = self.metric
  
      N, _ = np.shape(X)
  
      nbrs = NearestNeighbors(
          n_neighbors=q + 1, algorithm="ball_tree", metric=metric
      ).fit(X)
      distances, Iin = nbrs.kneighbors(X)
      mu = np.divide(distances[:, 2], distances[:, 1])
  
      nbrmat = np.zeros((N, N))
      for n in range(q):
          nbrmat[Iin[:, 0], Iin[:, n + 1]] = 1
  
      Iout_count = np.sum(nbrmat, axis=0).astype(int)
      Iout = np.where(nbrmat.T)[1].astype(int)
      Iout_track = np.cumsum(Iout_count)
      Iout_track = np.append(0, Iout_track[:-1]).astype(int)
      Iin = Iin[:, 1:]
      Iin = np.reshape(Iin, (N * q,)).astype(int)
  
      return N, mu, Iin, Iout, Iout_count, Iout_track
  
file_path: sktime/sktime/transformations/series/hidalgo.py
imports: from functools import reduce
  import numpy
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils.validation import check_random_state
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 2 for calling the Hidalgo obj's underlying member method code with example usage: obj._get_neighbourhood_params(X) and returns: N,  mu,  Iin,  Iout,  Iout_count,  Iout_track