def srcr(matrix,final):
  """
    calculates spearman rank correlation coefficient
    
    Parameters
    ----------
    matrix :
        train values matrix
    final :
        C*U*R

    Returns
    -------
    values :
        Spearman Rank Correlation.

  """
  freq=0
  sum=0
  for i in range(0,len(matrix)):
    for j in range(0,len(matrix[i])):
      sum=sum+(matrix[i][j]-final[i][j])**2
      freq=freq+1
  sum=6*sum
  flag=(freq**3)-freq
  values=1-(sum/flag)
  return values