(N=15)
| 54 | |
| 55 | |
| 56 | def test_standardizer(N=15): |
| 57 | np.random.seed(12345) |
| 58 | |
| 59 | i = 0 |
| 60 | while i < N: |
| 61 | mean = bool(np.random.randint(2)) |
| 62 | std = bool(np.random.randint(2)) |
| 63 | N = np.random.randint(2, 100) |
| 64 | M = np.random.randint(2, 100) |
| 65 | X = np.random.rand(N, M) |
| 66 | |
| 67 | S = Standardizer(with_mean=mean, with_std=std) |
| 68 | S.fit(X) |
| 69 | mine = S.transform(X) |
| 70 | |
| 71 | theirs = StandardScaler(with_mean=mean, with_std=std) |
| 72 | gold = theirs.fit_transform(X) |
| 73 | |
| 74 | np.testing.assert_almost_equal(mine, gold) |
| 75 | print("PASSED") |
| 76 | i += 1 |
| 77 | |
| 78 | |
| 79 | def test_tfidf(N=15): |
nothing calls this directly
no test coverage detected