mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-12-26 01:29:10 +00:00
added negatives to analysis unit tests
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
d690868011
commit
0e71ef4dd8
@ -5,18 +5,8 @@ def test_():
|
|||||||
test_data_linear = [1, 3, 6, 7, 9]
|
test_data_linear = [1, 3, 6, 7, 9]
|
||||||
y_data_ccu = [1, 3, 7, 14, 21]
|
y_data_ccu = [1, 3, 7, 14, 21]
|
||||||
y_data_ccd = [1, 5, 7, 8.5, 8.66]
|
y_data_ccd = [1, 5, 7, 8.5, 8.66]
|
||||||
test_data_scrambled = [63, 66, 15, 48, 67, 70, 92, 76, 85, 21, 35, 5, 92, 91, 37, 50, 35,
|
test_data_scrambled = [-32, 34, 19, 72, -65, -11, -43, 6, 85, -17, -98, -26, 12, 20, 9, -92, -40, 98, -78, 17, -20, 49, 93, -27, -24, -66, 40, 84, 1, -64, -68, -25, -42, -46, -76, 43, -3, 30, -14, -34, -55, -13, 41, -30, 0, -61, 48, 23, 60, 87, 80, 77, 53, 73, 79, 24, -52, 82, 8, -44, 65, 47, -77, 94, 7, 37, -79, 36, -94, 91, 59, 10, 97, -38, -67, 83, 54, 31, -95, -63, 16, -45, 21, -12, 66, -48, -18, -96, -90, -21, -83, -74, 39, 64, 69, -97, 13, 55, 27, -39]
|
||||||
17, 69, 85, 37, 61, 87, 5, 99, 4, 55, 17, 0, 93, 51, 79, 31, 88,
|
test_data_sorted = [-98, -97, -96, -95, -94, -92, -90, -83, -79, -78, -77, -76, -74, -68, -67, -66, -65, -64, -63, -61, -55, -52, -48, -46, -45, -44, -43, -42, -40, -39, -38, -34, -32, -30, -27, -26, -25, -24, -21, -20, -18, -17, -14, -13, -12, -11, -3, 0, 1, 6, 7, 8, 9, 10, 12, 13, 16, 17, 19, 20, 21, 23, 24, 27, 30, 31, 34, 36, 37, 39, 40, 41, 43, 47, 48, 49, 53, 54, 55, 59, 60, 64, 65, 66, 69, 72, 73, 77, 79, 80, 82, 83, 84, 85, 87, 91, 93, 94, 97, 98]
|
||||||
47, 27, 13, 61, 75, 93, 16, 73, 22, 65, 32, 9, 33, 97, 88, 27, 87,
|
|
||||||
29, 30, 25, 48, 67, 82, 17, 38, 43, 92, 36, 44, 90, 70, 19, 88, 27,
|
|
||||||
3, 9, 67, 37, 61, 16, 54, 30, 77, 46, 68, 72, 11, 72, 76, 23, 24,
|
|
||||||
2, 35, 96, 33, 24, 10, 51, 33, 0, 37, 42, 1, 43, 58, 61]
|
|
||||||
test_data_sorted = [ 0, 0, 1, 2, 3, 4, 5, 5, 9, 9, 10, 11, 13, 15, 16, 16, 17,
|
|
||||||
17, 17, 19, 21, 22, 23, 24, 24, 25, 27, 27, 27, 29, 30, 30, 31, 32,
|
|
||||||
33, 33, 33, 35, 35, 35, 36, 37, 37, 37, 37, 38, 42, 43, 43, 44, 46,
|
|
||||||
47, 48, 48, 50, 51, 51, 54, 55, 58, 61, 61, 61, 61, 63, 65, 66, 67,
|
|
||||||
67, 67, 68, 69, 70, 70, 72, 72, 73, 75, 76, 76, 77, 79, 82, 85, 85,
|
|
||||||
87, 87, 88, 88, 88, 90, 91, 92, 92, 92, 93, 93, 96, 97, 99]
|
|
||||||
assert an.basic_stats(test_data_linear) == {"mean": 5.2, "median": 6.0, "standard-deviation": 2.85657137141714, "variance": 8.16, "minimum": 1.0, "maximum": 9.0}
|
assert an.basic_stats(test_data_linear) == {"mean": 5.2, "median": 6.0, "standard-deviation": 2.85657137141714, "variance": 8.16, "minimum": 1.0, "maximum": 9.0}
|
||||||
assert an.z_score(3.2, 6, 1.5) == -1.8666666666666665
|
assert an.z_score(3.2, 6, 1.5) == -1.8666666666666665
|
||||||
assert an.z_normalize([test_data_linear], 1).tolist() == [[0.07537783614444091, 0.22613350843332272, 0.45226701686664544, 0.5276448530110863, 0.6784005252999682]]
|
assert an.z_normalize([test_data_linear], 1).tolist() == [[0.07537783614444091, 0.22613350843332272, 0.45226701686664544, 0.5276448530110863, 0.6784005252999682]]
|
||||||
|
Loading…
Reference in New Issue
Block a user