Main Page
Module List
Reference documentation
Namespaces
Classes
Examples
distroDM
c++_api
inc
DM
IClassificationMatrix.hpp
1
#ifndef DM_ICLASSIFICATION_MATRIX_HPP_INCLUDED
2
#define DM_ICLASSIFICATION_MATRIX_HPP_INCLUDED
3
4
#ifdef _MSC_VER
5
#pragma once
6
#endif
7
8
#include "DM/config.hpp"
9
#include "DM/Handle.hpp"
10
#include "DM/ObjectBase.hpp"
11
#include "DM/Iterator.hpp"
12
13
DM_NAMESPACE_BEGIN
14
15
/// \brief Element of a cross classification matrix
16
class
DM_API
IClassificationElement
:
public
ObjectBase
17
{
18
protected
:
19
virtual
~
IClassificationElement
() {}
20
21
public
:
22
virtual
int
trueId()
const
= 0;
///< true class id
23
virtual
int
estimatedId()
const
= 0;
///< estimated class id
24
virtual
int64_t counter()
const
= 0;
///< number of elements in this element
25
};
26
27
typedef
Handle<IClassificationElement>
ClassificationElementHandle
;
28
29
/// \brief Object for storing a cross classification matrix
30
class
DM_API
IClassificationMatrix
:
public
ObjectBase
31
{
32
public
:
33
static
IClassificationMatrix
* New();
//create a new object
34
35
typedef
ConstIterator< int >
const_iterator
;
36
37
protected
:
38
virtual
~
IClassificationMatrix
() {}
39
40
public
:
41
virtual
bool
exist(
int
trueId,
int
estimatedId)
const
= 0;
42
virtual
const
IClassificationElement
&
get
(
int
trueId,
int
estimatedId)
const
= 0;
43
virtual
void
increase(
int
trueId,
int
estimatedId, int64_t inc = 1) = 0;
44
45
virtual
const_iterator
beginIds()
const
= 0;
46
virtual
const_iterator
endIds()
const
= 0;
47
};
48
49
typedef
Handle<IClassificationMatrix>
ClassificationMatrixHandle
;
50
51
52
DM_NAMESPACE_END
53
54
#endif //DM_ICLASSIFICATION_MATRIX_HPP_INCLUDED
55