You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.hpp 72KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050
  1. ///-------------------------------------------------------------------------------------------------
  2. ///
  3. /// \file init.hpp
  4. /// \brief Some constants Initialisation functions for google tests
  5. /// \author Thibaut Monseigne (Inria).
  6. /// \version 0.1.
  7. /// \date 26/10/2018.
  8. /// \copyright <a href="https://choosealicense.com/licenses/agpl-3.0/">GNU Affero General Public License v3.0</a>.
  9. /// \remarks
  10. /// - For this tests I compare the results with the <a href="https://github.com/alexandrebarachant/pyRiemann">pyRiemann</a> Python library (<a href="https://github.com/alexandrebarachant/pyRiemann/blob/master/LICENSE">License</a>) or <a href="http://scikit-learn.org">sklearn</a> if pyRiemman just redirect the function.
  11. /// - For the adaptation Classification tests I compare the results with the <a href="https://github.com/alexandrebarachant/covariancetoolbox">covariancetoolbox</a> Matlab library (<a href="https://github.com/alexandrebarachant/covariancetoolbox/blob/master/COPYING">License</a>).
  12. ///
  13. ///-------------------------------------------------------------------------------------------------
  14. #pragma once
  15. #include <vector>
  16. #include <unsupported/Eigen/MatrixFunctions> // SQRT of Matrix
  17. #include <geometry/classifier/CMatrixClassifierMDM.hpp>
  18. #include <geometry/classifier/CMatrixClassifierFgMDMRT.hpp>
  19. #include <geometry/classifier/CMatrixClassifierMDMRebias.hpp>
  20. #include <geometry/classifier/CMatrixClassifierFgMDM.hpp>
  21. #include <geometry/classifier/CMatrixClassifierFgMDMRTRebias.hpp>
  22. #include "geometry/artifacts/CASR.hpp"
  23. #define NB_CLASS 02
  24. #define NB_CHAN 03
  25. #define NB_SAMPLE 10
  26. #define NB_TRIALS1 07
  27. #define NB_TRIALS2 05
  28. #define NB_TRIALS 12 // NB_TRIALS1 + NB_TRIALS2
  29. #define NB_FEATURES 06 // NB_CHAN * (NB_CHAN + 1) / 2
  30. //*********************************************
  31. //********** Initialisation Datasets **********
  32. //*********************************************
  33. namespace InitDataset {
  34. inline std::vector<Eigen::MatrixXd> FirstClassDataset()
  35. {
  36. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  37. for (auto& m : result) { m.resize(NB_CHAN, NB_SAMPLE); }
  38. result[0] << -3, -4, -5, -4, -6, -1, -4, -1, -3, -1,
  39. 0, -3, -3, 1, -2, 1, -2, 1, -1, -1,
  40. 1, 0, 0, 1, 0, 1, 0, 1, 1, 1;
  41. result[1] << -1, -4, -5, -4, -6, -6, -3, -3, -6, -4,
  42. -3, -1, 0, -3, 0, 0, -2, -2, -3, -3,
  43. 0, 1, 1, 0, 0, 0, 0, 0, 1, 0;
  44. result[2] << -4, -2, -4, -5, -3, -1, -6, -3, -3, -4,
  45. 0, -3, -2, -2, -3, 0, -1, -2, -1, -2,
  46. 1, 1, 1, 1, 1, 1, 1, 1, 1, 0;
  47. result[3] << -5, -3, -1, -1, -2, -4, -1, -6, -4, -4,
  48. 0, 0, -2, -2, -2, 0, 0, -1, 0, 0,
  49. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0;
  50. result[4] << -2, -1, -5, -2, -6, -5, -6, -4, -6, -6,
  51. -1, -3, -2, -3, -1, -1, 1, 0, 0, -3,
  52. 0, 1, 1, 0, 0, 1, 1, 0, 0, 1;
  53. result[5] << -5, -3, -4, -1, -3, -6, -5, -3, -2, -5,
  54. -2, -3, 1, -3, -1, -2, 0, -1, 1, -2,
  55. 0, 0, 1, 1, 0, 1, 1, 1, 1, 0;
  56. result[6] << -3, -3, -1, -4, -1, -6, -2, -5, -3, -3,
  57. -1, -3, -2, 1, 0, 0, -3, -3, -3, 1,
  58. 0, 1, 1, 1, 0, 0, 1, 0, 0, 0;
  59. return result;
  60. }
  61. inline std::vector<Eigen::MatrixXd> SecondClassDataset()
  62. {
  63. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  64. for (auto& m : result) { m.resize(NB_CHAN, NB_SAMPLE); }
  65. result[0] << 0, 3, 1, 1, 2, 3, 1, 3, 3, 2,
  66. 0, 1, 1, -1, -2, 0, -2, 1, 2, 0,
  67. 4, 3, 3, 3, 4, 4, 4, 5, 4, 3;
  68. result[1] << 3, 2, 1, 2, 1, 2, 3, 3, 1, 4,
  69. -2, -2, -1, 0, 0, -1, 3, 0, -1, 3,
  70. 4, 4, 3, 4, 3, 5, 5, 4, 5, 4;
  71. result[2] << 3, 2, 3, 3, 0, 0, 0, 1, 2, 3,
  72. 3, 2, 0, 3, 3, -2, 3, 3, -2, 2,
  73. 5, 3, 4, 4, 5, 4, 3, 3, 5, 4;
  74. result[3] << 0, 3, 1, 4, 3, 1, 2, 3, 0, 0,
  75. -2, 1, 1, 0, 2, -1, 3, -1, 2, -2,
  76. 3, 3, 5, 4, 4, 4, 5, 4, 5, 5;
  77. result[4] << 1, 2, 1, 2, 2, 0, 0, 0, 0, 4,
  78. 1, 3, 0, -2, 1, 0, 0, 2, -2, 2,
  79. 5, 3, 5, 5, 5, 3, 4, 4, 3, 3;
  80. return result;
  81. }
  82. inline std::vector<std::vector<Eigen::MatrixXd>> Dataset()
  83. {
  84. std::vector<std::vector<Eigen::MatrixXd>> result;
  85. result.resize(NB_CLASS);
  86. result[0] = FirstClassDataset();
  87. result[1] = SecondClassDataset();
  88. return result;
  89. }
  90. inline std::vector<Eigen::MatrixXd> DatasetInOneVector()
  91. {
  92. std::vector<Eigen::MatrixXd> result = FirstClassDataset(), s2 = SecondClassDataset();
  93. result.insert(result.end(), std::make_move_iterator(s2.begin()), std::make_move_iterator(s2.end()));
  94. return result;
  95. }
  96. } // namespace InitDataset
  97. //*****************************************************************
  98. //********** Initialisation Basics Reference of Datasets **********
  99. //*****************************************************************
  100. namespace InitBasics {
  101. namespace Center {
  102. inline std::vector<Eigen::MatrixXd> FirstClassReference()
  103. {
  104. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  105. for (auto& m : result) { m.resize(NB_CHAN, NB_SAMPLE); }
  106. result[0] << 0.2, -0.8, -1.8, -0.8, -2.8, 2.2, -0.8, 2.2, 0.2, 2.2,
  107. 0.9, -2.1, -2.1, 1.9, -1.1, 1.9, -1.1, 1.9, -0.1, -0.1,
  108. 0.4, -0.6, -0.6, 0.4, -0.6, 0.4, -0.6, 0.4, 0.4, 0.4;
  109. result[1] << 3.2, 0.2, -0.8, 0.2, -1.8, -1.8, 1.2, 1.2, -1.8, 0.2,
  110. -1.3, 0.7, 1.7, -1.3, 1.7, 1.7, -0.3, -0.3, -1.3, -1.3,
  111. -0.3, 0.7, 0.7, -0.3, -0.3, -0.3, -0.3, -0.3, 0.7, -0.3;
  112. result[2] << -0.5, 1.5, -0.5, -1.5, 0.5, 2.5, -2.5, 0.5, 0.5, -0.5,
  113. 1.6, -1.4, -0.4, -0.4, -1.4, 1.6, 0.6, -0.4, 0.6, -0.4,
  114. 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, -0.9;
  115. result[3] << -1.9, 0.1, 2.1, 2.1, 1.1, -0.9, 2.1, -2.9, -0.9, -0.9,
  116. 0.7, 0.7, -1.3, -1.3, -1.3, 0.7, 0.7, -0.3, 0.7, 0.7,
  117. 0.9, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1, -0.1;
  118. result[4] << 2.3, 3.3, -0.7, 2.3, -1.7, -0.7, -1.7, 0.3, -1.7, -1.7,
  119. 0.3, -1.7, -0.7, -1.7, 0.3, 0.3, 2.3, 1.3, 1.3, -1.7,
  120. -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5;
  121. result[5] << -1.3, 0.7, -0.3, 2.7, 0.7, -2.3, -1.3, 0.7, 1.7, -1.3,
  122. -0.8, -1.8, 2.2, -1.8, 0.2, -0.8, 1.2, 0.2, 2.2, -0.8,
  123. -0.6, -0.6, 0.4, 0.4, -0.6, 0.4, 0.4, 0.4, 0.4, -0.6;
  124. result[6] << 0.1, 0.1, 2.1, -0.9, 2.1, -2.9, 1.1, -1.9, 0.1, 0.1,
  125. 0.3, -1.7, -0.7, 2.3, 1.3, 1.3, -1.7, -1.7, -1.7, 2.3,
  126. -0.4, 0.6, 0.6, 0.6, -0.4, -0.4, 0.6, -0.4, -0.4, -0.4;
  127. return result;
  128. }
  129. inline std::vector<Eigen::MatrixXd> SecondClassReference()
  130. {
  131. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  132. for (auto& m : result) { m.resize(NB_CHAN, NB_SAMPLE); }
  133. result[0] << -1.9, 1.1, -0.9, -0.9, 0.1, 1.1, -0.9, 1.1, 1.1, 0.1,
  134. 0.0, 1.0, 1.0, -1.0, -2.0, 0.0, -2.0, 1.0, 2.0, 0.0,
  135. 0.3, -0.7, -0.7, -0.7, 0.3, 0.3, 0.3, 1.3, 0.3, -0.7;
  136. result[1] << 0.8, -0.2, -1.2, -0.2, -1.2, -0.2, 0.8, 0.8, -1.2, 1.8,
  137. -1.9, -1.9, -0.9, 0.1, 0.1, -0.9, 3.1, 0.1, -0.9, 3.1,
  138. -0.1, -0.1, -1.1, -0.1, -1.1, 0.9, 0.9, -0.1, 0.9, -0.1;
  139. result[2] << 1.3, 0.3, 1.3, 1.3, -1.7, -1.7, -1.7, -0.7, 0.3, 1.3,
  140. 1.5, 0.5, -1.5, 1.5, 1.5, -3.5, 1.5, 1.5, -3.5, 0.5,
  141. 1.0, -1.0, 0.0, 0.0, 1.0, 0.0, -1.0, -1.0, 1.0, 0.;
  142. result[3] << -1.7, 1.3, -0.7, 2.3, 1.3, -0.7, 0.3, 1.3, -1.7, -1.7,
  143. -2.3, 0.7, 0.7, -0.3, 1.7, -1.3, 2.7, -1.3, 1.7, -2.3,
  144. -1.2, -1.2, 0.8, -0.2, -0.2, -0.2, 0.8, -0.2, 0.8, 0.8;
  145. result[4] << -0.2, 0.8, -0.2, 0.8, 0.8, -1.2, -1.2, -1.2, -1.2, 2.8,
  146. 0.5, 2.5, -0.5, -2.5, 0.5, -0.5, -0.5, 1.5, -2.5, 1.5,
  147. 1.0, -1.0, 1.0, 1.0, 1.0, -1.0, 0.0, 0.0, -1.0, -1.;
  148. return result;
  149. }
  150. inline std::vector<std::vector<Eigen::MatrixXd>> Reference()
  151. {
  152. std::vector<std::vector<Eigen::MatrixXd>> result;
  153. result.resize(2);
  154. result[0] = FirstClassReference();
  155. result[1] = SecondClassReference();
  156. return result;
  157. }
  158. } // namespace Center
  159. namespace StandardScaler {
  160. inline std::vector<Eigen::MatrixXd> FirstClassReference()
  161. {
  162. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  163. for (auto& m : result) { m.resize(NB_CHAN, NB_SAMPLE); }
  164. result[0] << -3, -4, -5, -4, -6, -1, -4, -1, -3, -1,
  165. 0, -3, -3, 1, -2, 1, -2, 1, -1, -1,
  166. 1, 0, 0, 1, 0, 1, 0, 1, 1, 1;
  167. result[1] << -1, -4, -5, -4, -6, -6, -3, -3, -6, -4,
  168. -3, -1, 0, -3, 0, 0, -2, -2, -3, -3,
  169. 0, 1, 1, 0, 0, 0, 0, 0, 1, 0;
  170. result[2] << -4, -2, -4, -5, -3, -1, -6, -3, -3, -4,
  171. 0, -3, -2, -2, -3, 0, -1, -2, -1, -2,
  172. 1, 1, 1, 1, 1, 1, 1, 1, 1, 0;
  173. result[3] << -5, -3, -1, -1, -2, -4, -1, -6, -4, -4,
  174. 0, 0, -2, -2, -2, 0, 0, -1, 0, 0,
  175. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0;
  176. result[4] << -2, -1, -5, -2, -6, -5, -6, -4, -6, -6,
  177. -1, -3, -2, -3, -1, -1, 1, 0, 0, -3,
  178. 0, 1, 1, 0, 0, 1, 1, 0, 0, 1;
  179. result[5] << -5, -3, -4, -1, -3, -6, -5, -3, -2, -5,
  180. -2, -3, 1, -3, -1, -2, 0, -1, 1, -2,
  181. 0, 0, 1, 1, 0, 1, 1, 1, 1, 0;
  182. result[6] << -3, -3, -1, -4, -1, -6, -2, -5, -3, -3,
  183. -1, -3, -2, 1, 0, 0, -3, -3, -3, 1,
  184. 0, 1, 1, 1, 0, 0, 1, 0, 0, 0;
  185. return result;
  186. }
  187. inline std::vector<Eigen::MatrixXd> SecondClassReference()
  188. {
  189. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  190. for (auto& m : result) { m.resize(NB_CHAN, NB_SAMPLE); }
  191. result[0] << 0, 3, 1, 1, 2, 3, 1, 3, 3, 2,
  192. 0, 1, 1, -1, -2, 0, -2, 1, 2, 0,
  193. 4, 3, 3, 3, 4, 4, 4, 5, 4, 3;
  194. result[1] << 3, 2, 1, 2, 1, 2, 3, 3, 1, 4,
  195. -2, -2, -1, 0, 0, -1, 3, 0, -1, 3,
  196. 4, 4, 3, 4, 3, 5, 5, 4, 5, 4;
  197. result[2] << 3, 2, 3, 3, 0, 0, 0, 1, 2, 3,
  198. 3, 2, 0, 3, 3, -2, 3, 3, -2, 2,
  199. 5, 3, 4, 4, 5, 4, 3, 3, 5, 4;
  200. result[3] << 0, 3, 1, 4, 3, 1, 2, 3, 0, 0,
  201. -2, 1, 1, 0, 2, -1, 3, -1, 2, -2,
  202. 3, 3, 5, 4, 4, 4, 5, 4, 5, 5;
  203. result[4] << 1, 2, 1, 2, 2, 0, 0, 0, 0, 4,
  204. 1, 3, 0, -2, 1, 0, 0, 2, -2, 2,
  205. 5, 3, 5, 5, 5, 3, 4, 4, 3, 3;
  206. return result;
  207. }
  208. inline std::vector<std::vector<Eigen::MatrixXd>> Reference()
  209. {
  210. std::vector<std::vector<Eigen::MatrixXd>> result;
  211. result.resize(2);
  212. result[0] = FirstClassReference();
  213. result[1] = SecondClassReference();
  214. return result;
  215. }
  216. } // namespace StandardScaler
  217. } // namespace InitBasics
  218. //*********************************************************************
  219. //********** Initialisation Covariance Reference of Datasets **********
  220. //*********************************************************************
  221. namespace InitCovariance {
  222. //*********************************
  223. //********* COR Reference *********
  224. //*********************************
  225. namespace COR {
  226. inline std::vector<Eigen::MatrixXd> FirstClassDataset()
  227. {
  228. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  229. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  230. result[0] << 1.00, 0.644381009, 0.76178344,
  231. 0.644381009, 1.00, 0.863289805,
  232. 0.76178344, 0.863289805, 1.00;
  233. result[1] << 1.00, -0.533536825, -0.340914594,
  234. -0.533536825, 1.00, 0.189177769,
  235. -0.340914594, 0.189177769, 1.00;
  236. result[2] << 1.00, -0.00, 0.12253577,
  237. -0.00, 1.00, 0.13074409,
  238. 0.12253577, 0.13074409, 1.00;
  239. result[3] << 1.00, -0.503267974, -0.37254902,
  240. -0.503267974, 1.00, 0.259259259,
  241. -0.37254902, 0.259259259, 1.00;
  242. result[4] << 1.00, -0.478994453, -0.162459108,
  243. -0.478994453, 1.00, -0.222988244,
  244. -0.162459108, -0.222988244, 1.00;
  245. result[5] << 1.00, -0.0192192227, 0.164770511,
  246. -0.0192192227, 1.00, 0.466569475,
  247. 0.164770511, 0.466569475, 1.00;
  248. result[6] << 1.00, -0.134982027, 0.323733677,
  249. -0.134982027, 1.00, -0.227429413,
  250. 0.323733677, -0.227429413, 1.00;
  251. return result;
  252. }
  253. inline std::vector<Eigen::MatrixXd> SecondClassDataset()
  254. {
  255. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  256. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  257. result[0] << 1.00, 0.4543369, 0.25429847,
  258. 0.4543369, 1.00, 0.00,
  259. 0.25429847, 0.00, 1.00;
  260. result[1] << 1.00, 0.55233592, 0.26244533,
  261. 0.55233592, 1.00, 0.17647059,
  262. 0.26244533, 0.17647059, 1.00;
  263. result[2] << 1.00, 0.06024874, 0.20348923,
  264. 0.06024874, 1.00, -0.26318068,
  265. 0.20348923, -0.26318068, 1.00;
  266. result[3] << 1.00, 0.290334, -0.32046963,
  267. 0.290334, 1.00, 0.35075632,
  268. -0.32046963, 0.35075632, 1.00;
  269. result[4] << 1.00, 0.35805744, 0.00,
  270. 0.35805744, 1.00, -0.21428571,
  271. 0.00, -0.21428571, 1.00;
  272. return result;
  273. }
  274. inline std::vector<std::vector<Eigen::MatrixXd>> Dataset()
  275. {
  276. std::vector<std::vector<Eigen::MatrixXd>> result;
  277. result.resize(2);
  278. result[0] = FirstClassDataset();
  279. result[1] = SecondClassDataset();
  280. return result;
  281. }
  282. } // namespace COR
  283. //*********************************
  284. //********* COV Reference *********
  285. //*********************************
  286. namespace COV {
  287. inline std::vector<Eigen::MatrixXd> FirstClassDataset()
  288. {
  289. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  290. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  291. result[0] << 2.76, 1.62, 0.62,
  292. 1.62, 2.29, 0.64,
  293. 0.62, 0.64, 0.24;
  294. result[1] << 2.36, -1.04, -0.24,
  295. -1.04, 1.61, 0.11,
  296. -0.24, 0.11, 0.21;
  297. result[2] << 1.85, -0.00, 0.05,
  298. -0.00, 1.04, 0.04,
  299. 0.05, 0.04, 0.09;
  300. result[3] << 2.89, -0.77, -0.19,
  301. -0.77, 0.81, 0.07,
  302. -0.19, 0.07, 0.09;
  303. result[4] << 3.41, -1.19, -0.15,
  304. -1.19, 1.81, -0.15,
  305. -0.15, -0.15, 0.25;
  306. result[5] << 2.21, -0.04, 0.12,
  307. -0.04, 1.96, 0.32,
  308. 0.12, 0.32, 0.24;
  309. result[6] << 2.29, -0.33, 0.24,
  310. -0.33, 2.61, -0.18,
  311. 0.24, -0.18, 0.24;
  312. return result;
  313. }
  314. inline std::vector<Eigen::MatrixXd> SecondClassDataset()
  315. {
  316. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  317. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  318. result[0] << 1.09, 0.60, 0.17,
  319. 0.60, 1.60, 0.00,
  320. 0.17, 0.00, 0.41;
  321. result[1] << 0.96, 0.92, 0.18,
  322. 0.92, 2.89, 0.21,
  323. 0.18, 0.21, 0.49;
  324. result[2] << 1.61, 0.15, 0.20,
  325. 0.15, 3.85, -0.40,
  326. 0.20, -0.40, 0.60;
  327. result[3] << 2.01, 0.69, -0.34,
  328. 0.69, 2.81, 0.44,
  329. -0.34, 0.44, 0.56;
  330. result[4] << 1.56, 0.70, 0.00,
  331. 0.70, 2.45, -0.30,
  332. 0.00, -0.30, 0.80;
  333. return result;
  334. }
  335. inline std::vector<std::vector<Eigen::MatrixXd>> Dataset()
  336. {
  337. std::vector<std::vector<Eigen::MatrixXd>> result;
  338. result.resize(2);
  339. result[0] = FirstClassDataset();
  340. result[1] = SecondClassDataset();
  341. return result;
  342. }
  343. } // namespace COV
  344. //*********************************
  345. //********* LWF Reference *********
  346. //*********************************
  347. namespace LWF {
  348. inline std::vector<Eigen::MatrixXd> FirstClassReference()
  349. {
  350. std::vector<Eigen::MatrixXd> result(7);
  351. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  352. result[0] << 2.5849288, 1.33543611, 0.511092833,
  353. 1.33543611, 2.19748746, 0.527579698,
  354. 0.511092833, 0.527579698, 0.507583739;
  355. result[1] << 1.99839975, -0.650968006, -0.150223386,
  356. -0.650968006, 1.52895167, 0.0688523853,
  357. -0.150223386, 0.0688523853, 0.652648582;
  358. result[2] << 1.21758058, -0.00, 0.013088361,
  359. -0.00, 1.00554914, 0.0104706888,
  360. 0.013088361, 0.0104706888, 0.756870279;
  361. result[3] << 2.57527815, -0.621023059, -0.153239456,
  362. -0.621023059, 0.897709368, 0.0564566417,
  363. -0.153239456, 0.0564566417, 0.317012482;
  364. result[4] << 2.87232755, -0.786745664, -0.0991696216,
  365. -0.786745664, 1.81451826, -0.0991696216,
  366. -0.0991696216, -0.0991696216, 0.783154191;
  367. result[5] << 1.64826027, -0.00963569008, 0.0289070702,
  368. -0.00963569008, 1.5880372, 0.0770855206,
  369. 0.0289070702, 0.0770855206, 1.17370253;
  370. result[6] << 1.9742694, -0.149321794, 0.108597668,
  371. -0.149321794, 2.11906629, -0.081448251,
  372. 0.108597668, -0.081448251, 1.04666432;
  373. return result;
  374. }
  375. inline std::vector<Eigen::MatrixXd> SecondClassReference()
  376. {
  377. std::vector<Eigen::MatrixXd> result(5);
  378. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  379. result[0] << 1.06313148, 0.315509839, 0.0893944544,
  380. 0.315509839, 1.33131485, 0.00,
  381. 0.0893944544, 0.00, 0.705553667;
  382. result[1] << 1.18724478, 0.490413981, 0.0959505616,
  383. 0.490413981, 2.21604802, 0.111942322,
  384. 0.0959505616, 0.111942322, 0.936707201;
  385. result[2] << 1.86743369, 0.055816941, 0.074422588,
  386. 0.055816941, 2.70096668, -0.148845176,
  387. 0.074422588, -0.148845176, 1.49159963;
  388. result[3] << 1.89536719, 0.324938579, -0.160114662,
  389. 0.324938579, 2.27210757, 0.20720721,
  390. -0.160114662, 0.20720721, 1.21252525;
  391. result[4] << 1.60313579, 0.00319114656, 0.00,
  392. 0.00319114656, 1.6071931, -0.00136763424,
  393. 0.00, -0.00136763424, 1.59967111;
  394. return result;
  395. }
  396. inline std::vector<std::vector<Eigen::MatrixXd>> Reference()
  397. {
  398. std::vector<std::vector<Eigen::MatrixXd>> result;
  399. result.resize(2);
  400. result[0] = FirstClassReference();
  401. result[1] = SecondClassReference();
  402. return result;
  403. }
  404. } // namespace LWF
  405. //*********************************
  406. //********* MCD Reference *********
  407. //*********************************
  408. namespace MCD {
  409. inline std::vector<Eigen::MatrixXd> FirstClassReference()
  410. {
  411. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  412. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  413. result[0] << 2.00, 2.14285714, 0.57142857,
  414. 2.14285714, 2.57142857, 0.71428571,
  415. 0.57142857, 0.71428571, 0.24489796;
  416. result[1] << 2.85714286, -1.85714286, -0.14285714,
  417. -1.85714286, 1.26530612, 0.18367347,
  418. -0.14285714, 0.18367347, 0.20408163;
  419. result[2] << 1.55102041, -0.69387755, 0.02040816,
  420. -0.69387755, 0.40816327, -0.02040816,
  421. 0.02040816, -0.02040816, 0.12244898;
  422. result[3] << 1.63265306, -1.18367347, 0.00,
  423. -1.18367347, 0.97959184, 0.00,
  424. 0.00, 0.00, 0.00;
  425. result[4] << 0.53061224, 0.06122449, -0.04081633,
  426. 0.06122449, 1.55102041, -0.2244898,
  427. -0.04081633, -0.2244898, 0.24489796;
  428. result[5] << 1.26530612, 0.40816327, 0.08163265,
  429. 0.40816327, 2.12244898, 0.65306122,
  430. 0.08163265, 0.65306122, 0.24489796;
  431. result[6] << 1.67346939, 0.7755102, 0.24489796,
  432. 0.7755102, 1.26530612, -0.2244898,
  433. 0.24489796, -0.2244898, 0.24489796;
  434. return result;
  435. }
  436. inline std::vector<Eigen::MatrixXd> SecondClassReference()
  437. {
  438. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  439. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  440. result[0] << 0.69387755, 0.36734694, 0.06122449,
  441. 0.36734694, 1.3877551, -0.3877551,
  442. 0.06122449, -0.3877551, 0.24489796;
  443. result[1] << 0.48979592, -0.28571429, 0.14285714,
  444. -0.28571429, 0.57142857, -0.14285714,
  445. 0.14285714, -0.14285714, 0.57142857;
  446. result[2] << 1.63265306, -0.2244898, 0.24489796,
  447. -0.2244898, 0.20408163, 0.10204082,
  448. 0.24489796, 0.10204082, 0.69387755;
  449. result[3] << 1.71428571, -0.42857143, -0.42857143,
  450. -0.42857143, 2.12244898, 0.48979592,
  451. -0.42857143, 0.48979592, 0.24489796;
  452. result[4] << 0.53061224, 0.26530612, 0.48979592,
  453. 0.26530612, 1.34693878, 0.53061224,
  454. 0.48979592, 0.53061224, 0.69387755;
  455. return result;
  456. }
  457. inline std::vector<std::vector<Eigen::MatrixXd>> Reference()
  458. {
  459. std::vector<std::vector<Eigen::MatrixXd>> result;
  460. result.resize(2);
  461. result[0] = FirstClassReference();
  462. result[1] = SecondClassReference();
  463. return result;
  464. }
  465. } // namespace MCD
  466. //*********************************
  467. //********* OAS Reference *********
  468. //*********************************
  469. namespace OAS {
  470. inline std::vector<Eigen::MatrixXd> FirstClassReference()
  471. {
  472. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  473. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  474. result[0] << 2.34520102, 0.945778241, 0.361964512,
  475. 0.945778241, 2.07080856, 0.373640786,
  476. 0.361964512, 0.373640786, 0.87399042;
  477. result[1] << 1.83506857, -0.475246188, -0.109672197,
  478. -0.475246188, 1.49234296, 0.0502664238,
  479. -0.109672197, 0.0502664238, 0.852588472;
  480. result[2] << 1.18111558, -0.00, 0.0109600534,
  481. -0.00, 1.00356272, 0.00876804276,
  482. 0.0109600534, 0.00876804276, 0.795321701;
  483. result[3] << 2.22680827, -0.45607113, -0.112537032,
  484. -0.45607113, 0.994823924, 0.0414610118,
  485. -0.112537032, 0.0414610118, 0.568367802;
  486. result[4] << 2.53874679, -0.536560096, -0.0676336255,
  487. -0.536560096, 1.81732146, -0.0676336255,
  488. -0.0676336255, -0.0676336255, 1.11393175;
  489. result[5] << 1.47, -0.00, 0.00,
  490. -0.00, 1.47, 0.00,
  491. 0.00, 0.00, 1.47;
  492. result[6] << 1.73914927, -0.0147732834, 0.0107442061,
  493. -0.0147732834, 1.75347488, -0.0080581546,
  494. 0.0107442061, -0.0080581546, 1.64737585;
  495. return result;
  496. }
  497. inline std::vector<Eigen::MatrixXd> SecondClassReference()
  498. {
  499. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  500. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  501. result[0] << 1.04056757, 0.07659782, 0.02170272,
  502. 0.07659782, 1.10567572, 0.00,
  503. 0.02170272, 0.00, 0.95375671;
  504. result[1] << 1.22291898, 0.42297509, 0.08275599,
  505. 0.42297509, 2.11024714, 0.09654866,
  506. 0.08275599, 0.09654866, 1.00683388;
  507. result[2] << 1.95254699, 0.02467793, 0.03290391,
  508. 0.02467793, 2.32107076, -0.06580782,
  509. 0.03290391, -0.06580782, 1.78638225;
  510. result[3] << 1.80811047, 0.04705949, -0.02318873,
  511. 0.04705949, 1.86267219, 0.03000895,
  512. -0.02318873, 0.03000895, 1.70921734;
  513. result[4] << 1.60333333, 0.00, 0.00,
  514. 0.00, 1.60333333, -0.00,
  515. 0.00, -0.00, 1.60333333;
  516. return result;
  517. }
  518. inline std::vector<std::vector<Eigen::MatrixXd>> Reference()
  519. {
  520. std::vector<std::vector<Eigen::MatrixXd>> result;
  521. result.resize(2);
  522. result[0] = FirstClassReference();
  523. result[1] = SecondClassReference();
  524. return result;
  525. }
  526. } // namespace OAS
  527. //*********************************
  528. //********* SCM Reference *********
  529. //*********************************
  530. namespace SCM {
  531. inline std::vector<Eigen::MatrixXd> FirstClassReference()
  532. {
  533. std::vector<Eigen::MatrixXd> result(NB_TRIALS1);
  534. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  535. result[0] << 0.77844311, 0.26946108, -0.07784431,
  536. 0.26946108, 0.18562874, 0.00598802,
  537. -0.07784431, 0.00598802, 0.03592814;
  538. result[1] << 0.80645161, 0.24596774, -0.06048387,
  539. 0.24596774, 0.18145161, -0.01612903,
  540. -0.06048387, -0.01612903, 0.01209677;
  541. result[2] << 0.75806452, 0.30107527, -0.16666667,
  542. 0.30107527, 0.19354839, -0.07526882,
  543. -0.16666667, -0.07526882, 0.0483871;
  544. result[3] << 0.89928058, 0.10071942, -0.03597122,
  545. 0.10071942, 0.09352518, 0.00,
  546. -0.03597122, 0.00, 0.00719424;
  547. result[4] << 0.84555985, 0.16988417, -0.08880309,
  548. 0.16988417, 0.13513514, -0.03088803,
  549. -0.08880309, -0.03088803, 0.01930502;
  550. result[5] << 0.79899497, 0.22110553, -0.10552764,
  551. 0.22110553, 0.17085427, -0.0201005,
  552. -0.10552764, -0.0201005, 0.03015075;
  553. result[6] << 0.71686747, 0.22289157, -0.06024096,
  554. 0.22289157, 0.25903614, -0.04216867,
  555. -0.06024096, -0.04216867, 0.02409639;
  556. return result;
  557. }
  558. inline std::vector<Eigen::MatrixXd> SecondClassReference()
  559. {
  560. std::vector<Eigen::MatrixXd> result(NB_TRIALS2);
  561. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  562. result[0] << 0.23039216, 0.02941176, 0.35294118,
  563. 0.02941176, 0.07843137, 0.00,
  564. 0.35294118, 0.00, 0.69117647;
  565. result[1] << 0.22307692, 0.02692308, 0.35384615,
  566. 0.02692308, 0.11153846, -0.00769231,
  567. 0.35384615, -0.00769231, 0.66538462;
  568. result[2] << 0.16544118, 0.09926471, 0.25735294,
  569. 0.09926471, 0.22426471, 0.20588235,
  570. 0.25735294, 0.20588235, 0.61029412;
  571. result[3] << 0.18846154, 0.04615385, 0.26153846,
  572. 0.04615385, 0.11153846, 0.06538462,
  573. 0.26153846, 0.06538462, 0.70;
  574. result[4] << 0.13333333, 0.05777778, 0.21333333,
  575. 0.05777778, 0.12, 0.07555556,
  576. 0.21333333, 0.07555556, 0.74666667;
  577. return result;
  578. }
  579. inline std::vector<std::vector<Eigen::MatrixXd>> Reference()
  580. {
  581. std::vector<std::vector<Eigen::MatrixXd>> result;
  582. result.resize(2);
  583. result[0] = FirstClassReference();
  584. result[1] = SecondClassReference();
  585. return result;
  586. }
  587. } // namespace SCM
  588. } // namespace InitCovariance
  589. //****************************************************************
  590. //********** Initialisation Means Reference of Datasets **********
  591. //****************************************************************
  592. namespace InitMeans {
  593. //************************************
  594. //********** Mean Euclidian **********
  595. //************************************
  596. namespace Euclidian {
  597. inline Eigen::MatrixXd Reference()
  598. {
  599. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  600. result << 1.87394645, 0.02563437, 0.0298922,
  601. 0.02563437, 1.7732458, 0.06073032,
  602. 0.0298922, 0.06073032, 0.93197441;
  603. return result;
  604. }
  605. } // namespace Euclidian
  606. //****************************************
  607. //********** Mean Log Euclidian **********
  608. //****************************************
  609. namespace LogEuclidian {
  610. inline Eigen::MatrixXd Reference()
  611. {
  612. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  613. result << 1.7137077, 0.01869396, 0.02040996,
  614. 0.01869396, 1.60430933, 0.0512624,
  615. 0.02040996, 0.0512624, 0.82767414;
  616. return result;
  617. }
  618. } // namespace LogEuclidian
  619. //**********************************
  620. //********** Mean Riemann **********
  621. //**********************************
  622. namespace Riemann {
  623. inline Eigen::MatrixXd Reference()
  624. {
  625. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  626. result << 1.70952664, 0.01674082, 0.02077766,
  627. 0.01674082, 1.60344581, 0.05423902,
  628. 0.02077766, 0.05423902, 0.8303257;
  629. return result;
  630. }
  631. } // namespace Riemann
  632. //******************************************
  633. //********** Mean Log Determinant **********
  634. //******************************************
  635. namespace LogDeterminant {
  636. inline Eigen::MatrixXd Reference()
  637. {
  638. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  639. result << 1.70798275, 0.01610538, 0.02003787,
  640. 0.01610538, 1.60581809, 0.05385499,
  641. 0.02003787, 0.05385499, 0.83577899;
  642. return result;
  643. }
  644. } // namespace LogDeterminant
  645. //***********************************
  646. //********** Mean Kullback **********
  647. //***********************************
  648. namespace Kullback {
  649. inline Eigen::MatrixXd Reference()
  650. {
  651. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  652. result << 1.71301511, 0.01811099, 0.02219169,
  653. 0.01811099, 1.59879804, 0.0548546,
  654. 0.02219169, 0.0548546, 0.81958134;
  655. return result;
  656. }
  657. } // namespace Kullback
  658. //**************************************
  659. //********** Mean Wasserstein **********
  660. //**************************************
  661. namespace Wasserstein {
  662. inline Eigen::MatrixXd Reference()
  663. {
  664. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  665. result << 1.79643838, 0.0229425, 0.02418139,
  666. 0.0229425, 1.69012112, 0.05311422,
  667. 0.02418139, 0.05311422, 0.87927152;
  668. return result;
  669. }
  670. } // namespace Wasserstein
  671. //******************************
  672. //********** Mean ALE **********
  673. //******************************
  674. namespace ALE {
  675. inline Eigen::MatrixXd Reference()
  676. {
  677. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  678. result << 1.70133202, 0.01256147, 0.01500743,
  679. 0.01256147, 1.61096286, 0.05925685,
  680. 0.01500743, 0.05925685, 0.83062499;
  681. return result;
  682. }
  683. } // namespace ALE
  684. //***********************************
  685. //********** Mean Harmonic **********
  686. //***********************************
  687. namespace Harmonic {
  688. inline Eigen::MatrixXd Reference()
  689. {
  690. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  691. result << 1.56594664, 0.01175612, 0.01576697,
  692. 0.01175612, 1.44152542, 0.04955601,
  693. 0.01576697, 0.04955601, 0.72075273;
  694. return result;
  695. }
  696. } // namespace Harmonic
  697. //***********************************
  698. //********** Mean Identity **********
  699. //***********************************
  700. namespace Identity {
  701. inline Eigen::MatrixXd Reference()
  702. {
  703. Eigen::MatrixXd result(NB_CHAN, NB_CHAN);
  704. result << 1, 0, 0,
  705. 0, 1, 0,
  706. 0, 0, 1;
  707. return result;
  708. }
  709. } // namespace Identity
  710. } // namespace InitMeans
  711. //*******************************************************************
  712. //********** Initialisation Distance Reference of Datasets **********
  713. //*******************************************************************
  714. namespace InitDistance {
  715. //************************************
  716. //********** Distance Euclidian **********
  717. //************************************
  718. namespace Euclidian {
  719. inline std::vector<double> Reference()
  720. {
  721. return std::vector<double>{
  722. 2.27941886, 1.06479476, 1.02847791, 1.59375373, 1.55723736, 0.38300632, 0.50680192, 1.04235464, 1.05530485, 1.12584212, 0.7888681, 0.74648348
  723. };
  724. }
  725. }
  726. //****************************************
  727. //********** Distance Log Euclidian **********
  728. //****************************************
  729. namespace LogEuclidian {
  730. inline std::vector<double> Reference()
  731. {
  732. return std::vector<double>{
  733. 1.32256326, 0.66407543, 0.58679669, 1.40770199, 0.74410706, 0.35240113, 0.43103276, 0.71149032, 0.67768624, 0.80611325, 0.59020555, 0.66716464
  734. };
  735. }
  736. }
  737. //**********************************
  738. //********** Distance Riemann **********
  739. //**********************************
  740. namespace Riemann {
  741. inline std::vector<double> Reference()
  742. {
  743. return std::vector<double>{
  744. 1.32849591, 0.66514346, 0.58560532, 1.41024439, 0.747409, 0.34896944, 0.43236778, 0.71205324, 0.67698377, 0.80599981, 0.59091178, 0.66423683
  745. };
  746. }
  747. }
  748. //******************************************
  749. //********** Distance Log Determinant **********
  750. //******************************************
  751. namespace LogDeterminant {
  752. inline std::vector<double> Reference()
  753. {
  754. return std::vector<double>{
  755. 0.46451334, 0.23505451, 0.20685864, 0.49230328, 0.26223382, 0.1207747, 0.15093304, 0.25002132, 0.23755315, 0.28080601, 0.20652205, 0.23046043
  756. };
  757. }
  758. }
  759. //***********************************
  760. //********** Distance Kullback **********
  761. //***********************************
  762. namespace Kullback {
  763. inline std::vector<double> Reference()
  764. {
  765. return std::vector<double>{
  766. 0.9229355, 0.22182567, 0.17231943, 1.04684976, 0.28821354, 0.06625571, 0.09835624, 0.26108052, 0.23637438, 0.34499747, 0.18292577, 0.238331
  767. };
  768. }
  769. }
  770. //**************************************
  771. //********** Distance Wasserstein **********
  772. //**************************************
  773. namespace Wasserstein {
  774. inline std::vector<double> Reference()
  775. {
  776. return std::vector<double>{
  777. 0.80006691, 0.41547827, 0.38690865, 0.70393068, 0.5282644, 0.16253726, 0.22475651, 0.42258195, 0.41676291, 0.45835023, 0.32884, 0.33947315
  778. };
  779. }
  780. }
  781. } // namespace InitDistance
  782. //********************************************************************
  783. //********** Initialisation Geodesics Reference of Datasets **********
  784. //********************************************************************
  785. namespace InitGeodesics {
  786. //****************************************
  787. //********** Geodesic Euclidian **********
  788. //****************************************
  789. namespace Euclidian {
  790. inline std::vector<Eigen::MatrixXd> Reference()
  791. {
  792. std::vector<Eigen::MatrixXd> result(NB_TRIALS);
  793. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  794. result[0] << 2.22943763, 0.68053524, 0.27049252,
  795. 0.68053524, 1.98536663, 0.29415501,
  796. 0.27049252, 0.29415501, 0.71977908;
  797. result[1] << 1.9361731, -0.31266682, -0.06016559,
  798. -0.31266682, 1.65109873, 0.06479135,
  799. -0.06016559, 0.06479135, 0.7923115;
  800. result[2] << 1.54576352, 0.01281718, 0.02149028,
  801. 0.01281718, 1.38939747, 0.0356005,
  802. 0.02149028, 0.0356005, 0.84442235;
  803. result[3] << 2.2246123, -0.29769435, -0.06167363,
  804. -0.29769435, 1.33547758, 0.05859348,
  805. -0.06167363, 0.05859348, 0.62449345;
  806. result[4] << 2.373137, -0.38055565, -0.03463871,
  807. -0.38055565, 1.79388203, -0.01921965,
  808. -0.03463871, -0.01921965, 0.8575643;
  809. result[5] << 1.76110336, 0.00799934, 0.02939964,
  810. 0.00799934, 1.6806415, 0.06890792,
  811. 0.02939964, 0.06890792, 1.05283847;
  812. result[6] << 1.92410792, -0.06184371, 0.06924493,
  813. -0.06184371, 1.94615604, -0.01035897,
  814. 0.06924493, -0.01035897, 0.98931936;
  815. result[7] << 1.46853897, 0.1705721, 0.05964333,
  816. 0.1705721, 1.55228032, 0.03036516,
  817. 0.05964333, 0.03036516, 0.81876404;
  818. result[8] << 1.53059562, 0.25802417, 0.06292138,
  819. 0.25802417, 1.99464691, 0.08633632,
  820. 0.06292138, 0.08633632, 0.93434081;
  821. result[9] << 1.87069007, 0.04072565, 0.05215739,
  822. 0.04072565, 2.23710624, -0.04405743,
  823. 0.05215739, -0.04405743, 1.21178702;
  824. result[10] << 1.88465682, 0.17528647, -0.06511123,
  825. 0.17528647, 2.02267668, 0.13396876,
  826. -0.06511123, 0.13396876, 1.07224983;
  827. result[11] << 1.73854112, 0.01441276, 0.0149461,
  828. 0.01441276, 1.69021945, 0.02968134,
  829. 0.0149461, 0.02968134, 1.26582276;
  830. return result;
  831. }
  832. } // namespace Euclidian
  833. //********************************************
  834. //********** Geodesic Log Euclidian **********
  835. //********************************************
  836. namespace LogEuclidian {
  837. inline std::vector<Eigen::MatrixXd> Reference()
  838. {
  839. std::vector<Eigen::MatrixXd> result(NB_TRIALS);
  840. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  841. result[0] << 2.01103272, 0.58044721, 0.23030037,
  842. 0.58044721, 1.77828904, 0.26574646,
  843. 0.23030037, 0.26574646, 0.6023019;
  844. result[1] << 1.81637234, -0.31288558, -0.06584287,
  845. -0.31288558, 1.53243541, 0.05115564,
  846. -0.06584287, 0.05115564, 0.73216466;
  847. result[2] << 1.4444758, 0.00763339, 0.01637287,
  848. 0.00763339, 1.26999275, 0.02815584,
  849. 0.01637287, 0.02815584, 0.79133167;
  850. result[3] << 2.07025711, -0.31144095, -0.0706513,
  851. -0.31144095, 1.15689355, 0.04576328,
  852. -0.0706513, 0.04576328, 0.50801127;
  853. result[4] << 2.18793303, -0.32983868, -0.04048647,
  854. -0.32983868, 1.66866414, -0.02994009,
  855. -0.04048647, -0.02994009, 0.80134643;
  856. result[5] << 1.68059619, 0.00433328, 0.02441754,
  857. 0.00433328, 1.59603546, 0.06329015,
  858. 0.02441754, 0.06329015, 0.98561446;
  859. result[6] << 1.83708447, -0.05588412, 0.05925687,
  860. -0.05588412, 1.84057265, -0.00582606,
  861. 0.05925687, -0.00582606, 0.92893714;
  862. result[7] << 1.335889, 0.19615591, 0.06355339,
  863. 0.19615591, 1.45048646, 0.02049389,
  864. 0.06355339, 0.02049389, 0.7631058;
  865. result[8] << 1.40437247, 0.25649803, 0.0592415,
  866. 0.25649803, 1.87131332, 0.07613302,
  867. 0.0592415, 0.07613302, 0.87989762;
  868. result[9] << 1.78864325, 0.03549975, 0.0439749,
  869. 0.03549975, 2.07865681, -0.02282802,
  870. 0.0439749, -0.02282802, 1.10866339;
  871. result[10] << 1.79329993, 0.1583345, -0.06293884,
  872. 0.1583345, 1.90312554, 0.12069132,
  873. -0.06293884, 0.12069132, 0.99837833;
  874. result[11] << 1.65744301, 0.01070952, 0.01156087,
  875. 0.01070952, 1.60544202, 0.0292213,
  876. 0.01156087, 0.0292213, 1.15020022;
  877. return result;
  878. }
  879. } // namespace LogEuclidian
  880. //**************************************
  881. //********** Geodesic Riemann **********
  882. //**************************************
  883. namespace Riemann {
  884. inline std::vector<Eigen::MatrixXd> Reference()
  885. {
  886. std::vector<Eigen::MatrixXd> result(NB_TRIALS);
  887. for (auto& m : result) { m.resize(NB_CHAN, NB_CHAN); }
  888. result[0] << 2.00307073, 0.5751925, 0.23695849,
  889. 0.5751925, 1.77486363, 0.2733501,
  890. 0.23695849, 0.2733501, 0.60804774;
  891. result[1] << 1.81293091, -0.3138307, -0.06654136,
  892. -0.3138307, 1.53280236, 0.05341941,
  893. -0.06654136, 0.05341941, 0.73374953;
  894. result[2] << 1.44271566, 0.00683161, 0.01652821,
  895. 0.00683161, 1.26962877, 0.029471,
  896. 0.01652821, 0.029471, 0.79258189;
  897. result[3] << 2.06594851, -0.31310631, -0.07385619,
  898. -0.31310631, 1.15755075, 0.04790018,
  899. -0.07385619, 0.04790018, 0.50936876;
  900. result[4] << 2.18427308, -0.33178678, -0.04048067,
  901. -0.33178678, 1.66810514, -0.02812001,
  902. -0.04048067, -0.02812001, 0.8032214;
  903. result[5] << 1.67854712, 0.00337028, 0.0244905,
  904. 0.00337028, 1.59559946, 0.06467602,
  905. 0.0244905, 0.06467602, 0.98719569;
  906. result[6] << 1.8346388, -0.05653261, 0.05946108,
  907. -0.05653261, 1.83958383, -0.0043761,
  908. 0.05946108, -0.0043761, 0.93070402;
  909. result[7] << 1.33364155, 0.19528644, 0.06320392,
  910. 0.19528644, 1.45004209, 0.02219171,
  911. 0.06320392, 0.02219171, 0.76451583;
  912. result[8] << 1.40188907, 0.2548021, 0.05901919,
  913. 0.2548021, 1.8711256, 0.0781204,
  914. 0.05901919, 0.0781204, 0.88141717;
  915. result[9] << 1.78638224, 0.03454505, 0.04380908,
  916. 0.03454505, 2.07716326, -0.02075452,
  917. 0.04380908, -0.02075452, 1.11079047;
  918. result[10] << 1.78975606, 0.15752572, -0.06172564,
  919. 0.15752572, 1.90245691, 0.12203188,
  920. -0.06172564, 0.12203188, 1.00070996;
  921. result[11] << 1.65542219, 0.00974451, 0.01178106,
  922. 0.00974451, 1.60497797, 0.03095649,
  923. 0.01178106, 0.03095649, 1.15199633;
  924. return result;
  925. }
  926. } // namespace Riemann
  927. } // namespace InitGeodesics
  928. //************************************************************************
  929. //********** Initialisation Featurization Reference of Datasets **********
  930. //************************************************************************
  931. namespace InitFeaturization {
  932. namespace TangentSpace {
  933. inline std::vector<Eigen::RowVectorXd> Reference()
  934. {
  935. std::vector<Eigen::RowVectorXd> result(NB_TRIALS);
  936. for (auto& m : result) { m.resize(NB_FEATURES); }
  937. result[0] << 0.19923529, 0.81954961, 0.45583261, 0.06265258, 0.53984445, -0.74189243;
  938. result[1] << 0.08020799, -0.56380364, -0.19863986, -0.12711376, -0.00487228, -0.24993702;
  939. result[2] << -0.33927073, -0.0139971, -0.00466568, -0.46577928, -0.04826772, -0.09127522;
  940. result[3] << 0.34039208, -0.59873603, -0.23557737, -0.70072935, 0.02089894, -0.98360691;
  941. result[4] << 0.4605308, -0.52546299, -0.14067914, 0.04677775, -0.21048792, -0.06431401;
  942. result[5] << -0.0365709, -0.02310847, 0.00568693, -0.0103298, 0.01443795, 0.34577556;
  943. result[6] << 0.13870707, -0.11420977, 0.08057211, 0.27541021, -0.14045981, 0.22931806;
  944. result[7] << -0.52065199, 0.37104578, 0.12469995, -0.21855289, -0.08508472, -0.16646769;
  945. result[8] << -0.42665126, 0.41541091, 0.08741089, 0.28616558, 0.02832375, 0.11565408;
  946. result[9] << 0.08700644, 0.0237524, 0.04023502, 0.51858937, -0.17189999, 0.58429274;
  947. result[10] << 0.08116035, 0.22060811, -0.19108877, 0.32966629, 0.12395396, 0.36518821;
  948. result[11] << -0.06409514, -0.01104878, -0.02378668, 0.00324331, -0.06638659, 0.65726463;
  949. return result;
  950. }
  951. } // namespace TangentSpace
  952. namespace Squeeze {
  953. inline std::vector<Eigen::RowVectorXd> Reference()
  954. {
  955. std::vector<Eigen::RowVectorXd> result(NB_TRIALS);
  956. for (auto& m : result) { m.resize(NB_FEATURES); }
  957. result[0] << 2.58492880, 1.33543611, 0.511092833, 2.19748746, 0.527579698, 0.507583739;
  958. result[1] << 1.99839975, -0.650968006, -0.150223386, 1.52895167, 0.0688523853, 0.652648582;
  959. result[2] << 1.21758058, -0.000000000, 0.0130883610, 1.00554914, 0.0104706888, 0.756870279;
  960. result[3] << 2.57527815, -0.621023059, -0.153239456, 0.897709368, 0.0564566417, 0.317012482;
  961. result[4] << 2.87232755, -0.786745664, -0.0991696216, 1.81451826, -0.0991696216, 0.783154191;
  962. result[5] << 1.64826027, -0.00963569008, 0.0289070702, 1.58803720, 0.0770855206, 1.17370253;
  963. result[6] << 1.97426940, -0.149321794, 0.108597668, 2.11906629, -0.0814482510, 1.04666432;
  964. result[7] << 1.06313148, 0.315509839, 0.0893944544, 1.33131485, 0.00000000, 0.705553667;
  965. result[8] << 1.18724478, 0.490413981, 0.0959505616, 2.21604802, 0.111942322, 0.936707201;
  966. result[9] << 1.86743369, 0.0558169410, 0.0744225880, 2.70096668, -0.148845176, 1.49159963;
  967. result[10] << 1.89536719, 0.324938579, -0.160114662, 2.27210757, 0.207207210, 1.21252525;
  968. result[11] << 1.60313579, 0.00319114656, 0.00000000, 1.60719310, -0.00136763424, 1.59967111;
  969. return result;
  970. }
  971. } // namespace Squeeze
  972. namespace SqueezeDiag {
  973. inline std::vector<Eigen::RowVectorXd> Reference()
  974. {
  975. std::vector<Eigen::RowVectorXd> result(NB_TRIALS);
  976. for (auto& m : result) { m.resize(NB_FEATURES); }
  977. result[0] << 2.5849288, 2.19748746, 0.507583739, 1.33543611, 0.527579698, 0.511092833;
  978. result[1] << 1.99839975, 1.52895167, 0.652648582, -0.650968006, 0.0688523853, -0.150223386;
  979. result[2] << 1.21758058, 1.00554914, 0.756870279, -0.00, 0.0104706888, 0.013088361;
  980. result[3] << 2.57527815, 0.897709368, 0.317012482, -0.621023059, 0.0564566417, -0.153239456;
  981. result[4] << 2.87232755, 1.81451826, 0.783154191, -0.786745664, -0.0991696216, -0.0991696216;
  982. result[5] << 1.64826027, 1.5880372, 1.17370253, -0.00963569008, 0.0770855206, 0.0289070702;
  983. result[6] << 1.9742694, 2.11906629, 1.04666432, -0.149321794, -0.081448251, 0.108597668;
  984. result[7] << 1.06313148, 1.33131485, 0.705553667, 0.315509839, 0.00, 0.0893944544;
  985. result[8] << 1.18724478, 2.21604802, 0.936707201, 0.490413981, 0.111942322, 0.0959505616;
  986. result[9] << 1.86743369, 2.70096668, 1.49159963, 0.055816941, -0.148845176, 0.074422588;
  987. result[10] << 1.89536719, 2.27210757, 1.21252525, 0.324938579, 0.20720721, -0.160114662;
  988. result[11] << 1.60313579, 1.6071931, 1.59967111, 0.00319114656, -0.00136763424, 0.00;
  989. return result;
  990. }
  991. } // namespace SqueezeDiag
  992. } // namespace InitFeaturization
  993. //**********************************************************************
  994. //********** Initialisation Classifiers Reference of Datasets **********
  995. //**********************************************************************
  996. namespace InitClassif {
  997. //**************************
  998. //********** LSQR **********
  999. //**************************
  1000. namespace LSQR {
  1001. inline Eigen::MatrixXd Reference()
  1002. {
  1003. Eigen::MatrixXd result(1, NB_FEATURES);
  1004. result << -5.62849964, 2.57528317, -0.41393163, 3.79788328, -1.7915752, 3.63071567;
  1005. return result;
  1006. }
  1007. }
  1008. //**********************************
  1009. //********** FgDA Compute **********
  1010. //**********************************
  1011. namespace FgDACompute {
  1012. inline Eigen::MatrixXd Reference()
  1013. {
  1014. Eigen::MatrixXd result(NB_FEATURES, NB_FEATURES);
  1015. result << 0.45714834, -0.20916523, 0.03361964, -0.30846516, 0.14551225, -0.29488776,
  1016. -0.20916523, 0.09570218, -0.01538245, 0.14113622, -0.06657818, 0.13492396,
  1017. 0.03361964, -0.01538245, 0.00247246, -0.02268517, 0.01070127, -0.02168666,
  1018. -0.30846516, 0.14113622, -0.02268517, 0.20813978, -0.09818576, 0.1989783,
  1019. 0.14551225, -0.06657818, 0.01070127, -0.09818576, 0.04631716, -0.09386402,
  1020. -0.29488776, 0.13492396, -0.02168666, 0.1989783, -0.09386402, 0.19022007;
  1021. return result;
  1022. }
  1023. } // namespace FgDACompute
  1024. } // namespace InitClassif
  1025. //*****************************************************************************
  1026. //********** Initialisation Matrix Classifiers Reference of Datasets **********
  1027. //*****************************************************************************
  1028. namespace InitMatrixClassif {
  1029. namespace MDM {
  1030. inline Geometry::CMatrixClassifierMDM Reference()
  1031. {
  1032. Geometry::CMatrixClassifierMDM result(NB_CLASS, Geometry::EMetric::Riemann);
  1033. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1034. means[0] << 1.92849739, -0.1538202, 0.01072518,
  1035. -0.1538202, 1.41817199, 0.06326929,
  1036. 0.01072518, 0.06326929, 0.6661666;
  1037. means[1] << 1.46525466, 0.258979, 0.03170221,
  1038. 0.258979, 1.94533383, 0.03574208,
  1039. 0.03170221, 0.03574208, 1.13153112;
  1040. result.setMeans(means);
  1041. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1042. return result;
  1043. }
  1044. //The estimation method of riemann mean in matlab is different of the python and c++ method
  1045. inline Geometry::CMatrixClassifierMDM ReferenceMatlab()
  1046. {
  1047. Geometry::CMatrixClassifierMDM result(NB_CLASS, Geometry::EMetric::Riemann);
  1048. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1049. means[0] << 1.928499437649616, -0.153827038574370, 0.010747690754065,
  1050. -0.153827038574370, 1.418162423365369, 0.063273476393445,
  1051. 0.010747690754065, 0.063273476393445, 0.666171737852679;
  1052. means[1] << 1.465253745853043, 0.258978164753603, 0.031701951674564,
  1053. 0.258978164753603, 1.945334998390171, 0.035741956583496,
  1054. 0.031701951674564, 0.035741956583496, 1.131530964874486;
  1055. result.setMeans(means);
  1056. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1057. return result;
  1058. }
  1059. inline Geometry::CMatrixClassifierMDM AfterSupervised()
  1060. {
  1061. Geometry::CMatrixClassifierMDM result(NB_CLASS, Geometry::EMetric::Riemann);
  1062. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1063. means[0] << 1.928350313881734, -0.154041423123185, 0.010701374534393,
  1064. -0.154041423123186, 1.418273608417471, 0.063257455871936,
  1065. 0.010701374534394, 0.063257455871936, 0.666184815487807;
  1066. means[1] << 1.465233762087830, 0.258934832669209, 0.031704171892215,
  1067. 0.258934832669209, 1.945307843854343, 0.035766052240045,
  1068. 0.031704171892215, 0.035766052240044, 1.131554685966728;
  1069. result.setMeans(means);
  1070. result.setTrialNumbers({ 2 * NB_TRIALS1, 2 * NB_TRIALS2 });
  1071. return result;
  1072. }
  1073. inline Geometry::CMatrixClassifierMDM AfterUnSupervised()
  1074. {
  1075. Geometry::CMatrixClassifierMDM result(NB_CLASS, Geometry::EMetric::Riemann);
  1076. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1077. means[0] << 1.950943868870711, -0.167140250323899, 0.003222724880780,
  1078. -0.167140250323900, 1.360332213689968, 0.069395646598480,
  1079. 0.003222724880780, 0.069395646598480, 0.612498166151011;
  1080. means[1] << 1.512203012203314, 0.207413861919226, 0.036590552326957,
  1081. 0.207413861919226, 1.921307138623116, 0.030422979119863,
  1082. 0.036590552326957, 0.030422979119864, 1.127225044244057;
  1083. result.setMeans(means);
  1084. result.setTrialNumbers({ NB_TRIALS1 + 5, NB_TRIALS2 + 7 });// Find 5 & 7 times in Prediction
  1085. return result;
  1086. }
  1087. inline std::vector<size_t> Prediction() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1088. inline std::vector<size_t> PredictionSupervised() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1089. inline std::vector<size_t> PredictionUnSupervised() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1090. inline std::vector<std::vector<double>> PredictionDistance()
  1091. {
  1092. std::vector<std::vector<double>> result(NB_TRIALS);
  1093. result[0] = { 1.314629453210111, 1.474855008515000 };
  1094. result[1] = { 0.464333729201812, 1.051817099896226 };
  1095. result[2] = { 0.601426917411240, 0.812445189801618 };
  1096. result[3] = { 1.102877219889465, 1.849548724985433 };
  1097. result[4] = { 0.626116626250442, 1.067153960330500 };
  1098. result[5] = { 0.611993241506318, 0.331147184884182 };
  1099. result[6] = { 0.635248202449675, 0.476499934085104 };
  1100. result[7] = { 0.845377609077804, 0.747547515688392 };
  1101. result[8] = { 0.951093615508598, 0.413321379328445 };
  1102. result[9] = { 1.067347359524113, 0.552344271253539 };
  1103. result[10] = { 0.856508614439436, 0.390553678952617 };
  1104. result[11] = { 0.921536704800470, 0.459953813816839 };
  1105. return result;
  1106. }
  1107. inline std::vector<std::vector<double>> PredictionDistanceSupervised()
  1108. {
  1109. std::vector<std::vector<double>> result(NB_TRIALS);
  1110. result[0] = { 1.314629453210111, 1.474855008515000 };
  1111. result[1] = { 0.605125609448517, 1.051817099896226 };
  1112. result[2] = { 0.632177503835419, 0.812445189801618 };
  1113. result[3] = { 1.114890656799339, 1.849548724985433 };
  1114. result[4] = { 0.716307916402446, 1.067153960330500 };
  1115. result[5] = { 0.705594944810905, 0.331147184884182 };
  1116. result[6] = { 0.684063787503923, 0.476499934085104 };
  1117. result[7] = { 0.845432339540137, 0.747547515688392 };
  1118. result[8] = { 0.951119668632168, 0.353451074348013 };
  1119. result[9] = { 1.067314379382615, 0.686650119070229 };
  1120. result[10] = { 0.856525175953122, 0.448063104241547 };
  1121. result[11] = { 0.921512070536392, 0.511024366753348 };
  1122. return result;
  1123. }
  1124. inline std::vector<std::vector<double>> PredictionDistanceUnSupervised()
  1125. {
  1126. std::vector<std::vector<double>> result(NB_TRIALS);
  1127. result[0] = { 1.314629453210111, 1.474855008515000 };
  1128. result[1] = { 0.605125609448517, 1.051817099896226 };
  1129. result[2] = { 0.632177503835419, 0.812445189801618 };
  1130. result[3] = { 1.114890656799339, 1.849548724985433 };
  1131. result[4] = { 0.716307916402446, 1.067153960330500 };
  1132. result[5] = { 0.705594944810905, 0.331147184884182 };
  1133. result[6] = { 0.729161284837321, 0.448637450763909 };
  1134. result[7] = { 0.871245756539967, 0.786138798955233 };
  1135. result[8] = { 1.017636018350342, 0.439519359143378 };
  1136. result[9] = { 1.163460730752319, 0.623259567590992 };
  1137. result[10] = { 0.942113031918693, 0.422541764097218 };
  1138. result[11] = { 1.014624974936401, 0.472684060628136 };
  1139. return result;
  1140. }
  1141. } // namespace MDM
  1142. namespace FgMDMRT {
  1143. inline Geometry::CMatrixClassifierFgMDMRT Reference()
  1144. {
  1145. Geometry::CMatrixClassifierFgMDMRT result(NB_CLASS, Geometry::EMetric::Riemann);
  1146. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1147. means[0] << 2.08042432, -0.08968098, 0.03145977,
  1148. -0.08968098, 1.41163613, 0.09127538,
  1149. 0.03145977, 0.09127538, 0.734828;
  1150. means[1] << 1.30840283, 0.15716713, 0.00232698,
  1151. 0.15716713, 1.93455782, -0.01963492,
  1152. 0.00232698, -0.01963492, 0.98852719;
  1153. Eigen::MatrixXd ref(NB_CHAN, NB_CHAN);
  1154. ref << 1.70952664, 0.01674082, 0.02077766,
  1155. 0.01674082, 1.60344581, 0.05423902,
  1156. 0.02077766, 0.05423902, 0.8303257;
  1157. Eigen::MatrixXd weight = Eigen::MatrixXd(NB_FEATURES, NB_FEATURES);
  1158. weight << 0.45714834, -0.20916523, 0.03361964, -0.30846516, 0.14551225, -0.29488776,
  1159. -0.20916523, 0.09570218, -0.01538245, 0.14113622, -0.06657818, 0.13492396,
  1160. 0.03361964, -0.01538245, 0.00247246, -0.02268517, 0.01070127, -0.02168666,
  1161. -0.30846516, 0.14113622, -0.02268517, 0.20813978, -0.09818576, 0.1989783,
  1162. 0.14551225, -0.06657818, 0.01070127, -0.09818576, 0.04631716, -0.09386402,
  1163. -0.29488776, 0.13492396, -0.02168666, 0.1989783, -0.09386402, 0.19022007;
  1164. result.setMeans(means);
  1165. result.setRef(ref);
  1166. result.setWeight(weight);
  1167. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1168. return result;
  1169. }
  1170. inline Geometry::CMatrixClassifierFgMDMRT AfterSupervised() { return Geometry::CMatrixClassifierFgMDMRT(NB_CLASS, Geometry::EMetric::Riemann); }
  1171. inline Geometry::CMatrixClassifierFgMDMRT AfterUnSupervised() { return Geometry::CMatrixClassifierFgMDMRT(NB_CLASS, Geometry::EMetric::Riemann); }
  1172. inline std::vector<size_t> Prediction() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1173. inline std::vector<size_t> PredictionSupervised() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1174. inline std::vector<size_t> PredictionUnSupervised() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1175. inline std::vector<std::vector<double>> PredictionDistance()
  1176. {
  1177. std::vector<std::vector<double>> result(NB_TRIALS);
  1178. result[0] = { 0.02665352, 0.71870784 };
  1179. result[1] = { 0.0963665, 0.78842083 };
  1180. result[2] = { 0.27172762, 0.4203267 };
  1181. result[3] = { 0.86848167, 1.56053599 };
  1182. result[4] = { 0.13999143, 0.83204575 };
  1183. result[5] = { 0.44863838, 0.24341594 };
  1184. result[6] = { 0.41112711, 0.28092722 };
  1185. result[7] = { 0.59496729, 0.09708703 };
  1186. result[8] = { 0.87589215, 0.18383782 };
  1187. result[9] = { 0.76329856, 0.07124423 };
  1188. result[10] = { 0.59422854, 0.09782578 };
  1189. result[11] = { 0.63188509, 0.06016924 };
  1190. return result;
  1191. }
  1192. inline std::vector<std::vector<double>> PredictionDistanceSupervised() { return std::vector<std::vector<double>>(NB_TRIALS, { 0, 0 }); }
  1193. inline std::vector<std::vector<double>> PredictionDistanceUnSupervised() { return std::vector<std::vector<double>>(NB_TRIALS, { 0, 0 }); }
  1194. } // namespace FgMDMRT
  1195. namespace MDMRebias {
  1196. inline Geometry::CMatrixClassifierMDMRebias Reference()
  1197. {
  1198. Geometry::CMatrixClassifierMDMRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1199. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1200. means[0] << 1.129204848898484, -0.103109478655884, -0.005579207794177,
  1201. -0.103109478655884, 0.884890317836479, 0.015961516899074,
  1202. -0.005579207794177, 0.015961516899074, 0.801503003117589;
  1203. means[1] << 0.855588028031272, 0.146119935000422, 0.004175889722330,
  1204. 0.146119935000422, 1.212891172460091, -0.030535218161296,
  1205. 0.004175889722330, -0.030535218161296, 1.364418888484737;
  1206. Geometry::CBias bias;
  1207. bias.setClassificationNumber(0);
  1208. Eigen::MatrixXd m(NB_CHAN, NB_CHAN);
  1209. m << 1.709522177383279, 0.016735943232583, 0.020785623695383,
  1210. 0.016735943232582, 1.603446473585329, 0.054241640196169,
  1211. 0.020785623695383, 0.054241640196169, 0.830327834469631;
  1212. bias.setBias(m);
  1213. result.setMeans(means);
  1214. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1215. result.setBias(bias);
  1216. return result;
  1217. }
  1218. inline Geometry::CMatrixClassifierMDMRebias After()
  1219. {
  1220. Geometry::CMatrixClassifierMDMRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1221. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1222. means[0] << 1.129204848898484, -0.103109478655884, -0.005579207794177,
  1223. -0.103109478655884, 0.884890317836479, 0.015961516899074,
  1224. -0.005579207794177, 0.015961516899074, 0.801503003117589;
  1225. means[1] << 0.855588028031272, 0.146119935000422, 0.004175889722330,
  1226. 0.146119935000422, 1.212891172460091, -0.030535218161296,
  1227. 0.004175889722330, -0.030535218161296, 1.364418888484737;
  1228. Geometry::CBias bias;
  1229. bias.setClassificationNumber(NB_TRIALS);
  1230. Eigen::MatrixXd m(NB_CHAN, NB_CHAN);
  1231. m << 1.705589799010000, 0.015745816879592, 0.019622109841865,
  1232. 0.015745816879592, 1.606186296382902, 0.055107313019667,
  1233. 0.019622109841864, 0.055107313019667, 0.830841812602058;
  1234. bias.setBias(m);
  1235. result.setMeans(means);
  1236. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1237. result.setBias(bias);
  1238. return result;
  1239. }
  1240. inline Geometry::CMatrixClassifierMDMRebias AfterSupervised()
  1241. {
  1242. Geometry::CMatrixClassifierMDMRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1243. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1244. means[0] << 1.077801701232086, -0.135609812697659, -0.032311282008452,
  1245. -0.135609812697659, 0.947469327241560, -0.034394668642257,
  1246. -0.032311282008452, -0.034394668642258, 0.986389056463633;
  1247. means[1] << 0.846602361879856, 0.168419115431573, 0.000436175648620,
  1248. 0.168419115431572, 1.264667771319573, -0.037722396726046,
  1249. 0.000436175648620, -0.037722396726045, 1.474562819298618;
  1250. Geometry::CBias bias;
  1251. bias.setClassificationNumber(NB_TRIALS);
  1252. Eigen::MatrixXd m(NB_CHAN, NB_CHAN);
  1253. m << 1.705589799010000, 0.015745816879592, 0.019622109841865,
  1254. 0.015745816879592, 1.606186296382902, 0.055107313019667,
  1255. 0.019622109841864, 0.055107313019667, 0.830841812602058;
  1256. bias.setBias(m);
  1257. result.setMeans(means);
  1258. result.setTrialNumbers({ 2 * NB_TRIALS1, 2 * NB_TRIALS2 });
  1259. result.setBias(bias);
  1260. return result;
  1261. }
  1262. inline Geometry::CMatrixClassifierMDMRebias AfterUnSupervised()
  1263. {
  1264. Geometry::CMatrixClassifierMDMRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1265. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1266. means[0] << 1.163328386007378, -0.071528982784288, 0.003415904977547,
  1267. -0.071528982784288, 0.865367469644902, 0.037539841921305,
  1268. 0.003415904977547, 0.037539841921304, 0.725209905616625;
  1269. means[1] << 0.867551363970510, 0.027654580821275, -0.039319369201831,
  1270. 0.027654580821275, 1.192704425561919, -0.114920170106705,
  1271. -0.039319369201831, -0.114920170106704, 1.554798562413437;
  1272. Geometry::CBias bias;
  1273. bias.setClassificationNumber(NB_TRIALS);
  1274. Eigen::MatrixXd m(NB_CHAN, NB_CHAN);
  1275. m << 1.705589799010000, 0.015745816879592, 0.019622109841865,
  1276. 0.015745816879592, 1.606186296382902, 0.055107313019667,
  1277. 0.019622109841864, 0.055107313019667, 0.830841812602058;
  1278. bias.setBias(m);
  1279. result.setMeans(means);
  1280. result.setTrialNumbers({ NB_TRIALS1 + 2, NB_TRIALS2 + 10 });// Find 2 & 10 times in Prediction
  1281. result.setBias(bias);
  1282. return result;
  1283. }
  1284. inline std::vector<size_t> Prediction() { return std::vector<size_t>{ 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; }
  1285. inline std::vector<size_t> PredictionSupervised() { return std::vector<size_t>{ 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; }
  1286. inline std::vector<size_t> PredictionUnSupervised() { return std::vector<size_t>{ 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; }
  1287. inline std::vector<std::vector<double>> PredictionDistance()
  1288. {
  1289. std::vector<std::vector<double>> result(NB_TRIALS);
  1290. result[0] = { 1.314629453210112, 1.474855008515001 };
  1291. result[1] = { 1.695656381031027, 1.841285722807642 };
  1292. result[2] = { 0.985038237804275, 0.841748947395782 };
  1293. result[3] = { 0.893165255444375, 1.599278236985282 };
  1294. result[4] = { 0.999895116206910, 0.941884079636976 };
  1295. result[5] = { 1.137476666505600, 0.465758462215674 };
  1296. result[6] = { 1.011555978384045, 0.477398295992067 };
  1297. result[7] = { 1.061656174626915, 0.693427342482516 };
  1298. result[8] = { 1.170383892226384, 0.490874398142692 };
  1299. result[9] = { 1.264605170966096, 0.711483172971687 };
  1300. result[10] = { 0.958316311213036, 0.443514577199302 };
  1301. result[11] = { 0.979165666917157, 0.506488669219013 };
  1302. return result;
  1303. }
  1304. inline std::vector<std::vector<double>> PredictionDistanceSupervised()
  1305. {
  1306. std::vector<std::vector<double>> result(NB_TRIALS);
  1307. result[0] = { 1.314629453210112, 1.474855008515001 };
  1308. result[1] = { 1.855966579223177, 1.841285722807642 };
  1309. result[2] = { 0.958576739762368, 0.841748947395782 };
  1310. result[3] = { 0.923258071960562, 1.599278236985282 };
  1311. result[4] = { 0.972293627395511, 0.941884079636976 };
  1312. result[5] = { 1.081434198790791, 0.465758462215674 };
  1313. result[6] = { 0.886487914539492, 0.477398295992067 };
  1314. result[7] = { 1.019626392142984, 0.693427342482516 };
  1315. result[8] = { 1.065871792145533, 0.446604052630479 };
  1316. result[9] = { 1.069057512264309, 0.803506934337151 };
  1317. result[10] = { 0.813748223596456, 0.477967335007498 };
  1318. result[11] = { 0.768497985059151, 0.533247406413060 };
  1319. return result;
  1320. }
  1321. inline std::vector<std::vector<double>> PredictionDistanceUnSupervised()
  1322. {
  1323. std::vector<std::vector<double>> result(NB_TRIALS);
  1324. result[0] = { 1.314629453210112, 1.474855008515001 };
  1325. result[1] = { 1.855966579223177, 1.841285722807642 };
  1326. result[2] = { 1.077703693722418, 0.677588292749563 };
  1327. result[3] = { 0.990907763223969, 1.416399657557998 };
  1328. result[4] = { 1.102040763358186, 0.797780684168623 };
  1329. result[5] = { 1.233329154201637, 0.544647072527355 };
  1330. result[6] = { 1.103888150188716, 0.487000074621019 };
  1331. result[7] = { 1.094214879276997, 0.921591225768512 };
  1332. result[8] = { 1.223770999299696, 0.714324156664128 };
  1333. result[9] = { 1.357590792239233, 0.679090817494962 };
  1334. result[10] = { 1.028663404532504, 0.505823409893398 };
  1335. result[11] = { 1.085189723107800, 0.367393525001945 };
  1336. return result;
  1337. }
  1338. } // namespace MDMRebias
  1339. namespace FgMDM {
  1340. inline Geometry::CMatrixClassifierFgMDM Reference()
  1341. {
  1342. Geometry::CMatrixClassifierFgMDM result(NB_CLASS, Geometry::EMetric::Riemann);
  1343. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1344. means[0] << 2.08042432, -0.08968098, 0.03145977,
  1345. -0.08968098, 1.41163613, 0.09127538,
  1346. 0.03145977, 0.09127538, 0.734828;
  1347. means[1] << 1.30840283, 0.15716713, 0.00232698,
  1348. 0.15716713, 1.93455782, -0.01963492,
  1349. 0.00232698, -0.01963492, 0.98852719;
  1350. Eigen::MatrixXd ref(NB_CHAN, NB_CHAN);
  1351. ref << 1.70952664, 0.01674082, 0.02077766,
  1352. 0.01674082, 1.60344581, 0.05423902,
  1353. 0.02077766, 0.05423902, 0.8303257;
  1354. Eigen::MatrixXd weight = Eigen::MatrixXd(NB_FEATURES, NB_FEATURES);
  1355. weight << 0.45714834, -0.20916523, 0.03361964, -0.30846516, 0.14551225, -0.29488776,
  1356. -0.20916523, 0.09570218, -0.01538245, 0.14113622, -0.06657818, 0.13492396,
  1357. 0.03361964, -0.01538245, 0.00247246, -0.02268517, 0.01070127, -0.02168666,
  1358. -0.30846516, 0.14113622, -0.02268517, 0.20813978, -0.09818576, 0.1989783,
  1359. 0.14551225, -0.06657818, 0.01070127, -0.09818576, 0.04631716, -0.09386402,
  1360. -0.29488776, 0.13492396, -0.02168666, 0.1989783, -0.09386402, 0.19022007;
  1361. result.setMeans(means);
  1362. result.setRef(ref);
  1363. result.setWeight(weight);
  1364. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1365. result.setDataset(InitCovariance::LWF::Reference());
  1366. return result;
  1367. }
  1368. inline Geometry::CMatrixClassifierFgMDM AfterSupervised() { return Geometry::CMatrixClassifierFgMDM(NB_CLASS, Geometry::EMetric::Riemann); }
  1369. inline Geometry::CMatrixClassifierFgMDM AfterUnSupervised() { return Geometry::CMatrixClassifierFgMDM(NB_CLASS, Geometry::EMetric::Riemann); }
  1370. inline std::vector<size_t> PredictionSupervised() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1371. inline std::vector<size_t> PredictionUnSupervised() { return std::vector<size_t>{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1372. inline std::vector<std::vector<double>> PredictionDistanceSupervised() { return std::vector<std::vector<double>>(NB_TRIALS, { 0, 0 }); }
  1373. inline std::vector<std::vector<double>> PredictionDistanceUnSupervised() { return std::vector<std::vector<double>>(NB_TRIALS, { 0, 0 }); }
  1374. } // namespace FgMDM
  1375. namespace FgMDMRTRebias {
  1376. inline Geometry::CMatrixClassifierFgMDMRTRebias Reference()
  1377. {
  1378. Geometry::CMatrixClassifierFgMDMRTRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1379. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1380. means[0] << 1.21749102419878, -0.065244040475294, 0.00919064364644959,
  1381. -0.0652440404752944, 0.879520180058735, 0.0383106920991925,
  1382. 0.00919064364644961, 0.0383106920991925, 0.882712321945327;
  1383. means[1] << 0.764724285777722, 0.0858374005624361, -0.0164757238732658,
  1384. 0.0858374005624357, 1.20857271214632, -0.0743441311282506,
  1385. -0.0164757238732657, -0.0743441311282506, 1.19491180388651;
  1386. const Eigen::MatrixXd ref = Eigen::MatrixXd::Identity(NB_CHAN, NB_CHAN);
  1387. Eigen::MatrixXd weight = Eigen::MatrixXd(NB_FEATURES, NB_FEATURES);
  1388. weight << 0.457148328143448, -0.209165242331525, 0.0336196848430174, -0.308465155960592, 0.145512230780716, -0.294887759430561,
  1389. -0.209165242331525, 0.0957021953405835, -0.0153824679964544, 0.141136224558352, -0.0665781741717288, 0.134923975140382,
  1390. 0.0336196848430174, -0.0153824679964544, 0.00247246492956471, -0.0226852001637271, 0.0107012867344819, -0.0216866888180067,
  1391. -0.308465155960592, 0.141136224558352, -0.0226852001637271, 0.208139779988291, -0.098185753285447, 0.19897830332888,
  1392. 0.145512230780716, -0.0665781741717288, 0.0107012867344819, -0.098185753285447, 0.0463171535435127, -0.0938640110069554,
  1393. -0.294887759430561, 0.134923975140382, -0.0216866888180067, 0.19897830332888, -0.0938640110069554, 0.190220078054599;
  1394. Geometry::CBias bias;
  1395. bias.setClassificationNumber(0);
  1396. Eigen::MatrixXd m(NB_CHAN, NB_CHAN);
  1397. m << 1.70952703700155, 0.0167406580855047, 0.0207774590925802,
  1398. 0.0167406580855047, 1.60344585621418, 0.0542388460600326,
  1399. 0.0207774590925802, 0.0542388460600327, 0.830325461380695;
  1400. bias.setBias(m);
  1401. result.setMeans(means);
  1402. result.setRef(ref);
  1403. result.setWeight(weight);
  1404. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1405. result.setBias(bias);
  1406. return result;
  1407. }
  1408. inline Geometry::CMatrixClassifierFgMDMRTRebias After()
  1409. {
  1410. Geometry::CMatrixClassifierFgMDMRTRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1411. std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd(NB_CHAN, NB_CHAN));
  1412. means[0] << 2.08042432, -0.08968098, 0.03145977,
  1413. -0.08968098, 1.41163613, 0.09127538,
  1414. 0.03145977, 0.09127538, 0.734828;
  1415. means[1] << 1.30840283, 0.15716713, 0.00232698,
  1416. 0.15716713, 1.93455782, -0.01963492,
  1417. 0.00232698, -0.01963492, 0.98852719;
  1418. Eigen::MatrixXd ref(NB_CHAN, NB_CHAN);
  1419. ref << 1.70952664, 0.01674082, 0.02077766,
  1420. 0.01674082, 1.60344581, 0.05423902,
  1421. 0.02077766, 0.05423902, 0.8303257;
  1422. Eigen::MatrixXd weight = Eigen::MatrixXd(NB_FEATURES, NB_FEATURES);
  1423. weight << 0.45714834, -0.20916523, 0.03361964, -0.30846516, 0.14551225, -0.29488776,
  1424. -0.20916523, 0.09570218, -0.01538245, 0.14113622, -0.06657818, 0.13492396,
  1425. 0.03361964, -0.01538245, 0.00247246, -0.02268517, 0.01070127, -0.02168666,
  1426. -0.30846516, 0.14113622, -0.02268517, 0.20813978, -0.09818576, 0.1989783,
  1427. 0.14551225, -0.06657818, 0.01070127, -0.09818576, 0.04631716, -0.09386402,
  1428. -0.29488776, 0.13492396, -0.02168666, 0.1989783, -0.09386402, 0.19022007;
  1429. Geometry::CBias bias;
  1430. bias.setClassificationNumber(0);
  1431. Eigen::MatrixXd m(NB_CHAN, NB_CHAN);
  1432. m << 1.709522177383279, 0.016735943232583, 0.020785623695383,
  1433. 0.016735943232582, 1.603446473585329, 0.054241640196169,
  1434. 0.020785623695383, 0.054241640196169, 0.830327834469631;
  1435. bias.setBias(m);
  1436. result.setMeans(means);
  1437. result.setRef(ref);
  1438. result.setWeight(weight);
  1439. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1440. result.setBias(bias);
  1441. return result;
  1442. }
  1443. inline Geometry::CMatrixClassifierFgMDMRTRebias AfterSupervised()
  1444. {
  1445. Geometry::CMatrixClassifierFgMDMRTRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1446. const std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd::Zero(NB_CHAN, NB_CHAN));
  1447. const Eigen::MatrixXd ref = Eigen::MatrixXd::Zero(NB_CHAN, NB_CHAN);
  1448. const Eigen::MatrixXd weight = Eigen::MatrixXd::Zero(NB_FEATURES, NB_FEATURES);
  1449. Geometry::CBias bias;
  1450. bias.setClassificationNumber(0);
  1451. const Eigen::MatrixXd m = Eigen::MatrixXd::Zero(NB_CHAN, NB_CHAN);
  1452. bias.setBias(m);
  1453. result.setMeans(means);
  1454. result.setRef(ref);
  1455. result.setWeight(weight);
  1456. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1457. result.setBias(bias);
  1458. return result;
  1459. }
  1460. inline Geometry::CMatrixClassifierFgMDMRTRebias AfterUnSupervised()
  1461. {
  1462. Geometry::CMatrixClassifierFgMDMRTRebias result(NB_CLASS, Geometry::EMetric::Riemann);
  1463. const std::vector<Eigen::MatrixXd> means(NB_CLASS, Eigen::MatrixXd::Zero(NB_CHAN, NB_CHAN));
  1464. const Eigen::MatrixXd ref = Eigen::MatrixXd::Zero(NB_CHAN, NB_CHAN);
  1465. const Eigen::MatrixXd weight = Eigen::MatrixXd::Zero(NB_FEATURES, NB_FEATURES);
  1466. Geometry::CBias bias;
  1467. bias.setClassificationNumber(0);
  1468. const Eigen::MatrixXd m = Eigen::MatrixXd::Zero(NB_CHAN, NB_CHAN);
  1469. bias.setBias(m);
  1470. result.setMeans(means);
  1471. result.setRef(ref);
  1472. result.setWeight(weight);
  1473. result.setTrialNumbers({ NB_TRIALS1, NB_TRIALS2 });
  1474. result.setBias(bias);
  1475. return result;
  1476. }
  1477. inline std::vector<size_t> Prediction() { return std::vector<size_t>{ 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1478. inline std::vector<size_t> PredictionSupervised() { return std::vector<size_t>{ 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1 }; }
  1479. inline std::vector<size_t> PredictionUnSupervised() { return std::vector<size_t>{ 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1 }; }
  1480. inline std::vector<std::vector<double>> PredictionDistance()
  1481. {
  1482. std::vector<std::vector<double>> result(NB_TRIALS);
  1483. result[0] = { 0.02665352, 0.71870784 };
  1484. result[1] = { 0.0963665, 0.78842083 };
  1485. result[2] = { 0.27172762, 0.4203267 };
  1486. result[3] = { 0.86848167, 1.56053599 };
  1487. result[4] = { 0.13999143, 0.83204575 };
  1488. result[5] = { 0.44863838, 0.24341594 };
  1489. result[6] = { 0.41112711, 0.28092722 };
  1490. result[7] = { 0.59496729, 0.09708703 };
  1491. result[8] = { 0.87589215, 0.18383782 };
  1492. result[9] = { 0.76329856, 0.07124423 };
  1493. result[10] = { 0.59422854, 0.09782578 };
  1494. result[11] = { 0.63188509, 0.06016924 };
  1495. return result;
  1496. }
  1497. inline std::vector<std::vector<double>> PredictionDistanceSupervised() { return std::vector<std::vector<double>>(NB_TRIALS, { 0, 0 }); }
  1498. inline std::vector<std::vector<double>> PredictionDistanceUnSupervised() { return std::vector<std::vector<double>>(NB_TRIALS, { 0, 0 }); }
  1499. } // namespace FgMDMRTRebias
  1500. } // namespace InitMatrixClassif
  1501. //**********************************************************************************
  1502. //********** Initialisation Eigen Vector and Values Reference of Datasets **********
  1503. //**********************************************************************************
  1504. namespace InitEigenVector {
  1505. namespace Euclidian {
  1506. inline std::vector<Eigen::MatrixXd> Vectors()
  1507. {
  1508. std::vector<Eigen::MatrixXd> res(NB_TRIALS);
  1509. for (auto& m : res) { m.resize(NB_CHAN, NB_CHAN); }
  1510. res[0] << -0.099719220313203, -0.669586208598549, -0.736009773273933,
  1511. -0.205281981382212, 0.737627797680837, -0.643245318839019,
  1512. 0.973609462371807, 0.086945622909601, -0.211009652473392;
  1513. res[1] << 0.111965318724019, -0.566910883218780, 0.816134681220650,
  1514. 0.005003184831306, -0.820966898831894, -0.570953867807099,
  1515. 0.993699519746574, 0.068010304443119, -0.089083460557960;
  1516. res[2] << -0.028322884385997, -0.002589190683924, -0.999595473334918,
  1517. -0.041914725312920, 0.999120210419451, -0.001400333293987,
  1518. 0.998719665382634, 0.041858108210884, -0.028406491423723;
  1519. res[3] << 0.057976175973508, 0.314331831622869, -0.947541166730027,
  1520. -0.034357038854548, 0.949203633909741, 0.312781161922661,
  1521. 0.997726594263497, 0.014420852996801, 0.065830707866533;
  1522. res[4] << 0.110221488627708, 0.456226738337136, -0.883010977661632,
  1523. 0.173352582988355, 0.865982087312907, 0.469067059624150,
  1524. 0.978672624229348, -0.204773503362712, 0.016361751269464;
  1525. res[5] << -0.061397704657684, 0.089033331062346, -0.994134491818240,
  1526. -0.177429035713844, 0.979176579240238, 0.098651730613507,
  1527. 0.982216503194903, 0.182445314073361, -0.044322096343130;
  1528. res[6] << -0.104727574488823, -0.834720521380581, 0.540623516254907,
  1529. 0.059897872088547, -0.547920220834614, -0.834383410980714,
  1530. 0.992695512259904, -0.055000752601024, 0.107380338760729;
  1531. res[7] << -0.344452747212933, 0.756355847824317, 0.556127805813935,
  1532. 0.164894212714269, -0.534427151764618, 0.828973774054463,
  1533. 0.924208960977335, 0.377244550548736, 0.059366198551682;
  1534. res[8] << -0.455815137256683, 0.808206330423871, 0.372874091497991,
  1535. 0.094520279409775, -0.372603305244511, 0.923164499805514,
  1536. 0.885041511697598, 0.456036516502403, 0.093446338549907;
  1537. res[9] << -0.193758278930433, -0.979526714631217, -0.054636477464149,
  1538. 0.125183968787669, 0.030551025517024, -0.991663052048641,
  1539. 0.973029651811539, -0.198982537333385, 0.116701527547344;
  1540. res[10] << 0.289237149384199, -0.831656691056042, -0.474013733596209,
  1541. -0.245334651412988, 0.414238018239343, -0.876480332386991,
  1542. 0.925285242631790, 0.369802666927723, -0.084221180833406;
  1543. res[11] << -0.207072974526103, 0.859122563191672, -0.468005560475390,
  1544. 0.248087389502956, -0.416625413178840, -0.874571845112321,
  1545. 0.946347415271221, 0.297206471175398, 0.126865610395201;
  1546. return res;
  1547. }
  1548. inline std::vector<std::vector<double>> Values()
  1549. {
  1550. std::vector<std::vector<double>> res(NB_TRIALS);
  1551. res[0] = { 0.343998245316627, 1.047423892831558, 3.898577860851816 };
  1552. res[1] = { 0.636068793285036, 1.073728055690744, 2.470203153024218 };
  1553. res[2] = { 0.756059664962492, 1.005987809161390, 1.217952524876117 };
  1554. res[3] = { 0.306163898067430, 0.692913309767313, 2.790922792165257 };
  1555. res[4] = { 0.754419420371384, 1.423485809899146, 3.292094770729470 };
  1556. res[5] = { 1.157970726170646, 1.601524036502682, 1.650505237326672 };
  1557. res[6] = { 1.030292988524935, 1.883408477175503, 2.226298544299563 };
  1558. res[7] = { 0.672236347320348, 0.884784932899411, 1.542978716780240 };
  1559. res[8] = { 0.899245795614905, 1.015292513408225, 2.425461691976871 };
  1560. res[9] = { 1.457630446872362, 1.880811100141710, 2.721558452985928 };
  1561. res[10] = { 1.107534688634524, 1.804715500663015, 2.467749820702463 };
  1562. res[11] = { 1.599312581194488, 1.601588266036556, 1.609099152768956 };
  1563. return res;
  1564. }
  1565. } // namespace Euclidian
  1566. namespace Riemann {
  1567. inline std::vector<Eigen::MatrixXd> Vectors()
  1568. {
  1569. std::vector<Eigen::MatrixXd> res(NB_TRIALS);
  1570. for (auto& m : res) { m.resize(NB_CHAN, NB_CHAN); }
  1571. res[0] << 0.683177314172643, 0.356305060740859, 0.637428789034749,
  1572. 0.596254535002547, 0.231781884566798, -0.768607629077125,
  1573. 0.421603233963818, -0.905165101888665, 0.054100382938877;
  1574. res[1] << -0.804528392658639, -0.036641392375157, 0.592782821757612,
  1575. 0.576875792719752, 0.189145783947360, 0.794630852779387,
  1576. 0.141238752401966, -0.981265142955638, 0.131035621264554;
  1577. res[2] << 0.370856488267809, -0.927087072115963, 0.054543797311153,
  1578. 0.135794568403219, 0.112234325869184, 0.984359330371218,
  1579. 0.918708495825446, 0.357649293040181, -0.167516216785142;
  1580. res[3] << -0.777574590698155, -0.470497128169579, 0.417145308357621,
  1581. 0.352002391805965, 0.224004159793369, 0.908799456732973,
  1582. 0.521029818785332, -0.853495511868367, 0.008563828412483;
  1583. res[4] << -0.852200602468148, -0.348762320327424, -0.390024328821622,
  1584. 0.522881706515124, -0.594304304543298, -0.611062283726576,
  1585. 0.018677637558245, 0.724684232974016, -0.688827923602190;
  1586. res[5] << -0.994896919437310, 0.004425680235693, -0.100799469485717,
  1587. 0.035551250093998, 0.950342881863922, -0.309167455446607,
  1588. -0.094425782024322, 0.311173296163130, 0.945650544040486;
  1589. res[6] << 0.493492935585655, -0.848951899725937, -0.189064524643771,
  1590. -0.854929504871917, -0.513442400504876, 0.073975962739598,
  1591. 0.159875777485248, -0.125130225427405, 0.979174224772065;
  1592. res[7] << 0.571527861854678, 0.121096129587873, 0.811598195243593,
  1593. 0.728493396347230, 0.380359676034618, -0.569757745296470,
  1594. 0.377694684371250, -0.916876351666721, -0.129168421651830;
  1595. res[8] << 0.477199220498479, -0.005594736821533, 0.878777334070208,
  1596. 0.863025617423313, 0.191571748880577, -0.467425982056996,
  1597. 0.165733785411286, -0.981462665591888, -0.096246290435066;
  1598. res[9] << -0.057676575400144, -0.942969112312847, -0.327845490855118,
  1599. -0.986930132179911, 0.004358779254142, 0.161089773849114,
  1600. 0.150473674925072, -0.332851700111830, 0.930896030116795;
  1601. res[10] << -0.619029132884173, -0.643912841267474, 0.449643398140703,
  1602. -0.781168599478668, 0.445692815423151, -0.437188212865720,
  1603. -0.081108272261252, 0.621879543907849, 0.778901329463341;
  1604. res[11] << -0.506535909250893, 0.426948212351236, 0.749090512961855,
  1605. -0.837796356881654, -0.038403649506972, -0.544630539081656,
  1606. 0.203761225544018, 0.903460228053582, -0.377148484406567;
  1607. return res;
  1608. }
  1609. inline std::vector<std::vector<double>> Values()
  1610. {
  1611. std::vector<std::vector<double>> res(NB_TRIALS);
  1612. res[0] = { 4.073187688916203, 2.162587306518192, 1.025374454830789 };
  1613. res[1] = { 3.435489024573568, 2.279680027983445, 2.036513370662008 };
  1614. res[2] = { 2.057398179893756, 2.019925692630136, 1.984777599444540 };
  1615. res[3] = { 3.925383089438475, 3.559258065718881, 2.185452461332125 };
  1616. res[4] = { 4.006415184752641, 2.386938299220804, 2.113758995206569 };
  1617. res[5] = { 2.247524315394388, 2.207809023521016, 1.943690511452435 };
  1618. res[6] = { 2.763686871540375, 2.395516400026313, 1.965812106992753 };
  1619. res[7] = { 2.175635908551394, 2.028557415426327, 1.478675960408231 };
  1620. res[8] = { 2.765398368473225, 1.884906422321359, 1.573787029619139 };
  1621. res[9] = { 3.124672536007347, 2.389738038023637, 2.124981903599315 };
  1622. res[10] = { 2.835071279823153, 2.375727383201085, 1.852703353517745 };
  1623. res[11] = { 2.230954201427166, 2.225389092373921, 2.223355992103003 };
  1624. return res;
  1625. }
  1626. } // namespace Riemann
  1627. } // namespace InitEigenVector
  1628. //**************************************************************
  1629. //********** Initialisation ASR Reference of Datasets **********
  1630. //**************************************************************
  1631. namespace InitASR {
  1632. namespace Euclidian {
  1633. inline Geometry::CASR Reference()
  1634. {
  1635. Geometry::CASR res(Geometry::EMetric::Euclidian);
  1636. Eigen::MatrixXd median(3, 3), threshold(3, 3), r(3, 3);
  1637. median << 1.32267188, 0.00105802, 0.00871490,
  1638. 0.00105802, 1.32447262, 0.01829110,
  1639. 0.00871490, 0.01829110, 1.02823244;
  1640. threshold << -0.05738723, -0.12041171, 1.96255648,
  1641. 3.44737720, -1.60950341, 0.00205466,
  1642. 1.31840128, 2.82413924, 0.21182516;
  1643. r.setIdentity();
  1644. res.setMatrices(median, threshold, r);
  1645. return res;
  1646. }
  1647. } // namespace Euclidian
  1648. namespace Riemann {
  1649. inline Geometry::CASR Reference()
  1650. {
  1651. Geometry::CASR res(Geometry::EMetric::Riemann);
  1652. Eigen::MatrixXd median(3, 3), threshold(3, 3), r(3, 3);
  1653. median << 1.32267188, 0.00105802, 0.00871490,
  1654. 0.00105802, 1.32447262, 0.01829110,
  1655. 0.00871490, 0.01829110, 1.02823244;
  1656. threshold << -0.05738723, -0.12041171, 1.96255648,
  1657. 3.44737720, -1.60950341, 0.00205466,
  1658. 1.31840128, 2.82413924, 0.21182516;
  1659. r.setIdentity();
  1660. res.setMatrices(median, threshold, r);
  1661. return res;
  1662. }
  1663. } // namespace Riemann
  1664. } // namespace InitASR