MCPcopy Create free account
hub / github.com/davisking/dlib / test_small_features

Function test_small_features

dlib/test/auto_train_linear_classifier.cpp:144–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

perform_testMethod · 0.85

Calls 2

make_problemFunction · 0.85

Tested by

no test coverage detected