comparison tests/test_sigmoid.py @ 20:d6d2ecb33c95

[logistic regression] smoke tests
author Jeff Hammel <k0scist@gmail.com>
date Mon, 04 Sep 2017 08:36:24 -0700
parents cd43ce453358
children 38aa9098bf2d
comparison
equal deleted inserted replaced
19:cd43ce453358 20:d6d2ecb33c95
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 """ 3 """
4 test sigmoid related funcationality 4 test sigmoid related functionality
5 """ 5 """
6 6
7 import os 7 import os
8 import unittest 8 import unittest
9 from tvii.sigmoid import sigmoid 9 from tvii.sigmoid import sigmoid
14 def test_basic(self): 14 def test_basic(self):
15 """test two points of the sigmoid function""" 15 """test two points of the sigmoid function"""
16 16
17 answer = sigmoid([0,2]) 17 answer = sigmoid([0,2])
18 assert len(answer) == 2 18 assert len(answer) == 2
19 assert answer[0] == 0.5
20 assert abs(answer[1] - 0.88079708) < 1e-6
19 21
20 if __name__ == '__main__': 22 if __name__ == '__main__':
21 unittest.main() 23 unittest.main()