Project
MRSortModel.h
Go to the documentation of this file.
1 #ifndef MRSORTMODEL_H
2 #define MRSORTMODEL_H
3 
10 #include <iostream>
11 #include <string>
12 #include <vector>
13 
15 #include "Categories.h"
16 #include "Criteria.h"
17 #include "PerformanceTable.h"
18 #include "Profiles.h"
19 
37 class MRSortModel {
38 public:
48  MRSortModel(Criteria &criteria, Profiles &profiles, Categories &categories,
49  float lambda, std::string id = "model");
50 
59  MRSortModel(int n_cat, int n_crit, std::string id = "model");
60 
66  MRSortModel(const MRSortModel &mrsort);
67  ~MRSortModel();
68 
69  friend std::ostream &operator<<(std::ostream &out, const MRSortModel &mrsort);
70 
71  // TODO Remove getter and setter
72  // Performance wise after some profiling we found that getter and setter can
73  // loose a lot of time compared to access directly the variable. Therefore in
74  // order to optimize the code, they should be removed.
80  std::string getId() const;
81 
87  float getScore() const;
88 
95  void setScore(float score);
96 
106  Category categoryAssignment(std::vector<Perf> &alt,
107  std::vector<std::vector<Perf>> &profiles_pt);
108 
119 
129  float computeConcordance(std::vector<Perf> &prof, std::vector<Perf> &alt);
130 
142  std::unordered_map<std::string, std::unordered_map<std::string, float>>
144 
145  Criteria criteria;
146  Profiles profiles;
147  float lambda;
148  Categories categories;
149 
150 private:
151  std::string id_;
152  float score_;
153 };
154 
155 #endif
Dataset data structure.
Datastructure representing a set of category.
Datastructure representing a set of criterion.
PerformanceTable data structure.
Profiles data structure.
Dataset datastructure.
Definition: AlternativesPerformance.h:35
Set of Category datastructure.
Definition: Categories.h:28
Category datastructure.
Definition: Category.h:20
Set of Criterion datastructure.
Definition: Criteria.h:25
Datastructure of the model to learn.
Definition: MRSortModel.h:37
MRSortModel(Criteria &criteria, Profiles &profiles, Categories &categories, float lambda, std::string id="model")
std::string getId() const
AlternativesPerformance categoryAssignments(PerformanceTable &pt)
float getScore() const
MRSortModel(int n_cat, int n_crit, std::string id="model")
float computeConcordance(std::vector< Perf > &prof, std::vector< Perf > &alt)
Category categoryAssignment(std::vector< Perf > &alt, std::vector< std::vector< Perf >> &profiles_pt)
void setScore(float score)
std::unordered_map< std::string, std::unordered_map< std::string, float > > computeConcordanceTable(PerformanceTable &pt)
MRSortModel(const MRSortModel &mrsort)
PerformanceTable data structure.
Definition: PerformanceTable.h:37
Profiles data structure.
Definition: Profiles.h:41