def _fit_eval(rd, B, B2, fwd_svd=None, fwd_data=None, whitener=None):
    if fwd_svd is None:
        fwd = _dipole_forwards(fwd_data, whitener, rd[np.newaxis, :])[0]
        uu, sing, vv = linalg.svd(fwd, overwrite_a=True, full_matrices=False)
    else:
        uu, sing, vv = fwd_svd
    gof = _dipole_gof(uu, sing, vv, B, B2)[0]
    # mne-c uses fitness=B2-Bm2, but ours (1-gof) is just a normalized version
    return 1. - gof
Calculate the residual sum of squares
dataset/ETHPy150Open mne-tools/mne-python/mne/dipole.py/_fit_eval