mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
LearnOutput.h
1 /***************************************************************************
2  SRC/mixmod/DiscriminantAnalysis/Learn/LearnOutput.h description
3  copyright : (C) MIXMOD Team - 2001-2016
4  email : contact@mixmod.org
5  ***************************************************************************/
6 
7 /***************************************************************************
8  This file is part of MIXMOD
9 
10  MIXMOD is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MIXMOD is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with MIXMOD. If not, see <http://www.gnu.org/licenses/>.
22 
23  All informations available on : http://www.mixmod.org
24 ***************************************************************************/
25 #ifndef XEMLEARNOUTPUT_H
26 #define XEMLEARNOUTPUT_H
27 
28 #include "mixmod/Utilities/Util.h"
29 
30 namespace XEM {
31 
32 // pre-declaration
33 class Criterion;
34 class Model;
35 class LearnMain;
36 class LearnModelOutput;
37 
45 class LearnOutput {
46 
47 public:
48 
50  LearnOutput();
51 
53  LearnOutput(const LearnOutput & lOutput);
54 
56  LearnOutput( std::vector<Model*> const & estimations );
57 
59  virtual ~LearnOutput();
60 
62  bool operator ==(const LearnOutput & output) const;
63 
64  bool atLeastOneEstimationNoError() const;
65  const int getNbEstimationWithNoError() const;
66 
68  void sort(CriterionName criterionName);
69 
70  void editFile() const;
71 
74  LearnModelOutput * getLearnModelOutput(unsigned int index) const;
75 
76  std::vector<LearnModelOutput*> const & getLearnModelOutput() const;
77 
78  int64_t getNbLearnModelOutput() const;
79 
80  void setLearnModelOutput(std::vector<LearnModelOutput *> & learnModelOutput);
81 
82 private:
83 
84  // Vector containing output for each model
85  std::vector<LearnModelOutput *> _learnModelOutput;
86 };
87 
88 inline std::vector<LearnModelOutput*> const & LearnOutput::getLearnModelOutput() const {
89  return _learnModelOutput;
90 }
91 
92 inline LearnModelOutput * LearnOutput::getLearnModelOutput(unsigned int index) const {
93  if (index < _learnModelOutput.size()) {
94  return _learnModelOutput[index];
95  }
96  else {
97  THROW(InputException, wrongIndexInGetMethod);
98  }
99 }
100 
101 inline int64_t LearnOutput::getNbLearnModelOutput() const {
102  return _learnModelOutput.size();
103 }
104 
105 }
106 
107 #endif
bool operator==(const LearnOutput &output) const
Comparison operator.
Definition: LearnOutput.cpp:73
Definition: InputException.h:38
void sort(CriterionName criterionName)
sort the model output
Definition: LearnOutput.cpp:110
LearnOutput()
Default Constructor.
Definition: LearnOutput.cpp:38
CriterionName
Enumeration of Criterion type.
Definition: Util.h:303
virtual ~LearnOutput()
Destructor.
Definition: LearnOutput.cpp:64
LearnModelOutput * getLearnModelOutput(unsigned int index) const
Definition: LearnOutput.h:92
Definition: LearnOutput.h:45
Constants definitions, various utilities to describe models, and others...
Definition: LearnModelOutput.h:41