class_docstr: Under-sampling by removing Tomek's links.
  
  Read more in the :ref:`User Guide <tomek_links>`.
  
  Parameters
  ----------
  {sampling_strategy}
  
  {n_jobs}
  
  Attributes
  ----------
  sampling_strategy_ : dict
      Dictionary containing the information to sample the dataset. The keys
      corresponds to the class labels from which to sample and the values
      are the number of samples to sample.
  
  sample_indices_ : ndarray of shape (n_new_samples,)
      Indices of the samples selected.
  
      .. versionadded:: 0.4
  
  n_features_in_ : int
      Number of features in the input dataset.
  
      .. versionadded:: 0.9
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during `fit`. Defined only when `X` has feature
      names that are all strings.
  
      .. versionadded:: 0.10
  
  See Also
  --------
  EditedNearestNeighbours : Undersample by samples edition.
  
  CondensedNearestNeighbour : Undersample by samples condensation.
  
  RandomUnderSampler : Randomly under-sample the dataset.
  
  Notes
  -----
  This method is based on [1]_.
  
  Supports multi-class resampling. A one-vs.-rest scheme is used as
  originally proposed in [1]_.
  
  References
  ----------
  .. [1] I. Tomek, "Two modifications of CNN," In Systems, Man, and
     Cybernetics, IEEE Transactions on, vol. 6, pp 769-772, 1976.
  
  Examples
  --------
  >>> from collections import Counter
  >>> from sklearn.datasets import make_classification
  >>> from imblearn.under_sampling import TomekLinks
  >>> X, y = make_classification(n_classes=2, class_sep=2,
  ... weights=[0.1, 0.9], n_informative=3, n_redundant=1, flip_y=0,
  ... n_features=20, n_clusters_per_class=1, n_samples=1000, random_state=10)
  >>> print('Original dataset shape %s' % Counter(y))
  Original dataset shape Counter({{1: 900, 0: 100}})
  >>> tl = TomekLinks()
  >>> X_res, y_res = tl.fit_resample(X, y)
  >>> print('Resampled dataset shape %s' % Counter(y_res))
  Resampled dataset shape Counter({{1: 897, 0: 100}})
class_docstr_tok: ["Under-sampling","by","removing","Tomek","'s","links",".","Read","more","in","the",":","ref",":","`","User","Guide","<","tomek_links",">","`",".","Parameters","--","--","--","--","--","{","sampling_strategy","}","{","n_jobs","}","Attributes","--","--","--","--","--","sampling_strategy_",":","dict","Dictionary","containing","the","information","to","sample","the","dataset",".","The","keys","corresponds","to","the","class","labels","from","which","to","sample","and","the","values","are","the","number","of","samples","to","sample",".","sample_indices_",":","ndarray","of","shape","(","n_new_samples",",",")","Indices","of","the","samples","selected",".","..","versionadded",":",":","0.4","n_features_in_",":","int","Number","of","features","in","the","input","dataset",".","..","versionadded",":",":","0.9","feature_names_in_",":","ndarray","of","shape","(","`","n_features_in_","`",",",")","Names","of","features","seen","during","`","fit","`",".","Defined","only","when","`","X","`","has","feature","names","that","are","all","strings",".","..","versionadded",":",":","0.10","See","Also","--","--","--","--","EditedNearestNeighbours",":","Undersample","by","samples","edition",".","CondensedNearestNeighbour",":","Undersample","by","samples","condensation",".","RandomUnderSampler",":","Randomly","under-sample","the","dataset",".","Notes","--","--","-","This","method","is","based","on","[","1","]","_",".","Supports","multi-class","resampling",".","A","one-vs.-rest","scheme","is","used","as","originally","proposed","in","[","1","]","_.","References","--","--","--","--","--","..","[","1","]","I.","Tomek",",","``","Two","modifications","of","CNN",",","''","In","Systems",",","Man",",","and","Cybernetics",",","IEEE","Transactions","on",",","vol",".","6",",","pp","769-772",",","1976",".","Examples","--","--","--","--",">",">",">","from","collections","import","Counter",">",">",">","from","sklearn.datasets","import","make_classification",">",">",">","from","imblearn.under_sampling","import","TomekLinks",">",">",">","X",",","y","=","make_classification","(","n_classes=2",",","class_sep=2",",","...","weights=","[","0.1",",","0.9","]",",","n_informative=3",",","n_redundant=1",",","flip_y=0",",","...","n_features=20",",","n_clusters_per_class=1",",","n_samples=1000",",","random_state=10",")",">",">",">","print","(","'Original","dataset","shape","%","s","'","%","Counter","(","y",")",")","Original","dataset","shape","Counter","(","{","{","1",":","900",",","0",":","100","}","}",")",">",">",">","tl","=","TomekLinks","(",")",">",">",">","X_res",",","y_res","=","tl.fit_resample","(","X",",","y",")",">",">",">","print","(","'Resampled","dataset","shape","%","s","'","%","Counter","(","y_res",")",")","Resampled","dataset","shape","Counter","(","{","{","1",":","897",",","0",":","100","}","}",")"]
code: def _more_tags(self):
      return {"sample_indices": True}
  
file_path: imbalanced-learn/imblearn/under_sampling/_prototype_selection/_tomek_links.py
imports: import numbers
  import numpy
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import _safe_indexing
  from ...utils import Substitution
  from ...utils._docstring import _n_jobs_docstring
  from ..base import BaseCleaningSampler
label_desc: Use image node_id 4 for calling the TomekLinks obj's underlying member method code with example usage: obj._more_tags() and returns: dict