class_docstr: Deterministic Shared Response Model (DetSRM)
  
  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.
  
  Note
  ----
  
      The number of voxels may be different between subjects. However, the
      number of samples must be the same across subjects.
  
      The Deterministic Shared Response Model is approximated using the
      Block Coordinate Descent (BCD) algorithm proposed in [Chen2015]_.
  
      This is a single node version.
  
      The run-time complexity is :math:`O(I (V T K + V K^2))` 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, K - the
      number of features (typically, :math:`V \gg T \gg K`), and N - the
      number of subjects.
class_docstr_tok: ["Deterministic","Shared","Response","Model","(","DetSRM",")","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",".","Note","--","--","The","number","of","voxels","may","be","different","between","subjects",".","However",",","the","number","of","samples","must","be","the","same","across","subjects",".","The","Deterministic","Shared","Response","Model","is","approximated","using","the","Block","Coordinate","Descent","(","BCD",")","algorithm","proposed","in","[","Chen2015","]","_",".","This","is","a","single","node","version",".","The","run-time","complexity","is",":","math",":","`","O","(","I","(","V","T","K","+","V","K^2",")",")","`","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",",","K","-","the","number","of","features","(","typically",",",":","math",":","`","V","\\gg","T","\\gg","K","`",")",",","and","N","-","the","number","of","subjects","."]
docstr: Calculate the objective function
  
  Parameters
  ----------
  
  data : list of 2D arrays, element i has shape=[voxels_i, samples]
      Each element in the list contains the fMRI data of one subject.
  
  w : list of 2D arrays, element i has shape=[voxels_i, features]
      The orthogonal transforms (mappings) :math:`W_i` for each subject.
  
  s : array, shape=[features, samples]
      The shared response
  
  Returns
  -------
  
  objective : float
      The objective function value.
docstr_tok: ["Calculate","the","objective","function","Parameters","--","--","--","--","--","data",":","list","of","2D","arrays",",","element","i","has","shape=","[","voxels_i",",","samples","]","Each","element","in","the","list","contains","the","fMRI","data","of","one","subject",".","w",":","list","of","2D","arrays",",","element","i","has","shape=","[","voxels_i",",","features","]","The","orthogonal","transforms","(","mappings",")",":","math",":","`","W_i","`","for","each","subject",".","s",":","array",",","shape=","[","features",",","samples","]","The","shared","response","Returns","--","--","--","-","objective",":","float","The","objective","function","value","."]
code: def _objective_function(self, data, w, s):
      """Calculate the objective function
  
      Parameters
      ----------
  
      data : list of 2D arrays, element i has shape=[voxels_i, samples]
          Each element in the list contains the fMRI data of one subject.
  
      w : list of 2D arrays, element i has shape=[voxels_i, features]
          The orthogonal transforms (mappings) :math:`W_i` for each subject.
  
      s : array, shape=[features, samples]
          The shared response
  
      Returns
      -------
  
      objective : float
          The objective function value.
      """
      subjects = len(data)
      objective = 0.0
      for m in range(subjects):
          objective += np.linalg.norm(data[m] - w[m].dot(s), "fro") ** 2
  
      return objective * 0.5 / data[0].shape[1]
  
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 4 for calling the DetSRM obj's underlying member method code with example usage: obj._objective_function(data, w, s) and returns: unknown