From 387040b2e7ea8ed8462bf98145ad74d7b9037b9d Mon Sep 17 00:00:00 2001 From: Angelos Chatzimparmpas Date: Wed, 20 Nov 2019 09:15:12 +0100 Subject: [PATCH] fixed average --- __pycache__/tsneGrid.cpython-37.pyc | Bin 10365 -> 10878 bytes index.html | 26 +- js/tsne_vis.js | 808 +++++++--------------------- tsneGrid.py | 28 +- 4 files changed, 230 insertions(+), 632 deletions(-) diff --git a/__pycache__/tsneGrid.cpython-37.pyc b/__pycache__/tsneGrid.cpython-37.pyc index f9d8666c3832f56d625f97a35b95603e9a35c22b..7974efe81a229f88b908a86639247751d275e4f9 100644 GIT binary patch delta 1972 zcmaJ>TW?fV6yE#HwbQw@b3N0UX`!8&PNB3V@IWjV1vMl@Ai)Hp6dZcSGFsYlx;3Qk z$pEb~7)+Y%R}#w`;SEPgsQN+(Bx+1B#)rlPe}IX`7-LK{erxwo4i7pfYwfkZZ=JI* zv%dZJ(SKfz?vF%548I?K|9;}p`0eQB&>lb11F-oDoW%uO;gU&iGRsJ?8&19+=a}Wm zu_QajhP;Pus&C&9{p{u0_U+g=JT?X(3iH6`Px;!{x(DKN5mRW%$lbgt!Om22(IUtR} zmO)i=0Bk?`9BWi$QI;}HmSKaiN`_e>;6p9nN>mQf^kRS_s*`0oC@WKbLYF<~Zysl& zC`zIkY55lUBERB$lUo&QXenp~tt}sU8e23SX@LXF!ESZ2TOAfV0qX@j>|%!K1MH}a9i3v;vO1Zr^oTOHHljC4(I`dM7&>IT`Y=6i z*r(OQ^pC~pxtg%+lk+dUTeGWEHM@isvCD94!QIog4*vJQ}>+`L}=Vxv4$}?+F z$MVnT{q_g6k|lC2a#zT`Pwt|+mCy4v^)P=_r3&?Og(tabgm~WQzN}$yyx?Ix;8f=jsbJdy-1%w;9#})5=*_L9O-eXr4uf zrKx=yog$;h@OtYvBFND=jVN-oNF#=v#xCS&ibgkb8so^(1&su98nLvhdEurAI0CwU z(r9=ZMvF@ilo5t9I>}>Asg}2?!6?9pga?SpG}Z+yCgFi$B8|m?bxU|)CZt9mOae=g z2bPs7nZ~9wFcX$_Hs2#mY`TY7nUSW!Snk(-87vzZ+!`y!1ins3go&j=MP7Wrnit@u*xwTNAte`i`a*N3u;wdQTSV1Gi6 z)-v>eN~R)x*>pdV-m%(rZBo={XCy6P0R_xRL&#oOkVg$KBIf~~=fil)e1w}|*X6GE zl`2J3-v&W||9K7%Q7@gT&CtEw-_}^>~U|iu3R1NE}uK$xtek{xRXA2*F2f2unJzfCSO%mV_Vhuy-IARB7M&N zXzByvx6~f(c1G0GH^rKr3f(aGF3g;K#hH2ZB~iE8#Y`lygbu$fuGxFV^O=-l#}xZG zV=H!Cv54I-%xqjK)1sLDnND^ixdBZ)l7FloaNort?l}o<3FjreBcTGg5uTk{n0;$u zhRyAF8_p)A)8C8r{2`$i<_ig$pjoXzy`dXgka|ON*F~rBRrCbKjy`N7rbP|vUJ>)d zMXMk=riy4$d@y`0(xGP}te=@O3mrPG38VO(__O$6%Rx(%vYpK!vLe?II2za-=w+uF z21m!57Pwpo!O^2;1YE9BaCD^^1D9(Yy-1(A!20hc@3_{~n_8Q49nlLRWUK|M_FNDwe8G)2{fYIu*VqZ`9On>wM diff --git a/index.html b/index.html index 99f0bd9..b441e41 100755 --- a/index.html +++ b/index.html @@ -49,13 +49,14 @@

t-SNE Grid Search Resulting Diverse Projections

- [Sorting Metric: + [Sorting Projections According to Metric: ]
@@ -166,13 +167,14 @@

Projections Provenance

-
[Sorting Metric:
+
[Sorting Projections According to Metric:
]
diff --git a/js/tsne_vis.js b/js/tsne_vis.js index de0ab19..f21bf7d 100755 --- a/js/tsne_vis.js +++ b/js/tsne_vis.js @@ -147,7 +147,7 @@ function ReSort(flagInitialize) { metricsCopy = metrics } globalFlagCheck = false - document.getElementById("textToChange").innerHTML = "[Sorting Metric for Optimized Selection:"; + document.getElementById("textToChange").innerHTML = "[Sorting Projections According to Metric for the Current Points Selection:"; metricsSorting = dataReceivedFromServerOptimized['metrics'] metrics = dataReceivedFromServerOptimized['metricsEntire'] if (FocusedIDs.length == points.length) { @@ -206,7 +206,6 @@ var optionMetric = document.getElementById("param-SortM-view").value; // Get the var order = []; SelectedProjections = [] - if (optionMetric == 1) { order = metricsSorting[optionMetric-1] } else if (optionMetric == 2) { @@ -215,6 +214,8 @@ if (optionMetric == 1) { order = metricsSorting[optionMetric-1] } else if (optionMetric == 4) { order = metricsSorting[optionMetric-1] +} else if (optionMetric == 5) { + order = metricsSorting[optionMetric-1] } else { order = metricsSorting[optionMetric-1] } @@ -249,7 +250,7 @@ for (let k = 0; k < 8; k++) { var checkCounter = 0 var checkCounterMetr = 0 -var xValues = ['NH', 'T', 'C', 'S', 'SDC']; +var xValues = ['QMA', 'NH', 'T', 'C', 'S', 'SDC']; var colorscaleValue = [ [0, '#d9d9d9'], @@ -267,7 +268,7 @@ if(k >= 8) { hoverinfo:"z", colorscale: colorscaleValue, colorbar: { - title: 'Met. Val.', + title: 'Met. Per.', tickvals:[0,0.2,0.4,0.6,0.8,1], titleside:'right', }, @@ -900,6 +901,8 @@ function ReSortOver() { labelsTarget = uniqueTarget } +console.log(metrics) + var optionMetric = document.getElementById("param-SortMOver-view").value; // Get the threshold value with which the user set's the boundaries of the schema investigation var order = []; @@ -911,14 +914,16 @@ if (optionMetric == 1) { order = metricsSorting[optionMetric-1] } else if (optionMetric == 4) { order = metricsSorting[optionMetric-1] +} else if (optionMetric == 5) { + order = metricsSorting[optionMetric-1] } else { order = metricsSorting[optionMetric-1] } - + console.log(order) var checkCounter = 0 var checkCounterMetr = 0 - var xValues = ['NH', 'T', 'C', 'S', 'SDC']; + var xValues = ['QMA', 'NH', 'T', 'C', 'S', 'SDC']; var colorscaleValue = [ [0, '#d9d9d9'], @@ -926,7 +931,7 @@ if (optionMetric == 1) { ]; for (let k = 0; k < projections.length*2; k++) { - if((k >= 6 && k <= 11) || (k >=18 && k<=23) || (k >= 30 && k<= 35) || (k >= 42 && k<=47) || (k>=54 && k<=59) || (k >= 66 && k<=71)) { + if((k >= 5 && k < 10) || (k >=15 && k< 20) || (k >= 25 && k< 30) || (k >= 35 && k< 40) || (k >= 45 && k< 50)) { if (k == 6) { traces.push({ y: [], @@ -936,7 +941,7 @@ if (optionMetric == 1) { hoverinfo:"z", colorscale: colorscaleValue, colorbar: { - title: 'Metrics\' Values (Normalized)', + title: 'Normalized Metrics Performance', tickvals:[0,0.2,0.4,0.6,0.8,1], titleside:'right', }, @@ -1114,20 +1119,16 @@ if (optionMetric == 1) { showticklabels: false }, xaxis6: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false + side: 'top' }, yaxis6: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false + autorange: true, + showgrid: false, + zeroline: false, + showline: false, + autotick: true, + ticks: '', + showticklabels: false }, xaxis7: { side: 'top' @@ -1178,46 +1179,6 @@ if (optionMetric == 1) { showticklabels: false }, xaxis11: { - side: 'top' - }, - yaxis11: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis12: { - side: 'top' - }, - yaxis12: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis13: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis13: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis14: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1225,7 +1186,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis14: { + yaxis11: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1233,7 +1194,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis15: { + xaxis12: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1241,7 +1202,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis15: { + yaxis12: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1249,7 +1210,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis16: { + xaxis13: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1257,7 +1218,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis16: { + yaxis13: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1265,7 +1226,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis17: { + xaxis14: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1273,7 +1234,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis17: { + yaxis14: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1281,8 +1242,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis18: { - + xaxis15: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1290,8 +1250,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis18: { - + yaxis15: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1299,22 +1258,10 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis19: { - side: 'top' - }, - yaxis19: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis20: { + xaxis16: { side: 'top' }, - yaxis20: { + yaxis16: { autorange: true, showgrid: false, zeroline: false, @@ -1323,10 +1270,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis21: { + xaxis17: { side: 'top' }, - yaxis21: { + yaxis17: { autorange: true, showgrid: false, zeroline: false, @@ -1335,10 +1282,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis22: { + xaxis18: { side: 'top' }, - yaxis22: { + yaxis18: { autorange: true, showgrid: false, zeroline: false, @@ -1347,10 +1294,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis23: { + xaxis19: { side: 'top' }, - yaxis23: { + yaxis19: { autorange: true, showgrid: false, zeroline: false, @@ -1359,10 +1306,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis24: { + xaxis20: { side: 'top' }, - yaxis24: { + yaxis20: { autorange: true, showgrid: false, zeroline: false, @@ -1371,23 +1318,7 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis25: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis25: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis26: { + xaxis21: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1395,7 +1326,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis26: { + yaxis21: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1403,7 +1334,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis27: { + xaxis22: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1411,7 +1342,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis27: { + yaxis22: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1419,7 +1350,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis28: { + xaxis23: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1427,7 +1358,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis28: { + yaxis23: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1435,7 +1366,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis29: { + xaxis24: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1443,7 +1374,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis29: { + yaxis24: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1451,8 +1382,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis30: { - + xaxis25: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1460,8 +1390,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis30: { - + yaxis25: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1469,22 +1398,10 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis31: { - side: 'top' - }, - yaxis31: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis32: { + xaxis26: { side: 'top' }, - yaxis32: { + yaxis26: { autorange: true, showgrid: false, zeroline: false, @@ -1493,10 +1410,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis33: { + xaxis27: { side: 'top' }, - yaxis33: { + yaxis27: { autorange: true, showgrid: false, zeroline: false, @@ -1505,10 +1422,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis34: { + xaxis28: { side: 'top' }, - yaxis34: { + yaxis28: { autorange: true, showgrid: false, zeroline: false, @@ -1517,10 +1434,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis35: { + xaxis29: { side: 'top' }, - yaxis35: { + yaxis29: { autorange: true, showgrid: false, zeroline: false, @@ -1529,10 +1446,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis36: { + xaxis30: { side: 'top' }, - yaxis36: { + yaxis30: { autorange: true, showgrid: false, zeroline: false, @@ -1541,7 +1458,7 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis37: { + xaxis31: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1549,7 +1466,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis37: { + yaxis31: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1557,23 +1474,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis38: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis38: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis39: { + xaxis32: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1581,7 +1482,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis39: { + yaxis32: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1589,7 +1490,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis40: { + xaxis33: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1597,7 +1498,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis40: { + yaxis33: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1605,7 +1506,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis41: { + xaxis34: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1613,7 +1514,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis41: { + yaxis34: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1621,8 +1522,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis42: { - + xaxis35: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1630,8 +1530,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis42: { - + yaxis35: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1639,10 +1538,10 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis43: { + xaxis36: { side: 'top' }, - yaxis43: { + yaxis36: { autorange: true, showgrid: false, zeroline: false, @@ -1651,10 +1550,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis44: { + xaxis37: { side: 'top' }, - yaxis44: { + yaxis37: { autorange: true, showgrid: false, zeroline: false, @@ -1663,10 +1562,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis45: { + xaxis38: { side: 'top' }, - yaxis45: { + yaxis38: { autorange: true, showgrid: false, zeroline: false, @@ -1675,10 +1574,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis46: { + xaxis39: { side: 'top' }, - yaxis46: { + yaxis39: { autorange: true, showgrid: false, zeroline: false, @@ -1687,10 +1586,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis47: { + xaxis40: { side: 'top' }, - yaxis47: { + yaxis40: { autorange: true, showgrid: false, zeroline: false, @@ -1699,211 +1598,15 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis48: { - side: 'top' + xaxis41: { + linecolor: 'black', + linewidth: 1, + mirror: true, + showgrid: false, + zeroline: false, + showticklabels: false }, - yaxis48: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis49: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis49: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis50: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis50: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis51: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis51: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis52: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis52: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis53: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis53: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis54: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis54: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis55: { - side: 'top' - }, - yaxis55: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis56: { - side: 'top' - }, - yaxis56: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis57: { - side: 'top' - }, - yaxis57: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis58: { - side: 'top' - }, - yaxis58: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis59: { - side: 'top' - }, - yaxis59: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis60: { - side: 'top' - }, - yaxis60: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis61: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis61: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - xaxis62: { - linecolor: 'black', - linewidth: 1, - mirror: true, - showgrid: false, - zeroline: false, - showticklabels: false - }, - yaxis62: { + yaxis41: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1911,7 +1614,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis63: { + xaxis42: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1919,7 +1622,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis63: { + yaxis42: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1927,7 +1630,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis64: { + xaxis43: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1935,7 +1638,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis64: { + yaxis43: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1943,7 +1646,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis65: { + xaxis44: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1951,7 +1654,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis65: { + yaxis44: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1959,7 +1662,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis66: { + xaxis45: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1967,7 +1670,7 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - yaxis66: { + yaxis45: { linecolor: 'black', linewidth: 1, mirror: true, @@ -1975,22 +1678,10 @@ if (optionMetric == 1) { zeroline: false, showticklabels: false }, - xaxis67: { - side: 'top' - }, - yaxis67: { - autorange: true, - showgrid: false, - zeroline: false, - showline: false, - autotick: true, - ticks: '', - showticklabels: false - }, - xaxis68: { + xaxis46: { side: 'top' }, - yaxis68: { + yaxis46: { autorange: true, showgrid: false, zeroline: false, @@ -1999,10 +1690,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis69: { + xaxis47: { side: 'top' }, - yaxis69: { + yaxis47: { autorange: true, showgrid: false, zeroline: false, @@ -2011,10 +1702,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis70: { + xaxis48: { side: 'top' }, - yaxis70: { + yaxis48: { autorange: true, showgrid: false, zeroline: false, @@ -2023,10 +1714,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis71: { + xaxis49: { side: 'top' }, - yaxis71: { + yaxis49: { autorange: true, showgrid: false, zeroline: false, @@ -2035,10 +1726,10 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, - xaxis72: { + xaxis50: { side: 'top' }, - yaxis72: { + yaxis50: { autorange: true, showgrid: false, zeroline: false, @@ -2047,6 +1738,7 @@ if (optionMetric == 1) { ticks: '', showticklabels: false }, + margin: { l: 10, r: 5, @@ -2060,7 +1752,7 @@ if (optionMetric == 1) { hovermode:'closest', legend: {"orientation": "h", y: 0}, - grid: {rows: 12, columns: 6, pattern: 'independent'}, + grid: {rows: 10, columns: 5, pattern: 'independent'}, } var config = {displayModeBar: false} @@ -2084,68 +1776,46 @@ if (optionMetric == 1) { 'yaxis4.linecolor': 'black', // updates the end of the yaxis range 'xaxis5.linecolor': 'black', // updates the xaxis range 'yaxis5.linecolor': 'black', // updates the end of the yaxis range - 'xaxis6.linecolor': 'black', // updates the xaxis range - 'yaxis6.linecolor': 'black', // updates the end of the yaxis range + 'xaxis11.linecolor': 'black', // updates the xaxis range + 'yaxis11.linecolor': 'black', // updates the end of the yaxis range + 'xaxis12.linecolor': 'black', // updates the xaxis range + 'yaxis12.linecolor': 'black', // updates the end of the yaxis range 'xaxis13.linecolor': 'black', // updates the xaxis range 'yaxis13.linecolor': 'black', // updates the end of the yaxis range 'xaxis14.linecolor': 'black', // updates the xaxis range 'yaxis14.linecolor': 'black', // updates the end of the yaxis range 'xaxis15.linecolor': 'black', // updates the xaxis range 'yaxis15.linecolor': 'black', // updates the end of the yaxis range - 'xaxis16.linecolor': 'black', // updates the xaxis range - 'yaxis16.linecolor': 'black', // updates the end of the yaxis range - 'xaxis17.linecolor': 'black', // updates the xaxis range - 'yaxis17.linecolor': 'black', // updates the end of the yaxis range - 'xaxis18.linecolor': 'black', // updates the xaxis range - 'yaxis18.linecolor': 'black', // updates the end of the yaxis range + 'xaxis21.linecolor': 'black', // updates the xaxis range + 'yaxis21.linecolor': 'black', // updates the end of the yaxis range + 'xaxis22.linecolor': 'black', // updates the xaxis range + 'yaxis22.linecolor': 'black', // updates the end of the yaxis range + 'xaxis23.linecolor': 'black', // updates the xaxis range + 'yaxis23.linecolor': 'black', // updates the end of the yaxis range + 'xaxis24.linecolor': 'black', // updates the xaxis range + 'yaxis24.linecolor': 'black', // updates the end of the yaxis range 'xaxis25.linecolor': 'black', // updates the xaxis range 'yaxis25.linecolor': 'black', // updates the end of the yaxis range - 'xaxis26.linecolor': 'black', // updates the xaxis range - 'yaxis26.linecolor': 'black', // updates the end of the yaxis range - 'xaxis27.linecolor': 'black', // updates the xaxis range - 'yaxis27.linecolor': 'black', // updates the end of the yaxis range - 'xaxis28.linecolor': 'black', // updates the xaxis range - 'yaxis28.linecolor': 'black', // updates the end of the yaxis range - 'xaxis29.linecolor': 'black', // updates the xaxis range - 'yaxis29.linecolor': 'black', // updates the end of the yaxis range - 'xaxis30.linecolor': 'black', // updates the xaxis range - 'yaxis30.linecolor': 'black', // updates the end of the yaxis range - 'xaxis37.linecolor': 'black', // updates the xaxis range - 'yaxis37.linecolor': 'black', // updates the end of the yaxis range - 'xaxis38.linecolor': 'black', // updates the xaxis range - 'yaxis38.linecolor': 'black', // updates the end of the yaxis range - 'xaxis39.linecolor': 'black', // updates the xaxis range - 'yaxis39.linecolor': 'black', // updates the end of the yaxis range - 'xaxis40.linecolor': 'black', // updates the xaxis range - 'yaxis40.linecolor': 'black', // updates the end of the yaxis range + 'xaxis31.linecolor': 'black', // updates the xaxis range + 'yaxis31.linecolor': 'black', // updates the end of the yaxis range + 'xaxis32.linecolor': 'black', // updates the xaxis range + 'yaxis32.linecolor': 'black', // updates the end of the yaxis range + 'xaxis33.linecolor': 'black', // updates the xaxis range + 'yaxis33.linecolor': 'black', // updates the end of the yaxis range + 'xaxis34.linecolor': 'black', // updates the xaxis range + 'yaxis34.linecolor': 'black', // updates the end of the yaxis range + 'xaxis35.linecolor': 'black', // updates the xaxis range + 'yaxis35.linecolor': 'black', // updates the end of the yaxis range 'xaxis41.linecolor': 'black', // updates the xaxis range 'yaxis41.linecolor': 'black', // updates the end of the yaxis range 'xaxis42.linecolor': 'black', // updates the xaxis range 'yaxis42.linecolor': 'black', // updates the end of the yaxis range - 'xaxis49.linecolor': 'black', // updates the xaxis range - 'yaxis49.linecolor': 'black', // updates the end of the yaxis range - 'xaxis50.linecolor': 'black', // updates the xaxis range - 'yaxis50.linecolor': 'black', // updates the end of the yaxis range - 'xaxis51.linecolor': 'black', // updates the xaxis range - 'yaxis51.linecolor': 'black', // updates the end of the yaxis range - 'xaxis52.linecolor': 'black', // updates the xaxis range - 'yaxis52.linecolor': 'black', // updates the end of the yaxis range - 'xaxis53.linecolor': 'black', // updates the xaxis range - 'yaxis53.linecolor': 'black', // updates the end of the yaxis range - 'xaxis54.linecolor': 'black', // updates the xaxis range - 'yaxis54.linecolor': 'black', // updates the end of the yaxis range - 'xaxis61.linecolor': 'black', // updates the xaxis range - 'yaxis61.linecolor': 'black', // updates the end of the yaxis range - 'xaxis62.linecolor': 'black', // updates the xaxis range - 'yaxis62.linecolor': 'black', // updates the end of the yaxis range - 'xaxis63.linecolor': 'black', // updates the xaxis range - 'yaxis63.linecolor': 'black', // updates the end of the yaxis range - 'xaxis64.linecolor': 'black', // updates the xaxis range - 'yaxis64.linecolor': 'black', // updates the end of the yaxis range - 'xaxis65.linecolor': 'black', // updates the xaxis range - 'yaxis65.linecolor': 'black', // updates the end of the yaxis range - 'xaxis66.linecolor': 'black', // updates the xaxis range - 'yaxis66.linecolor': 'black', // updates the end of the yaxis range + 'xaxis43.linecolor': 'black', // updates the xaxis range + 'yaxis43.linecolor': 'black', // updates the end of the yaxis range + 'xaxis44.linecolor': 'black', // updates the xaxis range + 'yaxis44.linecolor': 'black', // updates the end of the yaxis range + 'xaxis45.linecolor': 'black', // updates the xaxis range + 'yaxis45.linecolor': 'black', // updates the end of the yaxis range }; Plotly.relayout(graphDiv, update) @@ -2192,155 +1862,139 @@ if (optionMetric == 1) { }; SelProjIDS.push(4) - } else if (data.points[0].xaxis._id == 'x6') { + } else if (data.points[0].xaxis._id == 'x11') { var update = { - 'xaxis6.linecolor': 'red', // updates the xaxis range - 'yaxis6.linecolor': 'red' // updates the end of the yaxis range + 'xaxis11.linecolor': 'red', // updates the xaxis range + 'yaxis11.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(5) - } else if (data.points[0].xaxis._id == 'x13') { + } else if (data.points[0].xaxis._id == 'x12') { var update = { - 'xaxis13.linecolor': 'red', // updates the xaxis range - 'yaxis13.linecolor': 'red' // updates the end of the yaxis range + 'xaxis12.linecolor': 'red', // updates the xaxis range + 'yaxis12.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(6) - } else if (data.points[0].xaxis._id == 'x14') { + } else if (data.points[0].xaxis._id == 'x13') { var update = { - 'xaxis14.linecolor': 'red', // updates the xaxis range - 'yaxis14.linecolor': 'red' // updates the end of the yaxis range + 'xaxis13.linecolor': 'red', // updates the xaxis range + 'yaxis13.linecolor': 'red' // updates the end of the yaxis range }; firstProj = false SelProjIDS.push(7) - } else if (data.points[0].xaxis._id == 'x15') { + } else if (data.points[0].xaxis._id == 'x14') { var update = { - 'xaxis15.linecolor': 'red', // updates the xaxis range - 'yaxis15.linecolor': 'red' // updates the end of the yaxis range + 'xaxis14.linecolor': 'red', // updates the xaxis range + 'yaxis14.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(8) - } else if (data.points[0].xaxis._id == 'x16') { + } else if (data.points[0].xaxis._id == 'x15') { var update = { - 'xaxis16.linecolor': 'red', // updates the xaxis range - 'yaxis16.linecolor': 'red' // updates the end of the yaxis range + 'xaxis15.linecolor': 'red', // updates the xaxis range + 'yaxis15.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(9) - } else if (data.points[0].xaxis._id == 'x17') { + } else if (data.points[0].xaxis._id == 'x21') { var update = { - 'xaxis17.linecolor': 'red', // updates the xaxis range - 'yaxis17.linecolor': 'red' // updates the end of the yaxis range + 'xaxis21.linecolor': 'red', // updates the xaxis range + 'yaxis21.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(10) - } else if (data.points[0].xaxis._id == 'x18') { + } else if (data.points[0].xaxis._id == 'x22') { var update = { - 'xaxis18.linecolor': 'red', // updates the xaxis range - 'yaxis18.linecolor': 'red' // updates the end of the yaxis range + 'xaxis22.linecolor': 'red', // updates the xaxis range + 'yaxis22.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(11) - } else if (data.points[0].xaxis._id == 'x25') { + } else if (data.points[0].xaxis._id == 'x23') { var update = { - 'xaxis25.linecolor': 'red', // updates the xaxis range - 'yaxis25.linecolor': 'red' // updates the end of the yaxis range + 'xaxis23.linecolor': 'red', // updates the xaxis range + 'yaxis23.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(12) - } else if (data.points[0].xaxis._id == 'x26') { + } else if (data.points[0].xaxis._id == 'x24') { var update = { - 'xaxis26.linecolor': 'red', // updates the xaxis range - 'yaxis26.linecolor': 'red' // updates the end of the yaxis range + 'xaxis24.linecolor': 'red', // updates the xaxis range + 'yaxis24.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(13) - } else if (data.points[0].xaxis._id == 'x27') { + } else if (data.points[0].xaxis._id == 'x25') { var update = { - 'xaxis27.linecolor': 'red', // updates the xaxis range - 'yaxis27.linecolor': 'red' // updates the end of the yaxis range + 'xaxis25.linecolor': 'red', // updates the xaxis range + 'yaxis25.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(14) - } else if (data.points[0].xaxis._id == 'x28') { + } else if (data.points[0].xaxis._id == 'x31') { var update = { - 'xaxis28.linecolor': 'red', // updates the xaxis range - 'yaxis28.linecolor': 'red' // updates the end of the yaxis range + 'xaxis31.linecolor': 'red', // updates the xaxis range + 'yaxis31.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(15) - } else if (data.points[0].xaxis._id == 'x29') { + } else if (data.points[0].xaxis._id == 'x32') { var update = { - 'xaxis29.linecolor': 'red', // updates the xaxis range - 'yaxis29.linecolor': 'red' // updates the end of the yaxis range + 'xaxis32.linecolor': 'red', // updates the xaxis range + 'yaxis32.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(16) - } else if (data.points[0].xaxis._id == 'x30') { + } else if (data.points[0].xaxis._id == 'x33') { var update = { - 'xaxis30.linecolor': 'red', // updates the xaxis range - 'yaxis30.linecolor': 'red' // updates the end of the yaxis range + 'xaxis33.linecolor': 'red', // updates the xaxis range + 'yaxis33.linecolor': 'red' // updates the end of the yaxis range }; firstProj = false SelProjIDS.push(17) - } else if (data.points[0].xaxis._id == 'x37') { + } else if (data.points[0].xaxis._id == 'x34') { var update = { - 'xaxis37.linecolor': 'red', // updates the xaxis range - 'yaxis37.linecolor': 'red' // updates the end of the yaxis range + 'xaxis34.linecolor': 'red', // updates the xaxis range + 'yaxis34.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(18) - } else if (data.points[0].xaxis._id == 'x38') { + } else if (data.points[0].xaxis._id == 'x35') { var update = { - 'xaxis38.linecolor': 'red', // updates the xaxis range - 'yaxis38.linecolor': 'red' // updates the end of the yaxis range + 'xaxis35.linecolor': 'red', // updates the xaxis range + 'yaxis35.linecolor': 'red' // updates the end of the yaxis range }; SelProjIDS.push(19) - } else if (data.points[0].xaxis._id == 'x39') { - - var update = { - 'xaxis39.linecolor': 'red', // updates the xaxis range - 'yaxis39.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(20) - } else if (data.points[0].xaxis._id == 'x40') { - - var update = { - 'xaxis40.linecolor': 'red', // updates the xaxis range - 'yaxis40.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(21) } else if (data.points[0].xaxis._id == 'x41') { var update = { 'xaxis41.linecolor': 'red', // updates the xaxis range 'yaxis41.linecolor': 'red' // updates the end of the yaxis range }; - - SelProjIDS.push(22) + + SelProjIDS.push(20) } else if (data.points[0].xaxis._id == 'x42') { var update = { @@ -2348,103 +2002,31 @@ if (optionMetric == 1) { 'yaxis42.linecolor': 'red' // updates the end of the yaxis range }; - SelProjIDS.push(23) - } else if (data.points[0].xaxis._id == 'x49') { - - var update = { - 'xaxis49.linecolor': 'red', // updates the xaxis range - 'yaxis49.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(24) - } else if (data.points[0].xaxis._id == 'x50') { - - var update = { - 'xaxis50.linecolor': 'red', // updates the xaxis range - 'yaxis50.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(25) - } else if (data.points[0].xaxis._id == 'x51') { - - var update = { - 'xaxis51.linecolor': 'red', // updates the xaxis range - 'yaxis51.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(26) - } else if (data.points[0].xaxis._id == 'x52') { - - var update = { - 'xaxis52.linecolor': 'red', // updates the xaxis range - 'yaxis52.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(27) - } else if (data.points[0].xaxis._id == 'x53') { - - var update = { - 'xaxis53.linecolor': 'red', // updates the xaxis range - 'yaxis53.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(28) - } else if (data.points[0].xaxis._id == 'x54') { - - var update = { - 'xaxis54.linecolor': 'red', // updates the xaxis range - 'yaxis54.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(29) - } else if (data.points[0].xaxis._id == 'x61') { - - var update = { - 'xaxis61.linecolor': 'red', // updates the xaxis range - 'yaxis61.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(30) - } else if (data.points[0].xaxis._id == 'x62') { - - var update = { - 'xaxis62.linecolor': 'red', // updates the xaxis range - 'yaxis62.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(31) - } else if (data.points[0].xaxis._id == 'x63') { + SelProjIDS.push(21) + } else if (data.points[0].xaxis._id == 'x43') { var update = { - 'xaxis63.linecolor': 'red', // updates the xaxis range - 'yaxis63.linecolor': 'red' // updates the end of the yaxis range + 'xaxis43.linecolor': 'red', // updates the xaxis range + 'yaxis43.linecolor': 'red' // updates the end of the yaxis range }; - SelProjIDS.push(32) - } else if (data.points[0].xaxis._id == 'x64') { + SelProjIDS.push(22) + } else if (data.points[0].xaxis._id == 'x44') { var update = { - 'xaxis64.linecolor': 'red', // updates the xaxis range - 'yaxis64.linecolor': 'red' // updates the end of the yaxis range + 'xaxis44.linecolor': 'red', // updates the xaxis range + 'yaxis44.linecolor': 'red' // updates the end of the yaxis range }; - SelProjIDS.push(33) - } else if (data.points[0].xaxis._id == 'x65') { - - var update = { - 'xaxis65.linecolor': 'red', // updates the xaxis range - 'yaxis65.linecolor': 'red' // updates the end of the yaxis range - }; - - SelProjIDS.push(34) + SelProjIDS.push(23) } else { var update = { - 'xaxis66.linecolor': 'red', // updates the xaxis range - 'yaxis66.linecolor': 'red' // updates the end of the yaxis range + 'xaxis45.linecolor': 'red', // updates the xaxis range + 'yaxis45.linecolor': 'red' // updates the end of the yaxis range }; - SelProjIDS.push(35) + SelProjIDS.push(24) } document.getElementById("confirmModal").disabled = false; diff --git a/tsneGrid.py b/tsneGrid.py index 15c8ec4..8db86c5 100644 --- a/tsneGrid.py +++ b/tsneGrid.py @@ -138,7 +138,7 @@ def continuity(D_high, D_low, k): return float((1 - (2 / (n * k * (2 * n - 3 * k - 1)) * sum_i)).squeeze()) def normalized_stress(D_high, D_low): - return np.sum((D_high - D_low)**2) / np.sum(D_high**2) / 100 + return (-1) * (np.sum((D_high - D_low)**2) / np.sum(D_high**2) / 100) def shepard_diagram_correlation(D_high, D_low): if len(D_high.shape) > 1: @@ -180,7 +180,7 @@ def procrustesFun(projections): def Clustering(similarity): similarityNP = np.array(similarity) - n_clusters = 36 + n_clusters = 25 # change that to send less diverse projections kmedoids = KMedoids(n_clusters=n_clusters, random_state=0, metric='precomputed').fit(similarityNP) global dataProc clusterIndex = [] @@ -267,6 +267,7 @@ def calculateGrid(): metricCont = [] metricStress = [] metricShepCorr = [] + metricsAverage = [] global convertLabels convertLabels = [] @@ -338,10 +339,14 @@ def calculateGrid(): valueNeigh = (metricNeigh[index] - min_value_neigh) / (max_value_neigh - min_value_neigh) valueTrust = (metricTrust[index] - min_value_trust) / (max_value_trust - min_value_trust) valueCont = (metricCont[index] - min_value_cont) / (max_value_cont - min_value_cont) - valueStress = (metricStress[index] - min_value_stress) / (max_value_stress - min_value_stress) + valueStress = 1 - ((metricStress[index]*(-1) - max_value_stress*(-1)) / (min_value_stress*(-1) - max_value_stress*(-1))) # we need the opposite valueShep = (metricShepCorr[index] - min_value_shep) / (max_value_shep - min_value_shep) - metricsMatrixEntire.append([valueNeigh,valueTrust,valueCont,valueStress,valueShep]) + average = (valueNeigh + valueTrust + valueCont + valueStress + valueShep) / 5 + + metricsAverage.append(average) + metricsMatrixEntire.append([average,valueNeigh,valueTrust,valueCont,valueStress,valueShep]) + sortMetricsAverage = sorted(range(len(metricsAverage)), key=lambda k: metricsAverage[k], reverse=True) sortNeigh = sorted(range(len(metricNeigh)), key=lambda k: metricNeigh[k], reverse=True) sortTrust = sorted(range(len(metricTrust)), key=lambda k: metricTrust[k], reverse=True) sortCont = sorted(range(len(metricCont)), key=lambda k: metricCont[k], reverse=True) @@ -351,6 +356,7 @@ def calculateGrid(): global metricsMatrix metricsMatrix = [] + metricsMatrix.append(sortMetricsAverage) metricsMatrix.append(sortNeigh) metricsMatrix.append(sortTrust) metricsMatrix.append(sortCont) @@ -385,6 +391,7 @@ def OptimizeSelection(): metricCont = [] metricStress = [] metricShepCorr = [] + metricsAverage = [] for index, loop in enumerate(clusterIndex): resultNeigh = neighborhood_hit(np.array(projectionsAll[index]), convertLabels, KeepKs[index], dataSelected) @@ -392,7 +399,9 @@ def OptimizeSelection(): resultContinuity = continuity(D_highSpace[dataSelected, :], D_lowSpaceList[index][dataSelected, :], KeepKs[index]) resultStress = normalized_stress(D_highSpace[dataSelected, :], D_lowSpaceList[index][dataSelected, :]) resultShep = shepard_diagram_correlation(D_highSpace[dataSelected][:, dataSelected], D_lowSpaceList[index][dataSelected][:, dataSelected]) - + resultAverage = (resultNeigh + resultTrust + resultContinuity + resultStress + resultShep) / 5 + print(resultAverage) + metricsAverage.append(resultAverage) metricNeigh.append(resultNeigh) metricTrust.append(resultTrust) metricCont.append(resultContinuity) @@ -423,17 +432,22 @@ def OptimizeSelection(): valueCont = (metricCont[index] - min_value_cont) / (max_value_cont - min_value_cont) valueStress = (metricStress[index] - min_value_stress) / (max_value_stress - min_value_stress) valueShep = (metricShepCorr[index] - min_value_shep) / (max_value_shep - min_value_shep) - metricsMatrixEntireSel.append([valueNeigh,valueTrust,valueCont,valueStress,valueShep]) + average = (valueNeigh + valueTrust + valueCont + valueStress + valueShep) / 5 + metricsMatrixEntireSel.append([average,valueNeigh,valueTrust,valueCont,valueStress,valueShep]) + sortMetricsAverage = sorted(range(len(metricsAverage)), key=lambda k: metricsAverage[k], reverse=True) + print(sortMetricsAverage) + print(metricsAverage) sortNeigh = sorted(range(len(metricNeigh)), key=lambda k: metricNeigh[k], reverse=True) sortTrust = sorted(range(len(metricTrust)), key=lambda k: metricTrust[k], reverse=True) sortCont = sorted(range(len(metricCont)), key=lambda k: metricCont[k], reverse=True) - sortStress = sorted(range(len(metricStress)), key=lambda k: metricStress[k], reverse=True) + sortStress = sorted(range(len(metricStress)), key=lambda k: metricStress[k], reverse=False) sortShepCorr = sorted(range(len(metricShepCorr)), key=lambda k: metricShepCorr[k], reverse=True) global metricsMatrixSel metricsMatrixSel = [] + metricsMatrixSel.append(sortMetricsAverage) metricsMatrixSel.append(sortNeigh) metricsMatrixSel.append(sortTrust) metricsMatrixSel.append(sortCont)