method_params = dict(shrinkage=dict(
shrinkage=reg, assume_centered=True, store_precision=False))
reg = "shrinkage"
elif not isinstance(reg, str):
raise ValueError("reg must be a float, str, or None, got %s (%s)"
% (reg, type(reg)))
method, method_params = _check_method_params(
reg, method_params, name="reg", allow_auto=False, rank=rank)
// use mag instead of eeg here to avoid the cov EEG projection warning
info = create_info(data.shape[-2], 1000., "mag") if info is None else info
After Change
cov : ndarray, shape (n_channels, n_channels)
The covariance matrix.
_validate_type(reg, (str, "numeric", None))
if reg is None:
reg = "empirical"
elif not isinstance(reg, str):
reg = float(reg)