Conditions | 2 |
Total Lines | 10 |
Lines | 10 |
Ratio | 100 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | 1 | import numpy as np |
|
28 | 1 | View Code Duplication | def test_predict(): |
|
|||
29 | """Test for making predictions.""" |
||
30 | 1 | X = rnd.randn(10, 2) |
|
31 | 1 | y = np.hstack((-np.ones((5,)), np.ones((5,)))) |
|
32 | 1 | Z = rnd.randn(10, 2) + 1 |
|
33 | 1 | clf = SubspaceAlignedClassifier() |
|
34 | 1 | clf.fit(X, y, Z) |
|
35 | 1 | u_pred = clf.predict(Z) |
|
36 | 1 | labels = np.unique(y) |
|
37 | assert len(np.setdiff1d(np.unique(u_pred), labels)) == 0 |
||
38 |