| 942 | } |
| 943 | |
| 944 | void test_equal_error_rate() |
| 945 | { |
| 946 | auto result = equal_error_rate({}, {}); |
| 947 | DLIB_TEST(result.first == 0); |
| 948 | DLIB_TEST(result.second == 0); |
| 949 | |
| 950 | // no error case |
| 951 | result = equal_error_rate({1,1,1}, {2,2,2}); |
| 952 | DLIB_TEST_MSG(result.first == 0, result.first); |
| 953 | DLIB_TEST_MSG(result.second == 2, result.second); |
| 954 | |
| 955 | // max error case |
| 956 | result = equal_error_rate({2,2,2}, {1,1,1}); |
| 957 | DLIB_TEST_MSG(result.first == 1, result.first); |
| 958 | DLIB_TEST_MSG(result.second == 2, result.second); |
| 959 | // Another way to have max error |
| 960 | result = equal_error_rate({1,1,1}, {1,1,1}); |
| 961 | DLIB_TEST_MSG(result.second == 1, result.second); |
| 962 | DLIB_TEST_MSG(result.first == 1, result.first); |
| 963 | |
| 964 | // wildly unbalanced |
| 965 | result = equal_error_rate({}, {1,1,1}); |
| 966 | DLIB_TEST_MSG(result.first == 0, result.first); |
| 967 | |
| 968 | // wildly unbalanced |
| 969 | result = equal_error_rate({1,1,1}, {}); |
| 970 | DLIB_TEST_MSG(result.first == 0, result.first); |
| 971 | |
| 972 | // 25% error case |
| 973 | result = equal_error_rate({1,1,1,3}, {2, 2, 0, 2}); |
| 974 | DLIB_TEST_MSG(result.first == 0.25, result.first); |
| 975 | DLIB_TEST_MSG(result.second == 2, result.second); |
| 976 | } |
| 977 | |
| 978 | void test_running_stats_decayed() |
| 979 | { |
nothing calls this directly
no test coverage detected