class_docstr: Supervised version of Relevant Components Analysis (RCA)
  
  `RCA_Supervised` creates chunks of similar points by first sampling a
  class, taking `chunk_size` elements in it, and repeating the process
  `n_chunks` times.
  
  Parameters
  ----------
  n_components : int or None, optional (default=None)
    Dimensionality of reduced space (if None, defaults to dimension of X).
  
  n_chunks: int, optional (default=100)
    Number of chunks to generate.
  
  chunk_size: int, optional (default=2)
    Number of points per chunk.
  
  preprocessor : array-like, shape=(n_samples, n_features) or callable
    The preprocessor to call to get tuples from indices. If array-like,
    tuples will be formed like this: X[indices].
  
  random_state : int or numpy.RandomState or None, optional (default=None)
    A pseudo random number generator object or a seed for it if int.
    It is used to randomly sample constraints from labels.
  
  num_chunks : Renamed to n_chunks. Will be deprecated in 0.7.0
  
  Examples
  --------
  >>> from metric_learn import RCA_Supervised
  >>> from sklearn.datasets import load_iris
  >>> iris_data = load_iris()
  >>> X = iris_data['data']
  >>> Y = iris_data['target']
  >>> rca = RCA_Supervised(n_chunks=30, chunk_size=2)
  >>> rca.fit(X, Y)
  
  Attributes
  ----------
  components_ : `numpy.ndarray`, shape=(n_components, n_features)
    The learned linear transformation ``L``.
class_docstr_tok: ["Supervised","version","of","Relevant","Components","Analysis","(","RCA",")","`","RCA_Supervised","`","creates","chunks","of","similar","points","by","first","sampling","a","class",",","taking","`","chunk_size","`","elements","in","it",",","and","repeating","the","process","`","n_chunks","`","times",".","Parameters","--","--","--","--","--","n_components",":","int","or","None",",","optional","(","default=None",")","Dimensionality","of","reduced","space","(","if","None",",","defaults","to","dimension","of","X",")",".","n_chunks",":","int",",","optional","(","default=100",")","Number","of","chunks","to","generate",".","chunk_size",":","int",",","optional","(","default=2",")","Number","of","points","per","chunk",".","preprocessor",":","array-like",",","shape=","(","n_samples",",","n_features",")","or","callable","The","preprocessor","to","call","to","get","tuples","from","indices",".","If","array-like",",","tuples","will","be","formed","like","this",":","X","[","indices","]",".","random_state",":","int","or","numpy.RandomState","or","None",",","optional","(","default=None",")","A","pseudo","random","number","generator","object","or","a","seed","for","it","if","int",".","It","is","used","to","randomly","sample","constraints","from","labels",".","num_chunks",":","Renamed","to","n_chunks",".","Will","be","deprecated","in","0.7.0","Examples","--","--","--","--",">",">",">","from","metric_learn","import","RCA_Supervised",">",">",">","from","sklearn.datasets","import","load_iris",">",">",">","iris_data","=","load_iris","(",")",">",">",">","X","=","iris_data","[","'data","'","]",">",">",">","Y","=","iris_data","[","'target","'","]",">",">",">","rca","=","RCA_Supervised","(","n_chunks=30",",","chunk_size=2",")",">",">",">","rca.fit","(","X",",","Y",")","Attributes","--","--","--","--","--","components_",":","`","numpy.ndarray","`",",","shape=","(","n_components",",","n_features",")","The","learned","linear","transformation","``","L","``","."]
docstr: Initialize the supervised version of `RCA`.
docstr_tok: ["Initialize","the","supervised","version","of","`","RCA","`","."]
code: def __init__(
      self,
      n_components=None,
      n_chunks=100,
      chunk_size=2,
      preprocessor=None,
      random_state=None,
      num_chunks="deprecated",
  ):
      """Initialize the supervised version of `RCA`."""
      RCA.__init__(
          self, n_components=n_components, preprocessor=preprocessor
      )
      if num_chunks != "deprecated":
          warnings.warn(
              '"num_chunks" parameter has been renamed to'
              ' "n_chunks". It has been deprecated in'
              " version 0.6.3 and will be removed in 0.7.0"
              "",
              FutureWarning,
          )
          n_chunks = num_chunks
      self.num_chunks = "deprecated"  # To avoid no_attribute error
      self.n_chunks = n_chunks
      self.chunk_size = chunk_size
      self.random_state = random_state
  
file_path: metric-learn/metric_learn/rca.py
imports: import numpy
  import warnings
  from sklearn.base import TransformerMixin
  from ._util import _check_n_components
  from .base_metric import MahalanobisMixin
  from .constraints import Constraints
label_desc: Use image node_id 1 to create a new RCA_Supervised object from inherited base classes: RCA with example: obj = RCA_Supervised(n_components, n_chunks, chunk_size, preprocessor, random_state, num_chunks)