| 142 | // ---------------------------------------------------------------------------------------- |
| 143 | |
| 144 | void test_small_features() |
| 145 | { |
| 146 | // With features 1000 times smaller, the scores shrink, but the sigmoid rescales them. |
| 147 | std::vector<sparse_type> x; |
| 148 | std::vector<double> y; |
| 149 | make_problem(x, y); |
| 150 | for (auto& sample : x) |
| 151 | { |
| 152 | for (auto& feature : sample) |
| 153 | feature.second *= 1e-3; |
| 154 | } |
| 155 | const auto df = auto_train_linear_classifier(x, y, false); |
| 156 | DLIB_TEST(df(sparse_type{{0, 3e-3}}) > 0.9); |
| 157 | DLIB_TEST(df(sparse_type{{0, -3e-3}}) < 0.1); |
| 158 | } |
| 159 | |
| 160 | // ---------------------------------------------------------------------------------------- |
| 161 |
no test coverage detected