summaryrefslogtreecommitdiffstats
path: root/ml/dlib/dlib/svm/multiclass_tools_abstract.h
blob: 9e7774d3f752d1c52b785eb054d77f39f1e16797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (C) 2010  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#undef DLIB_MULTICLASS_TOoLS_ABSTRACT_Hh_
#ifdef DLIB_MULTICLASS_TOoLS_ABSTRACT_Hh_

#include <vector>
#include <map>
#include "../unordered_pair.h"

namespace dlib
{

// ----------------------------------------------------------------------------------------

    template <typename label_type>
    std::vector<label_type> select_all_distinct_labels (
        const std::vector<label_type>& labels
    );
    /*!
        ensures
            - Determines all distinct values present in labels and stores them
              into a sorted vector and returns it.  They are sorted in ascending 
              order.
    !*/

// ----------------------------------------------------------------------------------------

    template <typename label_type, typename U>
    std::vector<unordered_pair<label_type> > find_missing_pairs (
        const std::map<unordered_pair<label_type>,U>& binary_decision_functions 
    );
    /*!
        ensures
            - Let L denote the set of all label_type values present in binary_decision_functions.
            - This function finds all the label pairs with both elements distinct and in L but
              not also in binary_decision_functions.  All these missing pairs are stored
              in a sorted vector and returned.  They are sorted in ascending order.
    !*/

// ----------------------------------------------------------------------------------------

}

#endif // DLIB_MULTICLASS_TOoLS_ABSTRACT_Hh_