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

Function is_forced_assignment_problem

dlib/svm/svm.h:291–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289 typename rhs_type
290 >
291 bool is_forced_assignment_problem (
292 const std::vector<std::pair<std::vector<lhs_type>, std::vector<rhs_type> > >& samples,
293 const std::vector<std::vector<long> >& labels
294 )
295 {
296 if (is_assignment_problem(samples, labels))
297 {
298 for (unsigned long i = 0; i < samples.size(); ++i)
299 {
300 const unsigned long N = sum(mat(labels[i]) != -1);
301 if (std::min(samples[i].first.size(), samples[i].second.size()) != N)
302 return false;
303 }
304 return true;
305 }
306
307 return false;
308 }
309
310// ----------------------------------------------------------------------------------------
311

Callers 4

test_assignment_functionFunction · 0.85
trainMethod · 0.85

Calls 5

is_assignment_problemFunction · 0.85
matFunction · 0.70
minFunction · 0.70
sumFunction · 0.50
sizeMethod · 0.45

Tested by 1

test_assignment_functionFunction · 0.68