class_docstr: Probabilistic Shared Response Model (SRM)
  
  Given multi-subject data, factorize it as a shared response S among all
  subjects and an orthogonal transform W per subject:
  
  .. math:: X_i \approx W_i S, \forall i=1 \dots N
  
  Parameters
  ----------
  
  n_iter : int, default: 10
      Number of iterations to run the algorithm.
  
  features : int, default: 50
      Number of features to compute.
  
  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.
  
  s_ : array, shape=[features, samples]
      The shared response.
  
  sigma_s_ : array, shape=[features, features]
      The covariance of the shared response Normal distribution.
  
  mu_ : list of array, element i has shape=[voxels_i]
      The voxel means over the samples for each subject.
  
  rho2_ : array, shape=[subjects]
      The estimated noise variance :math:`\rho_i^2` for each subject
  
  
  Note
  ----
  
     The number of voxels may be different between subjects. However, the
     number of samples must be the same across subjects.
  
     The probabilistic Shared Response Model is approximated using the
     Expectation Maximization (EM) algorithm proposed in [Chen2015]_. The
     implementation follows the optimizations published in [Anderson2016]_.
  
     This is a single node version.
  
     The run-time complexity is :math:`O(I (V T K + V K^2 + K^3))` and the
     memory complexity is :math:`O(V T)` with I - the number of iterations,
     V - the sum of voxels from all subjects, T - the number of samples, and
     K - the number of features (typically, :math:`V \gg T \gg K`).
class_docstr_tok: ["Probabilistic","Shared","Response","Model","(","SRM",")","Given","multi-subject","data",",","factorize","it","as","a","shared","response","S","among","all","subjects","and","an","orthogonal","transform","W","per","subject",":","..","math",":",":","X_i","\\approx","W_i","S",",","\\forall","i=1","\\dots","N","Parameters","--","--","--","--","--","n_iter",":","int",",","default",":","10","Number","of","iterations","to","run","the","algorithm",".","features",":","int",",","default",":","50","Number","of","features","to","compute",".","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",".","s_",":","array",",","shape=","[","features",",","samples","]","The","shared","response",".","sigma_s_",":","array",",","shape=","[","features",",","features","]","The","covariance","of","the","shared","response","Normal","distribution",".","mu_",":","list","of","array",",","element","i","has","shape=","[","voxels_i","]","The","voxel","means","over","the","samples","for","each","subject",".","rho2_",":","array",",","shape=","[","subjects","]","The","estimated","noise","variance",":","math",":","`","\\rho_i^2","`","for","each","subject","Note","--","--","The","number","of","voxels","may","be","different","between","subjects",".","However",",","the","number","of","samples","must","be","the","same","across","subjects",".","The","probabilistic","Shared","Response","Model","is","approximated","using","the","Expectation","Maximization","(","EM",")","algorithm","proposed","in","[","Chen2015","]","_",".","The","implementation","follows","the","optimizations","published","in","[","Anderson2016","]","_",".","This","is","a","single","node","version",".","The","run-time","complexity","is",":","math",":","`","O","(","I","(","V","T","K","+","V","K^2","+","K^3",")",")","`","and","the","memory","complexity","is",":","math",":","`","O","(","V","T",")","`","with","I","-","the","number","of","iterations",",","V","-","the","sum","of","voxels","from","all","subjects",",","T","-","the","number","of","samples",",","and","K","-","the","number","of","features","(","typically",",",":","math",":","`","V","\\gg","T","\\gg","K","`",")","."]
docstr: Use the model to transform matrix to Shared Response space
  
  Parameters
  ----------
  X : list of 2D arrays, element i has shape=[voxels_i, samples_i]
      Each element in the list contains the fMRI data of one subject
      note that number of voxels and samples can vary across subjects
  y : not used (as it is unsupervised learning)
  
  
  Returns
  -------
  s : list of 2D arrays, element i has shape=[features_i, samples_i]
      Shared responses from input data (X)
docstr_tok: ["Use","the","model","to","transform","matrix","to","Shared","Response","space","Parameters","--","--","--","--","--","X",":","list","of","2D","arrays",",","element","i","has","shape=","[","voxels_i",",","samples_i","]","Each","element","in","the","list","contains","the","fMRI","data","of","one","subject","note","that","number","of","voxels","and","samples","can","vary","across","subjects","y",":","not","used","(","as","it","is","unsupervised","learning",")","Returns","--","--","--","-","s",":","list","of","2D","arrays",",","element","i","has","shape=","[","features_i",",","samples_i","]","Shared","responses","from","input","data","(","X",")"]
code: def transform(self, X, y=None):
      """Use the model to transform matrix to Shared Response space
  
      Parameters
      ----------
      X : list of 2D arrays, element i has shape=[voxels_i, samples_i]
          Each element in the list contains the fMRI data of one subject
          note that number of voxels and samples can vary across subjects
      y : not used (as it is unsupervised learning)
  
  
      Returns
      -------
      s : list of 2D arrays, element i has shape=[features_i, samples_i]
          Shared responses from input data (X)
      """
  
      # Check if the model exist
      if hasattr(self, "w_") is False:
          raise NotFittedError("The model fit has not been run yet.")
  
      # Check the number of subjects
      if len(X) != len(self.w_):
          raise ValueError(
              "The number of subjects does not match the one"
              " in the model."
          )
  
      s = [None] * len(X)
      for subject in range(len(X)):
          s[subject] = self.w_[subject].T.dot(X[subject])
  
      return s
  
imports: import logging
  import numpy
  import scipy
  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 3 for calling the SRM obj's underlying member method code with example usage: obj.transform(X, y) and returns: s