STK++ 0.9.13
STK_Stat_ConfusionMatrix.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::StatDesc
27 * Purpose: Compute the confusion matrix
28 * Author: Serge Iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
35#ifndef STK_STAT_CONFUSIONMATRIX_H
36#define STK_STAT_CONFUSIONMATRIX_H
37
38#include "STK_Stat_Factor.h"
39
40namespace STK
41{
42namespace Stat
43{
44
49template < class TrueArray, class PredArray>
51{
52 public:
62
67 {
68 // compute nbLevels and create result
69 int min = std::min(trueClass_.minElt(), predictClass_.minElt());
70 int max = std::max(trueClass_.maxElt(), predictClass_.maxElt());
71 CSquareXi res(Range(min, max, 0), 0);
72 for (int i=trueClass_.begin(); i<trueClass_.end(); ++i)
74 return res;
75 }
76 protected:
79};
80
81
86template < class TrueArray, class PredArray>
89
90} // namespace Stat
91
92} // namespace STK
93
94#endif /*STK_STAT_CONFUSIONMATRIX_H*/
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:138
In this file we define and implement the Factor class.
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Class computing the confusion matrix given two vectors of integer.
ConfusionMatrix(TrueArray const &trueClass, PredArray const &predictClass)
default constructor
CSquareXi confusionMatrix(TrueArray const &trueClass, PredArray const &predictClass)
Utility function computing the confusion matrix given two vectors of integer.
hidden::FunctorTraits< Derived, MaxOp >::Row max(Derived const &A)
Compute the maximal(s) value(s) of A.
hidden::FunctorTraits< Derived, MinOp >::Row min(Derived const &A)
Compute the minimal(s) value(s) of A.
The namespace STK is the main domain space of the Statistical ToolKit project.
TRange< UnknownSize > Range
Definition STK_Range.h:59