class_docstr: Class to perform random under-sampling.
  
  Under-sample the majority class(es) by randomly picking samples
  with or without replacement.
  
  Read more in the :ref:`User Guide <controlled_under_sampling>`.
  
  Parameters
  ----------
  {sampling_strategy}
  
  {random_state}
  
  replacement : bool, default=False
      Whether the sample is with or without replacement.
  
  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
  
  See Also
  --------
  NearMiss : Undersample using near-miss samples.
  
  Notes
  -----
  Supports multi-class resampling by sampling each class independently.
  Supports heterogeneous data as object array containing string and numeric
  data.
  
  Examples
  --------
  >>> from collections import Counter
  >>> from sklearn.datasets import make_classification
  >>> from imblearn.under_sampling import RandomUnderSampler # doctest: +NORMALIZE_WHITESPACE
  >>> 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}})
  >>> rus = RandomUnderSampler(random_state=42)
  >>> X_res, y_res = rus.fit_resample(X, y)
  >>> print('Resampled dataset shape %s' % Counter(y_res))
  Resampled dataset shape Counter({{0: 100, 1: 100}})
code: def _check_X_y(self, X, y):
      y, binarize_y = check_target_type(y, indicate_one_vs_all=True)
      X, y = self._validate_data(
          X,
          y,
          reset=True,
          accept_sparse=["csr", "csc"],
          dtype=None,
          force_all_finite=False,
      )
      return X, y, binarize_y
  
file_path: upgini/src/upgini/sampler/random_under_sampler.py
imports: import numpy
  from sklearn.utils import check_random_state
  from sklearn.utils import _safe_indexing
  from .base import BaseUnderSampler
  from .utils import check_target_type
  from .utils import _deprecate_positional_args
label_desc: Use image node_id 2 for calling the RandomUnderSampler obj's underlying member method code with example usage: obj._check_X_y(X, y) and returns: X,  y,  binarize_y