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

Function is_binary_classification_problem_impl

dlib/svm/svm.h:61–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 typename U
60 >
61 bool is_binary_classification_problem_impl (
62 const T& x,
63 const U& x_labels
64 )
65 {
66 bool seen_neg_class = false;
67 bool seen_pos_class = false;
68
69 if (is_learning_problem_impl(x,x_labels) == false)
70 return false;
71
72 if (x.size() <= 1) return false;
73
74 for (long r = 0; r < x_labels.nr(); ++r)
75 {
76 if (x_labels(r) != -1 && x_labels(r) != 1)
77 return false;
78
79 if (x_labels(r) == 1)
80 seen_pos_class = true;
81 if (x_labels(r) == -1)
82 seen_neg_class = true;
83 }
84
85 return seen_pos_class && seen_neg_class;
86 }
87
88 template <
89 typename T,

Callers 1

Calls 3

is_learning_problem_implFunction · 0.85
sizeMethod · 0.45
nrMethod · 0.45

Tested by

no test coverage detected