From c6b2705bf34b0e68ada5e27b724ccd20c9242a3e Mon Sep 17 00:00:00 2001 From: Angelos Chatzimparmpas Date: Fri, 15 Jan 2021 13:02:08 +0100 Subject: [PATCH] new --- __pycache__/run.cpython-38.pyc | Bin 29980 -> 30123 bytes .../src/components/FeatureSpaceDetail.vue | 5 +- .../src/components/FeatureSpaceOverview.vue | 68 ++++++++---------- frontend/src/components/Heatmap.vue | 2 +- frontend/src/components/Main.vue | 13 +++- frontend/src/components/Results.vue | 36 ++++++---- run.py | 25 +++++-- 7 files changed, 88 insertions(+), 61 deletions(-) diff --git a/__pycache__/run.cpython-38.pyc b/__pycache__/run.cpython-38.pyc index e884b64e092ace4dbe86a870eb1146c713dcaf8a..5ac7fd19a3be058d4a52f985e73b2b182045e8fc 100644 GIT binary patch delta 8488 zcmcIp4RjpUb)Gjf`@j1CU0FZ2WLsM62T9hCZ4}$GWdVu*uw*PRvgDCwB(JoZUA-L< z8+Nm?#gEgPAo5(B0*9>5X&^o!DO8-ashhNgohNUEsFs-)OdnRVNX z_d=H!o-82AhTj}`a^cBSZAw1;7Qj;oPmyX@is82eo>F*x@RY%`Ms=u8)up<}Wu=@w zX73>t>{WYBb#~MUQ|(|l8bs})W*&b(q(wr?s5YhPMsz`R%n^GpXh?h6BhK5rUCzsQHs3{SU)Gv1y_{*)T7}MWZp#!!DY3|e0-AYS;sY(bEprjYDPbjCSl6PkQZ8(W)3>Hg?n}{^ae6PO z*lbaNVQofxOq?Y>!m)-yhZwiT?M4TC(OuHgmTZdIk!6ld-(_?fZL>t#01R7Fb$uY&+6<7DN`e=vb~l4I#;bbfqZ;4h^@)g zD-zQwfX%Q_RA;C2I+{`jToO&Oso5mq3}q}miLlawTi0>5xn-8$qnfVvhx;^omlYJ%>~z6C^1#AN1+R)^ zAA6>FQ{(mBGQr&fYTjMVeo<2HvYgsa!^q!yeg4TMetHmXy&WA~lX5Vn*qN~!GuX#o zD?zWqBsZ{jbJp7381ciYg}wnj9$_WEp*GyoSBd`;p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uMCme@TMH)jPz2=oD#&?=JXBq%BsD0~0;k=@YzKol>b(4}e3{7CgBl)$$i zk1pK8F}j$K7W|JHzF~3c`75>=soufjQ#pu_AoMeTv=MIMyP|#le~A@m0c0yqWvBV+ zGC%3?%x8|9x;w4Y@T@jE*TB9OeUcnz)3Hzs9w3)z9o~iT)W{znR?NF8hy72?TksK_ zZvI3o@x_%{{mjQpmILmJ8D`&^sod;GagQSK3FWisFgpQB@8iJEvue6&JMVdU7zLS* z(AXe|#?PTXc_2vueN2WuEN0k(QEf6jMGpW$w!n2i4i7ESS@`E}5cw5^`w;N8oIgC9Q}z@VUqtvG z0$%*-_Yt_meHC+~pcuU!VIKl_wFfbWMoX&?BgzOkf@{~{O?}*ZM;`GIcT({1Z?7Zl Na5<8Kg@tB^{} { 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']