code: def recon_err(data, F, W):
      """Calcuate reconstruction error
  
      Parameters
      ----------
  
      data : 2D array
          True data to recover.
  
      F : 2D array
          HTFA factor matrix.
  
      W : 2D array
          HTFA weight matrix.
  
  
      Returns
      -------
      float
          Returns root mean squared reconstruction error.
  
      """
  
      recon = F.dot(W).ravel()
      err = mean_squared_error(
          data.ravel(), recon, multioutput="uniform_average"
      )
      return math.sqrt(err)
  
file_path: brainiak/examples/factoranalysis/htfa_cv_example.py
imports: import os
  import sys
  import math
  import requests
  import scipy.io
  import numpy
  from mpi4py import MPI
  from subprocess import call
  from scipy.stats import stats
  from sklearn import model_selection
  from sklearn.metrics import mean_squared_error
label_desc: Use image node_id 1 for calling a global function with example usage: recon_err(data, F, W) and returns: math