| 806 | } |
| 807 | |
| 808 | void test_equal_error_rate() |
| 809 | { |
| 810 | auto result = equal_error_rate({}, {}); |
| 811 | DLIB_TEST(result.first == 0); |
| 812 | DLIB_TEST(result.second == 0); |
| 813 | |
| 814 | // no error case |
| 815 | result = equal_error_rate({1,1,1}, {2,2,2}); |
| 816 | DLIB_TEST_MSG(result.first == 0, result.first); |
| 817 | DLIB_TEST_MSG(result.second == 2, result.second); |
| 818 | |
| 819 | // max error case |
| 820 | result = equal_error_rate({2,2,2}, {1,1,1}); |
| 821 | DLIB_TEST_MSG(result.first == 1, result.first); |
| 822 | DLIB_TEST_MSG(result.second == 2, result.second); |
| 823 | // Another way to have max error |
| 824 | result = equal_error_rate({1,1,1}, {1,1,1}); |
| 825 | DLIB_TEST_MSG(result.second == 1, result.second); |
| 826 | DLIB_TEST_MSG(result.first == 1, result.first); |
| 827 | |
| 828 | // wildly unbalanced |
| 829 | result = equal_error_rate({}, {1,1,1}); |
| 830 | DLIB_TEST_MSG(result.first == 0, result.first); |
| 831 | |
| 832 | // wildly unbalanced |
| 833 | result = equal_error_rate({1,1,1}, {}); |
| 834 | DLIB_TEST_MSG(result.first == 0, result.first); |
| 835 | |
| 836 | // 25% error case |
| 837 | result = equal_error_rate({1,1,1,3}, {2, 2, 0, 2}); |
| 838 | DLIB_TEST_MSG(result.first == 0.25, result.first); |
| 839 | DLIB_TEST_MSG(result.second == 2, result.second); |
| 840 | } |
| 841 | |
| 842 | void test_running_stats_decayed() |
| 843 | { |
nothing calls this directly
no test coverage detected