MCPcopy
hub / github.com/mne-tools/mne-python / get_data

Function get_data

mne/tests/test_cov.py:617–626  ·  view source on GitHub ↗
(n_samples, n_features, rank, sigma)

Source from the content-addressed store, hash-verified

615 sigma = 0.1
616
617 def get_data(n_samples, n_features, rank, sigma):
618 rng = np.random.RandomState(42)
619 W = rng.randn(n_features, n_features)
620 X = rng.randn(n_samples, rank)
621 U, _, _ = _safe_svd(W.copy())
622 X = np.dot(X, U[:, :rank].T)
623
624 sigmas = sigma * rng.rand(n_features) + sigma / 2.0
625 X += rng.randn(n_samples, n_features) * sigmas
626 return X
627
628 X = get_data(n_samples=n_samples, n_features=n_features, rank=rank, sigma=sigma)
629 method_params = {"iter_n_components": [4, 5, 6]}

Callers 1

test_auto_low_rankFunction · 0.70

Calls 2

_safe_svdFunction · 0.90
copyMethod · 0.45

Tested by

no test coverage detected