diff --git a/__pycache__/run.cpython-38.pyc b/__pycache__/run.cpython-38.pyc index e884b64..5ac7fd1 100644 Binary files a/__pycache__/run.cpython-38.pyc and b/__pycache__/run.cpython-38.pyc differ diff --git a/frontend/src/components/FeatureSpaceDetail.vue b/frontend/src/components/FeatureSpaceDetail.vue index 9f805a1..9587791 100644 --- a/frontend/src/components/FeatureSpaceDetail.vue +++ b/frontend/src/components/FeatureSpaceDetail.vue @@ -97,7 +97,7 @@ export default { this.mode = 0 this.KeepIDs = [] this.keepNumberOfCompareNodes = 0 - this.graphVizualization() + //this.graphVizualization() EventBus.$emit('storeGeneration') }, setLayerCompare() { @@ -508,7 +508,6 @@ export default { var MIMin = min(MIVar) var MIMax = max(MIVar) - MIVar = MIVar.map(normalize(MIMin, MIMax)) var colorsScaleNodes = d3.scaleOrdinal() @@ -1507,7 +1506,7 @@ export default { document.getElementById("initButton").click() }) //EventBus.$on('updateSlice', this.setLayerExplore) - EventBus.$on('updateSlice', this.initializeNetwork) + //EventBus.$on('updateSlice', this.initializeNetwork) EventBus.$on('quadTrans', data => { this.dataFSTrans = data }) EventBus.$on('quad', data => { this.dataFS = data }) diff --git a/frontend/src/components/FeatureSpaceOverview.vue b/frontend/src/components/FeatureSpaceOverview.vue index 7a2927b..5d36cf6 100644 --- a/frontend/src/components/FeatureSpaceOverview.vue +++ b/frontend/src/components/FeatureSpaceOverview.vue @@ -118,15 +118,10 @@ export default { var MIVar4 = JSON.parse(this.overallData[31]) var MIVar5 = JSON.parse(this.overallData[32]) - MIVar1 = MIVar1.concat(MIVar1) MIVar1 = MIVar1.concat(this.overallDataTransfMI[0]) - MIVar2 = MIVar2.concat(MIVar2) MIVar2 = MIVar2.concat(this.overallDataTransfMI[1]) - MIVar3 = MIVar3.concat(MIVar3) MIVar3 = MIVar3.concat(this.overallDataTransfMI[2]) - MIVar4 = MIVar4.concat(MIVar4) MIVar4 = MIVar4.concat(this.overallDataTransfMI[3]) - MIVar5 = MIVar5.concat(MIVar5) MIVar5 = MIVar5.concat(this.overallDataTransfMI[4]) function min(input) { @@ -164,7 +159,6 @@ export default { MIVar3 = MIVar3.map(normalize(MIMin3, MIMax3)) MIVar4 = MIVar4.map(normalize(MIMin4, MIMax4)) MIVar5 = MIVar5.map(normalize(MIMin5, MIMax5)) - var colorsScaleNodes1 = d3v5.scaleOrdinal() .domain(d3v5.ticks([MIMin1, MIMax1, 5])) .range(['#6baed6','#4292c6','#2171b5','#08519c','#08306b']); @@ -186,62 +180,62 @@ export default { var featuresQuad3 = [] var featuresQuad4 = [] var featuresQuad5 = [] - + // 4 is number of transformations! for (let i = 0; i < features[4].length; i++) { featuresQuad1.push({"name": features[0][i].key, "children": [ - {"name": features[0][i].value[0].keyIns, "lin_color": features[0][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*features[4].length+0]), "MI_pick":colorsScaleNodes1([this.overallDataTransfMI[0][i*features[4].length+0]].map(normalize(MIMin1, MIMax1))[0])}, - {"name": features[0][i].value[1].keyIns, "lin_color": features[0][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*features[4].length+1]), "MI_pick":colorsScaleNodes1([this.overallDataTransfMI[0][i*features[4].length+1]].map(normalize(MIMin1, MIMax1))[0])}, - {"name": features[0][i].value[2].keyIns, "lin_color": features[0][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*features[4].length+2]), "MI_pick":colorsScaleNodes1([this.overallDataTransfMI[0][i*features[4].length+2]].map(normalize(MIMin1, MIMax1))[0])}, - {"name": features[0][i].value[3].keyIns, "lin_color": features[0][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*features[4].length+3]), "MI_pick":colorsScaleNodes1([this.overallDataTransfMI[0][i*features[4].length+3]].map(normalize(MIMin1, MIMax1))[0])}, + {"name": features[0][i].value[0].keyIns, "lin_color": features[0][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*4+0]), "MI_pick":colorsScaleNodes1(MIVar1[i*features[4].length+0])}, + {"name": features[0][i].value[1].keyIns, "lin_color": features[0][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*4+1]), "MI_pick":colorsScaleNodes1(MIVar1[i*features[4].length+1])}, + {"name": features[0][i].value[2].keyIns, "lin_color": features[0][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*4+2]), "MI_pick":colorsScaleNodes1(MIVar1[i*features[4].length+2])}, + {"name": features[0][i].value[3].keyIns, "lin_color": features[0][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[0][i*4+3]), "MI_pick":colorsScaleNodes1(MIVar1[i*features[4].length+3])}, ], "lin_color": features[0][i].value[0].valueIns+features[0][i].value[1].valueIns+features[0][i].value[2].valueIns+features[0][i].value[3].valueIns, "Corr_pick": Math.round(Object.values(corrGlob1)[i+1]['0'] * 100), - "MI_pick": colorsScaleNodes1([MIVar1[i]].map(normalize(MIMin1, MIMax1))[0]) + "MI_pick": colorsScaleNodes1(MIVar1[i]) }) featuresQuad2.push({"name": features[1][i].key, "children": [ - {"name": features[1][i].value[0].keyIns, "lin_color": features[1][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+0]), "MI_pick":colorsScaleNodes2([this.overallDataTransfMI[1][i*4+0]].map(normalize(MIMin2, MIMax2))[0])}, - {"name": features[1][i].value[1].keyIns, "lin_color": features[1][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+1]), "MI_pick":colorsScaleNodes2([this.overallDataTransfMI[1][i*4+1]].map(normalize(MIMin2, MIMax2))[0])}, - {"name": features[1][i].value[2].keyIns, "lin_color": features[1][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+2]), "MI_pick":colorsScaleNodes2([this.overallDataTransfMI[1][i*4+2]].map(normalize(MIMin2, MIMax2))[0])}, - {"name": features[1][i].value[3].keyIns, "lin_color": features[1][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+3]), "MI_pick":colorsScaleNodes2([this.overallDataTransfMI[1][i*4+3]].map(normalize(MIMin2, MIMax2))[0])}, + {"name": features[1][i].value[0].keyIns, "lin_color": features[1][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+0]), "MI_pick":colorsScaleNodes2(MIVar2[i*features[4].length+0])}, + {"name": features[1][i].value[1].keyIns, "lin_color": features[1][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+1]), "MI_pick":colorsScaleNodes2(MIVar2[i*features[4].length+1])}, + {"name": features[1][i].value[2].keyIns, "lin_color": features[1][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+2]), "MI_pick":colorsScaleNodes2(MIVar2[i*features[4].length+2])}, + {"name": features[1][i].value[3].keyIns, "lin_color": features[1][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[1][i*4+3]), "MI_pick":colorsScaleNodes2(MIVar2[i*features[4].length+3])}, ], "lin_color": features[1][i].value[0].valueIns+features[1][i].value[1].valueIns+features[1][i].value[2].valueIns+features[1][i].value[3].valueIns, "Corr_pick": Math.round(Object.values(corrGlob2)[i+1]['0'] * 100), - "MI_pick": colorsScaleNodes2([MIVar2[i]].map(normalize(MIMin2, MIMax2))[0]) + "MI_pick": colorsScaleNodes2(MIVar2[i]) }) featuresQuad3.push({"name": features[2][i].key, "children": [ - {"name": features[2][i].value[0].keyIns, "lin_color": features[2][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+0]), "MI_pick":colorsScaleNodes3([this.overallDataTransfMI[2][i*4+0]].map(normalize(MIMin3, MIMax3))[0])}, - {"name": features[2][i].value[1].keyIns, "lin_color": features[2][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+1]), "MI_pick":colorsScaleNodes3([this.overallDataTransfMI[2][i*4+1]].map(normalize(MIMin3, MIMax3))[0])}, - {"name": features[2][i].value[2].keyIns, "lin_color": features[2][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+2]), "MI_pick":colorsScaleNodes3([this.overallDataTransfMI[2][i*4+2]].map(normalize(MIMin3, MIMax3))[0])}, - {"name": features[2][i].value[3].keyIns, "lin_color": features[2][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+3]), "MI_pick":colorsScaleNodes3([this.overallDataTransfMI[2][i*4+3]].map(normalize(MIMin3, MIMax3))[0])}, + {"name": features[2][i].value[0].keyIns, "lin_color": features[2][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+0]), "MI_pick":colorsScaleNodes3(MIVar3[i*features[4].length+0])}, + {"name": features[2][i].value[1].keyIns, "lin_color": features[2][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+1]), "MI_pick":colorsScaleNodes3(MIVar3[i*features[4].length+1])}, + {"name": features[2][i].value[2].keyIns, "lin_color": features[2][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+2]), "MI_pick":colorsScaleNodes3(MIVar3[i*features[4].length+2])}, + {"name": features[2][i].value[3].keyIns, "lin_color": features[2][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[2][i*4+3]), "MI_pick":colorsScaleNodes3(MIVar3[i*features[4].length+3])}, ], "lin_color": features[2][i].value[0].valueIns+features[2][i].value[1].valueIns+features[2][i].value[2].valueIns+features[2][i].value[3].valueIns, "Corr_pick": Math.round(Object.values(corrGlob3)[i+1]['0'] * 100), - "MI_pick": colorsScaleNodes3([MIVar3[i]].map(normalize(MIMin3, MIMax3))[0]) + "MI_pick": colorsScaleNodes3(MIVar3[i]) }) featuresQuad4.push({"name": features[3][i].key, "children": [ - {"name": features[3][i].value[0].keyIns, "lin_color": features[3][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+0]), "MI_pick":colorsScaleNodes4([this.overallDataTransfMI[3][i*4+0]].map(normalize(MIMin4, MIMax5))[0])}, - {"name": features[3][i].value[1].keyIns, "lin_color": features[3][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+1]), "MI_pick":colorsScaleNodes4([this.overallDataTransfMI[3][i*4+1]].map(normalize(MIMin4, MIMax5))[0])}, - {"name": features[3][i].value[2].keyIns, "lin_color": features[3][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+2]), "MI_pick":colorsScaleNodes4([this.overallDataTransfMI[3][i*4+2]].map(normalize(MIMin4, MIMax5))[0])}, - {"name": features[3][i].value[3].keyIns, "lin_color": features[3][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+3]), "MI_pick":colorsScaleNodes4([this.overallDataTransfMI[3][i*4+3]].map(normalize(MIMin4, MIMax5))[0])}, + {"name": features[3][i].value[0].keyIns, "lin_color": features[3][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+0]), "MI_pick":colorsScaleNodes4(MIVar4[i*features[4].length+0])}, + {"name": features[3][i].value[1].keyIns, "lin_color": features[3][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+1]), "MI_pick":colorsScaleNodes4(MIVar4[i*features[4].length+1])}, + {"name": features[3][i].value[2].keyIns, "lin_color": features[3][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+2]), "MI_pick":colorsScaleNodes4(MIVar4[i*features[4].length+2])}, + {"name": features[3][i].value[3].keyIns, "lin_color": features[3][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[3][i*4+3]), "MI_pick":colorsScaleNodes4(MIVar4[i*features[4].length+3])}, ], "lin_color": features[3][i].value[0].valueIns+features[3][i].value[1].valueIns+features[3][i].value[2].valueIns+features[3][i].value[3].valueIns, "Corr_pick": Math.round(Object.values(corrGlob4)[i+1]['0'] * 100), - "MI_pick": colorsScaleNodes4([MIVar4[i]].map(normalize(MIMin4, MIMax4))[0]) + "MI_pick": colorsScaleNodes4(MIVar4[i]) }) featuresQuad5.push({"name": features[4][i].key, "children": [ - {"name": features[4][i].value[0].keyIns, "lin_color": features[4][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+0]), "MI_pick":colorsScaleNodes5([this.overallDataTransfMI[4][i*4+0]].map(normalize(MIMin5, MIMax5))[0])}, - {"name": features[4][i].value[1].keyIns, "lin_color": features[4][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+1]), "MI_pick":colorsScaleNodes5([this.overallDataTransfMI[4][i*4+1]].map(normalize(MIMin5, MIMax5))[0])}, - {"name": features[4][i].value[2].keyIns, "lin_color": features[4][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+2]), "MI_pick":colorsScaleNodes5([this.overallDataTransfMI[4][i*4+2]].map(normalize(MIMin5, MIMax5))[0])}, - {"name": features[4][i].value[3].keyIns, "lin_color": features[4][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+3]), "MI_pick":colorsScaleNodes5([this.overallDataTransfMI[4][i*4+3]].map(normalize(MIMin5, MIMax5))[0])}, + {"name": features[4][i].value[0].keyIns, "lin_color": features[4][i].value[0].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+0]), "MI_pick":colorsScaleNodes5(MIVar5[i*features[4].length+0])}, + {"name": features[4][i].value[1].keyIns, "lin_color": features[4][i].value[1].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+1]), "MI_pick":colorsScaleNodes5(MIVar5[i*features[4].length+1])}, + {"name": features[4][i].value[2].keyIns, "lin_color": features[4][i].value[2].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+2]), "MI_pick":colorsScaleNodes5(MIVar5[i*features[4].length+2])}, + {"name": features[4][i].value[3].keyIns, "lin_color": features[4][i].value[3].valueIns, "Corr_pick": Math.round(this.overallDataTransfCorr[4][i*4+3]), "MI_pick":colorsScaleNodes5(MIVar5[i*features[4].length+3])}, ], "lin_color": features[4][i].value[0].valueIns+features[4][i].value[1].valueIns+features[4][i].value[2].valueIns+features[4][i].value[3].valueIns, "Corr_pick": Math.round(Object.values(corrGlob5)[i+1]['0'] * 100), - "MI_pick": colorsScaleNodes5([MIVar5[i]].map(normalize(MIMin5, MIMax5))[0]) + "MI_pick": colorsScaleNodes5(MIVar5[i]) }) } @@ -414,7 +408,7 @@ export default { .data(nodes, function(d) { return d.id || (d.id = ++counter); }); - + // Enter any new nodes at the parent's previous position var nodeEnter = node.enter().insert('g', ':first-child') .attr('class', 'node') @@ -584,22 +578,21 @@ export default { var pie = d3v5.pie().sort(null).value(function (d) { return d.value; }); - // FIX ROTATION AND FIX COLORS! + var g = d3v5.select('#overCirc'+index).selectAll('g').data(pieData).enter() .append('g') .attr('transform', function(d, i) { - return 'rotate(270)' + return 'rotate(270)' }); g.selectAll('path').data(function (d) { - console.log(d) return pie(d); }).enter().append('path') .attr('d', function (d) { return d.data.arc(d); }).attr('fill', function (d, i) { + if (i == 0) { - console.log(d.data.object.name) return d.data.object.MI_pick } else { return '#D3D3D3' @@ -846,6 +839,7 @@ export default { sendSliceID = 4 rootID = 1 } + EventBus.$emit('flagSpace', true) EventBus.$emit('keepRootFun', rootID) EventBus.$emit('updateSlice', sendSliceID) } diff --git a/frontend/src/components/Heatmap.vue b/frontend/src/components/Heatmap.vue index d7d1684..5c5846d 100644 --- a/frontend/src/components/Heatmap.vue +++ b/frontend/src/components/Heatmap.vue @@ -417,7 +417,7 @@ export default { if (index > -1) { featuresGen.splice(index, 1); } - EventBus.$emit('updateHistoryKey', 4) + //EventBus.$emit('updateHistoryKey', 4) EventBus.$emit('removeFeaturesGen', featuresGen) return "url(#diagonalHatch)" } else { diff --git a/frontend/src/components/Main.vue b/frontend/src/components/Main.vue index 5412455..723e6f7 100755 --- a/frontend/src/components/Main.vue +++ b/frontend/src/components/Main.vue @@ -108,6 +108,7 @@ export default Vue.extend({ storeDataTransf: [], compareNumber: 0, IDToCompare: [], + spaceChange: false, ImportanceCompare: [], featureNames: [], initAuto: true, @@ -489,7 +490,11 @@ export default Vue.extend({ .then(response => { console.log('Server successfully send the predictive results!') this.ValidResults = response.data.ValidResults - EventBus.$emit('finalResults', this.ValidResults) + console.log(this.spaceChange) + if (!this.spaceChange) { + EventBus.$emit('finalResults', this.ValidResults) + } + this.spaceChange = false if (this.transformNodesFlag) { EventBus.$emit('Default') } @@ -559,7 +564,9 @@ export default Vue.extend({ console.log('Store newly generated features!') EventBus.$emit('updateHistoryKey', 5) this.threshold() - EventBus.$emit('Default') + if (!this.spaceChange) { + EventBus.$emit('Default') + } }) .catch(error => { console.log(error) @@ -742,6 +749,8 @@ export default Vue.extend({ EventBus.$on('transformNodes', data => { this.storeDataTransf = data }) EventBus.$on('transformNodes', this.transformNodesFun) + EventBus.$on('flagSpace', data => { this.spaceChange = data }) + //Prevent double click to search for a word. document.addEventListener('mousedown', function (event) { if (event.detail > 1) { diff --git a/frontend/src/components/Results.vue b/frontend/src/components/Results.vue index bd3a635..987f640 100644 --- a/frontend/src/components/Results.vue +++ b/frontend/src/components/Results.vue @@ -35,8 +35,9 @@ export default { this.globalStep = this.globalStep + 1 var state = this.globalStep + console.log('Current Step: ', state) if (state == 1) { - this.storeBestSoFarAV = ((parseFloat(this.scoresMeanBest[0]) + parseFloat(this.scoresMeanBest[1]) + parseFloat(this.scoresMeanBest[2])) / 3) + this.storeBestSoFarAV = ((parseFloat(this.scoresMean[0]) + parseFloat(this.scoresMean[1]) + parseFloat(this.scoresMean[2])) / 3) } var svg = d3.select("#HistoryPlot"); @@ -94,12 +95,12 @@ export default { } - var toWhichFeature = this.historyKey + var toWhichTrans = this.historyKey var toWhichPosition = this.whereIsChange - var counterSet = 0 + var counterSet = -1 var labelsX = ['Include', 'Exclude', 'Transform', 'Generate'] - console.log(this.valuesGlobal) + for (let i=0; i< features.length; i++) { data.push({ label: features[i], @@ -155,40 +156,47 @@ export default { .attr('r', 0) .remove() - - if (this.storeBestSoFarAV > ((this.scoresMeanBest[0] + this.scoresMeanBest[1] + this.scoresMeanBest[2]) / 3)) { + if (this.storeBestSoFarAV <= ((parseFloat(this.scoresMean[0]) + parseFloat(this.scoresMean[1]) + parseFloat(this.scoresMean[2])) / 3)) { this.flag = true + this.storeBestSoFarAV = ((parseFloat(this.scoresMean[0]) + parseFloat(this.scoresMean[1]) + parseFloat(this.scoresMean[2])) / 3) } var previously = this.previousState - + var lengthFeatures = this.valuesGlobal.length var testLoc = this.flag - + console.log('Better results found: ', testLoc) dots.transition() .duration(duration) .attr('r', function(d){ return d*2 }) .attr('cx', function(d, i){ return i * maxR * 2 + maxR }) .style('fill', function(d){ + counterSet = counterSet + 1 if (testLoc) { - if (toWhichFeature == -1) { - previously.push('#B15928') + if (toWhichTrans == -1) { + previously.push("black") + } + if (d == state) { + previously[counterSet] = '#B15928' + return previously[counterSet] + } else if (counterSet == (4*toWhichPosition + 0) || counterSet == (4*toWhichPosition + 1) || counterSet == (4*toWhichPosition + 2) || counterSet == (4*toWhichPosition + 3)) { + previously[counterSet] = 'black' + return previously[counterSet] + } else { return previously[counterSet] } } else { if (d == state) { - previously[counterSet] = 'rgb(' + c(d) + ',' + c(d) + ',' + c(d) + ')' + previously[counterSet] = "black" + return previously[counterSet] } else { return previously[counterSet] } } - counterSet = counterSet + 1 }) this.flag = false this.previousState = previously - console.log(this.previousState) - var dotLabels = rows.selectAll('.dot-label') .data(function(d){ return d.values }) diff --git a/run.py b/run.py index eb34c44..141064b 100644 --- a/run.py +++ b/run.py @@ -56,6 +56,11 @@ def reset(): global filterActionFinal filterActionFinal = '' + global storePositions + global storeReplacements + storePositions = [] + storeReplacements = [] + global keySpecInternal keySpecInternal = 1 @@ -140,6 +145,11 @@ def retrieveFileName(): global DataResultsRawTest global DataRawLengthTest + global storePositions + global storeReplacements + storePositions = [] + storeReplacements = [] + fileName = request.get_data().decode('utf8').replace("'", '"') global keySpecInternal @@ -507,7 +517,14 @@ def executeModel(exeCall, flagEx, nodeTransfName): currentColumn = columnsNewGen[exeCall[0]] subString = currentColumn[currentColumn.find("(")+1:currentColumn.find(")")] replacement = currentColumn.replace(subString, nodeTransfName) - columnsNewGen[exeCall[0]] = replacement + storePositions.append(exeCall[0]) + storeReplacements.append(replacement) + pos = 0 + for repl in storeReplacements: + print(pos) + print(repl) + columnsNewGen[storePositions[pos]] = repl + pos += 1 if (len(splittedCol) == 1): XData[nodeTransfName] = XDataStoredOriginal[nodeTransfName] else: @@ -537,7 +554,7 @@ def executeModel(exeCall, flagEx, nodeTransfName): columnsNames.append(splittedCol[0]) else: columnsNames.append(splittedCol[0]+'_'+tran) - print(columnsNames) + featureImportanceData = estimatorFeatureSelection(XData, estimator) estimator.fit(XData, yData) yPredict = estimator.predict(XData) @@ -663,7 +680,7 @@ def Transformation(quadrant1, quadrant2, quadrant3, quadrant4, quadrant5): XDataNumeric = XDataStoredOriginal.select_dtypes(include='number') columns = list(XDataNumeric) - print(columns) + global packCorrTransformed packCorrTransformed = [] @@ -1421,7 +1438,7 @@ def storeGeneratedFeat(): @cross_origin(origin='localhost',headers=['Content-Type','Authorization']) @app.route('/data/transformation', methods=["GET", "POST"]) def transformFeatures(): - print('transform') + print('Transform') retrieveTransform = request.get_data().decode('utf8').replace("'", '"') retrieveTransform = json.loads(retrieveTransform) clickedNodeName = retrieveTransform['nameClicked']