|
|
|
@ -399,9 +399,8 @@ 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) |
|
|
|
@ -430,18 +429,18 @@ def OptimizeSelection(): |
|
|
|
|
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) |
|
|
|
|
average = (valueNeigh + valueTrust + valueCont + valueStress + valueShep) / 5 |
|
|
|
|
|
|
|
|
|
metricsAverage.append(average) |
|
|
|
|
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=False) |
|
|
|
|
sortStress = sorted(range(len(metricStress)), key=lambda k: metricStress[k], reverse=True) |
|
|
|
|
sortShepCorr = sorted(range(len(metricShepCorr)), key=lambda k: metricShepCorr[k], reverse=True) |
|
|
|
|
|
|
|
|
|
global metricsMatrixSel |
|
|
|
|