class_docstr: Robust Shared Response Model (RSRM)
  
  Given multi-subject data, factorize it as a shared response R among all
  subjects, an orthogonal transform W per subject, and an individual
  (outlying) sparse component S per subject:
  
  .. math:: X_i \approx W_i R + S_i, \forall i=1 \dots N
  
  This unsupervised model allows to learn idiosyncratic information for
  subjects and simultaneously improve the shared response estimation.
  The model has similar properties to the Shared Response Model (SRM) with
  the addition of the individual components.
  
  The model is estimated solving the following optimization problem:
  
  .. math::
      \min_{W_i, S_i, R}\sum_i \frac{1}{2}\|X_i - W_i R - S_i\|_F^2
  .. math:: + \gamma\|S_i\|_1
  .. math:: s.t. \qquad W_i^TW_i = I \quad \forall i=1 \dots N
  
  The solution to this problem is obtained by applying a Block-Coordinate
  Descent procedure. More details can be found in [Turek2017]_.
  
  Parameters
  ----------
  
  n_iter : int, default: 10
      Number of iterations to run the algorithm.
  
  features : int, default: 50
      Number of features to compute.
  
  gamma : float, default: 1.0
      Regularization parameter for the sparseness of the individual
      components. Higher values yield sparser individual components.
  
  rand_seed : int, default: 0
      Seed for initializing the random number generator.
  
  
  Attributes
  ----------
  
  w_ : list of array, element i has shape=[voxels_i, features]
      The orthogonal transforms (mappings) for each subject.
  
  r_ : array, shape=[features, timepoints]
      The shared response.
  
  s_ : list of array, element i has shape=[voxels_i, timepoints]
      The individual components for each subject.
  
  random_state_: `RandomState`
      Random number generator initialized using rand_seed
  
  Note
  ----
  
      The number of voxels may be different between subjects. However, the
      number of timepoints for the alignment data must be the same across
      subjects.
  
      The Robust Shared Response Model is approximated using the
      Block-Coordinate Descent (BCD) algorithm proposed in [Turek2017]_.
  
      This is a single node version.
docstr: Updates the mappings `W_i` for one subject.
  
  Parameters
  ----------
  
  Xi : array, shape=[voxels, timepoints]
      The fMRI data :math:`X_i` for aligning the subject.
  
  Si : array, shape=[voxels, timepoints]
      The individual component :math:`S_i` for the subject.
  
  R : array, shape=[features, timepoints]
      The shared response.
  
  Returns
  -------
  
  Wi : array, shape=[voxels, features]
      The orthogonal transform (mapping) :math:`W_i` for the subject.
docstr_tok: ["Updates","the","mappings","`","W_i","`","for","one","subject",".","Parameters","--","--","--","--","--","Xi",":","array",",","shape=","[","voxels",",","timepoints","]","The","fMRI","data",":","math",":","`","X_i","`","for","aligning","the","subject",".","Si",":","array",",","shape=","[","voxels",",","timepoints","]","The","individual","component",":","math",":","`","S_i","`","for","the","subject",".","R",":","array",",","shape=","[","features",",","timepoints","]","The","shared","response",".","Returns","--","--","--","-","Wi",":","array",",","shape=","[","voxels",",","features","]","The","orthogonal","transform","(","mapping",")",":","math",":","`","W_i","`","for","the","subject","."]
code: def _update_transform_subject(Xi, Si, R):
      """Updates the mappings `W_i` for one subject.
  
      Parameters
      ----------
  
      Xi : array, shape=[voxels, timepoints]
          The fMRI data :math:`X_i` for aligning the subject.
  
      Si : array, shape=[voxels, timepoints]
          The individual component :math:`S_i` for the subject.
  
      R : array, shape=[features, timepoints]
          The shared response.
  
      Returns
      -------
  
      Wi : array, shape=[voxels, features]
          The orthogonal transform (mapping) :math:`W_i` for the subject.
      """
      A = Xi.dot(R.T)
      A -= Si.dot(R.T)
      # Solve the Procrustes problem
      U, _, V = np.linalg.svd(A, full_matrices=False)
      return U.dot(V)
  
imports: import logging
  import numpy
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.utils import assert_all_finite
  from sklearn.utils.validation import NotFittedError
label_desc: Use image node_id 12 for calling the RSRM obj's underlying member method code with example usage: obj._update_transform_subject(Xi, Si, R) and returns: U