parent 207d8837c8
commit 2472fe2db3
  1. BIN
      __pycache__/run.cpython-38.pyc
  2. 38
      frontend/src/components/FeatureSpaceDetail.vue
  3. 25
      run.py

Binary file not shown.

@ -59,6 +59,7 @@ export default {
featureAddRemCount: [],
mode: 0, // this should be 0
KeepIDs: [],
KeepIDTransform: '',
keepNumberOfCompareNodes: 0
}
},
@ -99,6 +100,8 @@ export default {
},
setLayerCompare() {
this.mode = 1
this.KeepIDTransform = ''
EventBus.$emit('brushLink', -1)
this.graphVizualization()
},
computeOnce () {
@ -111,13 +114,11 @@ export default {
}
var featureNames = JSON.parse(this.dataFS[35])
var pushEach
var oldVal
var newVal
var outcome
var countLoc
var pushEachFinalFinal = []
for (let loop=1; loop<=5; loop++) {
var corrMatrixCombLoc =[]
@ -137,7 +138,7 @@ export default {
pushEach = []
Object.entries(transf1).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var retrieveData = dataLocOnce[loop-1]
var search = Object.values(retrieveData[key])
oldVal = Math.abs(search[countLoc]) + oldVal
@ -157,7 +158,7 @@ export default {
countLoc = 0
Object.entries(transf2).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var retrieveData = dataLocOnce[loop-1]
var search = Object.values(retrieveData[key])
oldVal = Math.abs(search[countLoc]) + oldVal
@ -177,7 +178,7 @@ export default {
countLoc = 0
Object.entries(transf3).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var retrieveData = dataLocOnce[loop-1]
var search = Object.values(retrieveData[key])
oldVal = Math.abs(search[countLoc]) + oldVal
@ -197,7 +198,7 @@ export default {
countLoc = 0
Object.entries(transf4).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var retrieveData = dataLocOnce[loop-1]
var search = Object.values(retrieveData[key])
oldVal = Math.abs(search[countLoc]) + oldVal
@ -259,7 +260,7 @@ export default {
pushEach = []
Object.entries(transf1).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var search = Object.values(dataLoc[key])
oldVal = Math.abs(search[countLoc]) + oldVal
newVal = Math.abs(Object.values(value)[0]) + newVal
@ -282,7 +283,7 @@ export default {
countLoc = 0
Object.entries(transf2).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var search = Object.values(dataLoc[key])
oldVal = Math.abs(search[countLoc]) + oldVal
newVal = Math.abs(Object.values(value)[0]) + newVal
@ -305,7 +306,7 @@ export default {
countLoc = 0
Object.entries(transf3).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var search = Object.values(dataLoc[key])
oldVal = Math.abs(search[countLoc]) + oldVal
newVal = Math.abs(Object.values(value)[0]) + newVal
@ -328,7 +329,7 @@ export default {
countLoc = 0
Object.entries(transf4).forEach(
function ([feature, value]) {
var key = Object.keys(value)
var key = listofNodes[index]
var search = Object.values(dataLoc[key])
oldVal = Math.abs(search[countLoc]) + oldVal
newVal = Math.abs(Object.values(value)[0]) + newVal
@ -531,6 +532,7 @@ export default {
var modeLoc = this.mode
var selectionCounter = this.keepNumberOfCompareNodes
var IDsGather = this.KeepIDs
var IDsGatherTrans = this.KeepIDTransform
var node = svg.append('g')
.attr('class', 'nodes')
@ -545,6 +547,7 @@ export default {
var clearSendNode = []
clearSendNode.push(id.name)
clearSendNode.push(clickedNode-1)
EventBus.$emit('UpdateIDTrans', clickedNode+"_root")
EventBus.$emit('transformNodes', clearSendNode)
} else {
for (let i = 0; i < listofNodes.length; i++) {
@ -710,6 +713,8 @@ export default {
node.append('title').text(function (d) { return d.name; });
EventBus.$emit('brushLink', -1)
});
var chartWidth = 310;
var chartHeight = 65;
var margin = {left: 8, right: 15, top: 10, bottom: 40};
@ -738,14 +743,14 @@ export default {
.text("Weighted graph readability (%)");
var readabilityCircles = chartSvg.append('g').selectAll('circle');
// 48 parameters
// 32 parameter combinations
var paramGroups = [
{name: 'chargeStrength', values: [-80]},
{name: 'linkDistance', values: [-80]},
{name: 'linkStrength', values: [0.25, 0.5]},
{name: 'gravity', values: [0, 0.5]},
{name: 'iterations', values: [1, 2]},
{name: 'alphaDecay', values: [0, 0.0228, 0.05]},
{name: 'alphaDecay', values: [0.0228, 0.05]},
{name: 'velocityDecay', values: [0.4, 0.8]}
];
@ -822,7 +827,6 @@ export default {
dispatch.call('layoutend', forceSim, p, i);
++i;
if (i >= paramList.length) {
var widthLoc = 100;
@ -1278,6 +1282,11 @@ export default {
.text("MI")
}
stepper.stop();
if (IDsGatherTrans != '') {
let ID = document.getElementsByClassName(IDsGatherTrans)[0].parentElement.getAttribute('id')
d3.select('#'+ID).dispatch('click');
IDsGatherTrans = ''
}
}
});
@ -1368,7 +1377,6 @@ export default {
}
this.legendOnlyOnce = false
},
reset () {
var svg = d3.select("#FeatureGraph");
@ -1382,6 +1390,8 @@ export default {
EventBus.$on('Counter', data => { this.keepNumberOfCompareNodes = data })
EventBus.$on('UpdateIDs', data => { this.KeepIDs = data })
EventBus.$on('UpdateIDTrans', data => { this.KeepIDTransform = data })
this.InitSlider()
EventBus.$on('CorrThres', data => { this.threshold = data })
EventBus.$on('CorrThres', this.initializeNetwork)

@ -461,6 +461,7 @@ def executeModel(exeCall, flagEx, nodeTransfName):
global columnsNewGen
global columnsNames
global listofTransformations
global XDataStoredOriginal
columnsNames = []
scores = []
@ -488,6 +489,7 @@ def executeModel(exeCall, flagEx, nodeTransfName):
if (len(exeCall) != 0):
if (flagEx == 1):
XData = XData.drop(XData.columns[exeCall], axis=1)
XDataStoredOriginal = XDataStoredOriginal.drop(XDataStoredOriginal.columns[exeCall], axis=1)
elif (flagEx == 2):
columnsKeepNew = []
columns = XDataGen.columns.values.tolist()
@ -498,6 +500,7 @@ def executeModel(exeCall, flagEx, nodeTransfName):
XDataTemp = XDataGen[columnsKeepNew]
XData[columnsKeepNew] = XDataTemp.values
XDataStoredOriginal[columnsKeepNew] = XDataTemp.values
elif (flagEx == 4):
splittedCol = nodeTransfName.split('_')
XData.rename(columns={ XData.columns[exeCall[0]]: nodeTransfName }, inplace = True)
@ -515,6 +518,7 @@ def executeModel(exeCall, flagEx, nodeTransfName):
else:
XData[nodeTransfName] = np.log10(XData[nodeTransfName])
XData[nodeTransfName] = XData[nodeTransfName].round()
XDataStored = XData.copy()
print(XData)
columnsNamesLoc = XData.columns.values.tolist()
@ -651,19 +655,19 @@ def sendFinalResults():
def Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5):
XDataNumericColumn = XDataStored.select_dtypes(include='number')
# XDataNumericColumn = XData.select_dtypes(include='number')
XDataNumeric = XDataStoredOriginal.select_dtypes(include='number')
columns = list(XDataNumericColumn)
columns = list(XDataNumeric)
global packCorrTransformed
packCorrTransformed = []
# FIX THAT!
for count, i in enumerate(columns):
dicTransf = {}
splittedCol = columnsNames[(count)*len(listofTransformations)+0]
splittedCol = columnsNames[(count)*len(listofTransformations)+0].split('_')
if(len(splittedCol) == 1):
d={}
XDataNumericCopy = XDataNumeric.copy()
for number in range(1,6):
@ -680,7 +684,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5):
illusion = locals()[quadrantVariable]
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :]
dicTransf["transf1"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], d['DataRows5'], quadrant1, quadrant2, quadrant3, quadrant4, quadrant5, i, count)
splittedCol = columnsNames[(count)*len(listofTransformations)+1]
splittedCol = columnsNames[(count)*len(listofTransformations)+1].split('_')
if(len(splittedCol) == 1):
d={}
XDataNumericCopy = XDataNumeric.copy()
@ -699,7 +703,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5):
illusion = locals()[quadrantVariable]
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :]
dicTransf["transf2"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], d['DataRows5'], quadrant1, quadrant2, quadrant3, quadrant4, quadrant5, i, count)
splittedCol = columnsNames[(count)*len(listofTransformations)+2]
splittedCol = columnsNames[(count)*len(listofTransformations)+2].split('_')
if(len(splittedCol) == 1):
d={}
XDataNumericCopy = XDataNumeric.copy()
@ -718,7 +722,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5):
illusion = locals()[quadrantVariable]
d["DataRows{0}".format(number)] = XDataNumericCopy.iloc[illusion, :]
dicTransf["transf3"] = NewComputationTransf(d['DataRows1'], d['DataRows2'], d['DataRows3'], d['DataRows4'], d['DataRows5'], quadrant1, quadrant2, quadrant3, quadrant4, quadrant5, i, count)
splittedCol = columnsNames[(count)*len(listofTransformations)+3]
splittedCol = columnsNames[(count)*len(listofTransformations)+3].split('_')
if(len(splittedCol) == 1):
d={}
XDataNumericCopy = XDataNumeric.copy()
@ -742,7 +746,6 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5):
return 'Everything Okay'
def NewComputationTransf(DataRows1, DataRows2, DataRows3, DataRows4, DataRows5, quadrant1, quadrant2, quadrant3, quadrant4, quadrant5, feature, count):
corrMatrix1 = DataRows1.corr()
corrMatrix1 = corrMatrix1.abs()
corrMatrix2 = DataRows2.corr()
@ -1023,14 +1026,14 @@ def Seperation():
quadrant5.append(index)
probabilityPredictions.append(value)
Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5)
# Main Features
DataRows1 = XData.iloc[quadrant1, :]
DataRows2 = XData.iloc[quadrant2, :]
DataRows3 = XData.iloc[quadrant3, :]
DataRows4 = XData.iloc[quadrant4, :]
DataRows5 = XData.iloc[quadrant5, :]
Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5)
corrMatrix1 = DataRows1.corr()
corrMatrix1 = corrMatrix1.abs()

Loading…
Cancel
Save