| 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, |
no test coverage detected