(n_samples, n_features, rank, sigma)
| 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]} |
no test coverage detected