Browse Source

[MNT] add test_predict_proba

pull/1/head
Gao Enhao 2 years ago
parent
commit
52c194ad89
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      tests/test_basic_nn.py

+ 7
- 0
tests/test_basic_nn.py View File

@@ -35,6 +35,13 @@ class TestBasicNN(object):
assert len(predictions) == len(X)
assert numpy.isin(predictions, list(range(10))).all()

# Test predict_proba method
def test_predict_proba(self, basic_nn_instance):
X = list(torch.randn(32, 1, 28, 28))
predict_proba = basic_nn_instance.predict_proba(X=X)
assert len(predict_proba) == len(X)
assert ((0 <= predict_proba) & (predict_proba <= 1)).all()

# Test score method
def test_score(self, basic_nn_instance):
X = torch.randn(32, 1, 28, 28)


Loading…
Cancel
Save