Angelos Chatzimparmpas 4 years ago
parent b48723a7fe
commit 35ac0b2011
  1. BIN
      __pycache__/run.cpython-37.pyc
  2. 1
      cachedir/joblib/run/randomSearch/05609dc6df4ae4898dbab381be14f176/metadata.json
  3. BIN
      cachedir/joblib/run/randomSearch/c140450f90e8f2220dc694fcbea916e8/output.pkl
  4. 520
      frontend/src/components/AlgorithmsController.vue
  5. 2
      frontend/src/components/Ensemble.vue
  6. 40
      frontend/src/components/Export.vue
  7. 84
      frontend/src/components/History.vue
  8. 50
      frontend/src/components/HyperParameterSpace.vue
  9. 27
      frontend/src/components/Knowledge.vue
  10. 54
      frontend/src/components/Main.vue
  11. 14
      frontend/src/components/Predictions.vue
  12. 297
      frontend/src/components/ValidationController.vue
  13. 43
      frontend/src/components/VotingResults.vue
  14. 4
      frontend/src/main.js
  15. 18
      run.py

Binary file not shown.

@ -0,0 +1 @@
{"duration": 42.55050802230835, "input_args": {"XData": " Fbs Slope Trestbps Exang Thalach Age Chol Sex Oldpeak Restecg Cp Ca Thal\n0 1 0 145 0 150 63 233 1 2.3 0 3 0 1\n1 0 0 130 0 187 37 250 1 3.5 1 2 0 2\n2 0 2 130 0 172 41 204 0 1.4 0 1 0 2\n3 0 2 120 0 178 56 236 1 0.8 1 1 0 2\n4 0 2 120 1 163 57 354 0 0.6 1 0 0 2\n.. ... ... ... ... ... ... ... ... ... ... .. .. ...\n298 0 1 140 1 123 57 241 0 0.2 1 0 0 3\n299 0 1 110 0 132 45 264 1 1.2 1 3 0 3\n300 1 1 144 0 141 68 193 1 3.4 1 0 2 3\n301 0 1 130 1 115 57 131 1 1.2 1 0 1 3\n302 0 1 130 0 174 57 236 0 0.0 0 1 1 2\n\n[303 rows x 13 columns]", "yData": "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]", "clf": "KNeighborsClassifier(algorithm='kd_tree', n_neighbors=36, weights='distance')", "params": "{'n_neighbors': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99], 'metric': ['chebyshev', 'manhattan', 'euclidean', 'minkowski'], 'algorithm': ['brute', 'kd_tree', 'ball_tree'], 'weights': ['uniform', 'distance']}", "eachAlgor": "'KNN'", "AlgorithmsIDsEnd": "500"}}

@ -11,35 +11,111 @@ export default {
data () {
return {
WH: [],
ResultsLocal: [],
PerF: [],
PerFCM: [],
storedEnsem: [],
storedCM: [],
selectedSimple: [],
selectedEnsem: []
}
},
methods: {
reset () {
var svg = d3.select("#Bees");
svg.selectAll("*").remove();
this.PerF = []
this.PerFCM = []
this.storedEnsem = []
this.storedCM = []
this.selectedSimple = []
this.selectedEnsem = []
},
BeesFun () {
var svg = d3.select("#Bees");
svg.selectAll("*").remove();
var chart1
var data = []
for (let i=0; i<500; i++){
if (i<100) {
data.push({Algorithm:"KNN",value:randomIntFromInterval(40,100), size:(Math.floor(Math.random() * 4) + 4)})
} else if (i<200){
data.push({Algorithm:"LR",value:randomIntFromInterval(50,100), size:(Math.floor(Math.random() * 4) + 4)})
} else if (i<300){
data.push({Algorithm:"MLP",value:randomIntFromInterval(30,100), size:(Math.floor(Math.random() * 4) + 4)})
} else if (i<400){
data.push({Algorithm:"RF",value:randomIntFromInterval(10,100), size:(Math.floor(Math.random() * 4) + 4)})
} else {
data.push({Algorithm:"GradB",value:randomIntFromInterval(0,100), size:(Math.floor(Math.random() * 4) + 4)})
}
for (let i=0; i<this.storedCM.length; i++){
let tempSplit = this.storedCM[i].split(/([0-9]+)/)
if (tempSplit[0] == 'KNN' || tempSplit[0] == 'KNNC' || tempSplit[0] == 'KNNM' || tempSplit[0] == 'KNNCC' || tempSplit[0] == 'KNNCM' || tempSplit[0] == 'KNNMC' || tempSplit[0] == 'KNNMM') {
if (this.selectedSimple.includes(this.storedCM[i])) {
data.push({Algorithm:"KNN",value:this.PerFCM[i], size:3, sw:true})
} else {
data.push({Algorithm:"KNN",value:this.PerFCM[i], size:3, sw:false})
}
}
else if (tempSplit[0] == 'LR' || tempSplit[0] == 'LRC' || tempSplit[0] == 'LRM' || tempSplit[0] == 'LRCC' || tempSplit[0] == 'LRCM' || tempSplit[0] == 'LRMC' || tempSplit[0] == 'LRMM') {
if (this.selectedSimple.includes(this.storedCM[i])) {
data.push({Algorithm:"LR",value:this.PerFCM[i], size:3, sw:true})
} else {
data.push({Algorithm:"LR",value:this.PerFCM[i], size:3, sw:false})
}
}
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
else if (tempSplit[0] == 'MLP' || tempSplit[0] == 'MLPC' || tempSplit[0] == 'MLPM' || tempSplit[0] == 'MLPCC' || tempSplit[0] == 'MLPCM' || tempSplit[0] == 'MLPMC' || tempSplit[0] == 'MLPMM') {
if (this.selectedSimple.includes(this.storedCM[i])) {
data.push({Algorithm:"MLP",value:this.PerFCM[i], size:3, sw:true})
} else {
data.push({Algorithm:"MLP",value:this.PerFCM[i], size:3, sw:false})
}
}
else if (tempSplit[0] == 'RF' || tempSplit[0] == 'RFC' || tempSplit[0] == 'RFM' || tempSplit[0] == 'RFCC' || tempSplit[0] == 'RFCM' || tempSplit[0] == 'RFMC' || tempSplit[0] == 'RFMM') {
if (this.selectedSimple.includes(this.storedCM[i])) {
data.push({Algorithm:"RF",value:this.PerFCM[i], size:3, sw:true})
} else {
data.push({Algorithm:"RF",value:this.PerFCM[i], size:3, sw:false})
}
}
else {
if (this.selectedSimple.includes(this.storedCM[i])) {
data.push({Algorithm:"GradB",value:this.PerFCM[i], size:3, sw:true})
} else {
data.push({Algorithm:"GradB",value:this.PerFCM[i], size:3, sw:false})
}
}
}
if (this.storedEnsem.length != 0) {
var mergedStoreEnsembleLoc = [].concat.apply([], this.storedEnsem)
for (let i=0; i<mergedStoreEnsembleLoc.length; i++){
let tempSplit = mergedStoreEnsembleLoc[i].split(/([0-9]+)/)
if (tempSplit[0] == 'KNN' || tempSplit[0] == 'KNNC' || tempSplit[0] == 'KNNM' || tempSplit[0] == 'KNNCC' || tempSplit[0] == 'KNNCM' || tempSplit[0] == 'KNNMC' || tempSplit[0] == 'KNNMM') {
if (this.selectedEnsem.includes(mergedStoreEnsembleLoc[i])) {
data.push({Algorithm:"KNN",value:this.PerF[i], size:5, sw:true})
} else {
data.push({Algorithm:"KNN",value:this.PerF[i], size:5, sw:false})
}
}
else if (tempSplit[0] == 'LR' || tempSplit[0] == 'LRC' || tempSplit[0] == 'LRM' || tempSplit[0] == 'LRCC' || tempSplit[0] == 'LRCM' || tempSplit[0] == 'LRMC' || tempSplit[0] == 'LRMM') {
if (this.selectedEnsem.includes(mergedStoreEnsembleLoc[i])) {
data.push({Algorithm:"LR",value:this.PerF[i], size:5, sw:true})
} else {
data.push({Algorithm:"LR",value:this.PerF[i], size:5, sw:false})
}
}
else if (tempSplit[0] == 'MLP' || tempSplit[0] == 'MLPC' || tempSplit[0] == 'MLPM' || tempSplit[0] == 'MLPCC' || tempSplit[0] == 'MLPCM' || tempSplit[0] == 'MLPMC' || tempSplit[0] == 'MLPMM') {
if (this.selectedEnsem.includes(mergedStoreEnsembleLoc[i])) {
data.push({Algorithm:"MLP",value:this.PerF[i], size:5, sw:true})
} else {
data.push({Algorithm:"MLP",value:this.PerF[i], size:5, sw:false})
}
}
else if (tempSplit[0] == 'RF' || tempSplit[0] == 'RFC' || tempSplit[0] == 'RFM' || tempSplit[0] == 'RFCC' || tempSplit[0] == 'RFCM' || tempSplit[0] == 'RFMC' || tempSplit[0] == 'RFMM') {
if (this.selectedEnsem.includes(mergedStoreEnsembleLoc[i])) {
data.push({Algorithm:"RF",value:this.PerF[i], size:5, sw:true})
} else {
data.push({Algorithm:"RF",value:this.PerF[i], size:5, sw:false})
}
}
else {
if (this.selectedEnsem.includes(mergedStoreEnsembleLoc[i])) {
data.push({Algorithm:"GradB",value:this.PerF[i], size:4, sw:true})
} else {
data.push({Algorithm:"GradB",value:this.PerF[i], size:4, sw:false})
}
}
}
}
chart1 = makeDistroChart({
data:data,
@ -48,7 +124,6 @@ export default {
axisLabels: {xAxis: 'Algorithhm', yAxis: '# Performance (%) #'},
selector:"#Bees",
constrainExtremes:true});
chart1.renderBoxPlot({showBox:false});
chart1.renderDataPlots({showPlot:true,plotType:'beeswarm',showBeanLines:false, colors:null});
chart1.renderNotchBoxes({showNotchBox:false});
chart1.renderViolinPlot({showViolinPlot:false});
@ -80,8 +155,8 @@ export default {
axisLables: null,
yTicks: 1,
scale: 'linear',
chartSize: {width: 800, height: 400},
margin: {top: 15, right: 60, bottom: 50, left: 50},
chartSize: {width: 825, height: 420},
margin: {top: 15, right: 45, bottom: 25, left: 40},
constrainExtremes: false,
color: ['#ff7f00','#fdbf6f','#fb9a99','#b15928','#a6cee3']
};
@ -359,7 +434,7 @@ export default {
//Update axes
chart.objs.g.select('.x.axis').attr("transform", "translate(0," + chart.height + ")").call(chart.objs.xAxis)
.selectAll("text")
.attr("y", 5)
.attr("y", 10)
.attr("x", 15)
.attr("transform", "rotate(0)")
.style("text-anchor", "end");
@ -408,7 +483,7 @@ export default {
.append("text")
.attr("class", "label")
.attr("transform", "rotate(-90)")
.attr("y", -42)
.attr("y", -35)
.attr("x", -chart.height / 2)
.attr("dy", ".71em")
.style("text-anchor", "middle")
@ -734,353 +809,6 @@ export default {
return chart;
};
/**
* Render a box plot on the current chart
* @param options
* @param [options.show=true] Toggle the whole plot on and off
* @param [options.showBox=true] Show the box part of the box plot
* @param [options.showWhiskers=true] Show the whiskers
* @param [options.showMedian=true] Show the median line
* @param [options.showMean=false] Show the mean line
* @param [options.medianCSize=3] The size of the circle on the median
* @param [options.showOutliers=true] Plot outliers
* @param [options.boxwidth=30] The max percent of the group rangeBand that the box can be
* @param [options.lineWidth=boxWidth] The max percent of the group rangeBand that the line can be
* @param [options.outlierScatter=false] Spread out the outliers so they don't all overlap (in development)
* @param [options.outlierCSize=2] Size of the outliers
* @param [options.colors=chart default] The color mapping for the box plot
* @returns {*} The chart object
*/
chart.renderBoxPlot = function (options) {
chart.boxPlots = {};
// Defaults
var defaultOptions = {
show: true,
showBox: true,
showWhiskers: true,
showMedian: true,
showMean: false,
medianCSize: 3.5,
showOutliers: true,
boxWidth: 30,
lineWidth: null,
scatterOutliers: false,
outlierCSize: 2.5,
colors: chart.colorFunct
};
chart.boxPlots.options = shallowCopy(defaultOptions);
for (var option in options) {
chart.boxPlots.options[option] = options[option]
}
var bOpts = chart.boxPlots.options;
//Create box plot objects
for (var cName in chart.groupObjs) {
chart.groupObjs[cName].boxPlot = {};
chart.groupObjs[cName].boxPlot.objs = {};
}
/**
* Calculates all the outlier points for each group
*/
!function calcAllOutliers() {
/**
* Create lists of the outliers for each content group
* @param cGroup The object to modify
* @return null Modifies the object in place
*/
function calcOutliers(cGroup) {
var cExtremes = [];
var cOutliers = [];
var cOut, idx;
for (idx = 0; idx <= cGroup.values.length; idx++) {
cOut = {value: cGroup.values[idx]};
if (cOut.value < cGroup.metrics.lowerInnerFence) {
if (cOut.value < cGroup.metrics.lowerOuterFence) {
cExtremes.push(cOut);
} else {
cOutliers.push(cOut);
}
} else if (cOut.value > cGroup.metrics.upperInnerFence) {
if (cOut.value > cGroup.metrics.upperOuterFence) {
cExtremes.push(cOut);
} else {
cOutliers.push(cOut);
}
}
}
cGroup.boxPlot.objs.outliers = cOutliers;
cGroup.boxPlot.objs.extremes = cExtremes;
}
for (var cName in chart.groupObjs) {
calcOutliers(chart.groupObjs[cName]);
}
}();
/**
* Take updated options and redraw the box plot
* @param updateOptions
*/
chart.boxPlots.change = function (updateOptions) {
if (updateOptions) {
for (var key in updateOptions) {
bOpts[key] = updateOptions[key]
}
}
for (var cName in chart.groupObjs) {
chart.groupObjs[cName].boxPlot.objs.g.remove()
}
chart.boxPlots.prepareBoxPlot();
chart.boxPlots.update()
};
chart.boxPlots.reset = function () {
chart.boxPlots.change(defaultOptions)
};
chart.boxPlots.show = function (opts) {
if (opts !== undefined) {
opts.show = true;
if (opts.reset) {
chart.boxPlots.reset()
}
} else {
opts = {show: true};
}
chart.boxPlots.change(opts)
};
chart.boxPlots.hide = function (opts) {
if (opts !== undefined) {
opts.show = false;
if (opts.reset) {
chart.boxPlots.reset()
}
} else {
opts = {show: false};
}
chart.boxPlots.change(opts)
};
/**
* Update the box plot obj values
*/
chart.boxPlots.update = function () {
var cName, cBoxPlot;
for (cName in chart.groupObjs) {
cBoxPlot = chart.groupObjs[cName].boxPlot;
// Get the box width
var objBounds = getObjWidth(bOpts.boxWidth, cName);
var width = (objBounds.right - objBounds.left);
var sMetrics = {}; //temp var for scaled (plottable) metric values
for (var attr in chart.groupObjs[cName].metrics) {
sMetrics[attr] = null;
sMetrics[attr] = chart.yScale(chart.groupObjs[cName].metrics[attr]);
}
// Box
if (cBoxPlot.objs.box) {
cBoxPlot.objs.box
.attr("x", objBounds.left)
.attr('width', width)
.attr("y", sMetrics.quartile3)
.attr("rx", 1)
.attr("ry", 1)
.attr("height", -sMetrics.quartile3 + sMetrics.quartile1)
}
// Lines
var lineBounds = null;
if (bOpts.lineWidth) {
lineBounds = getObjWidth(bOpts.lineWidth, cName)
} else {
lineBounds = objBounds
}
// --Whiskers
if (cBoxPlot.objs.upperWhisker) {
cBoxPlot.objs.upperWhisker.fence
.attr("x1", lineBounds.left)
.attr("x2", lineBounds.right)
.attr('y1', sMetrics.upperInnerFence)
.attr("y2", sMetrics.upperInnerFence);
cBoxPlot.objs.upperWhisker.line
.attr("x1", lineBounds.middle)
.attr("x2", lineBounds.middle)
.attr('y1', sMetrics.quartile3)
.attr("y2", sMetrics.upperInnerFence);
cBoxPlot.objs.lowerWhisker.fence
.attr("x1", lineBounds.left)
.attr("x2", lineBounds.right)
.attr('y1', sMetrics.lowerInnerFence)
.attr("y2", sMetrics.lowerInnerFence);
cBoxPlot.objs.lowerWhisker.line
.attr("x1", lineBounds.middle)
.attr("x2", lineBounds.middle)
.attr('y1', sMetrics.quartile1)
.attr("y2", sMetrics.lowerInnerFence);
}
// --Median
if (cBoxPlot.objs.median) {
cBoxPlot.objs.median.line
.attr("x1", lineBounds.left)
.attr("x2", lineBounds.right)
.attr('y1', sMetrics.median)
.attr("y2", sMetrics.median);
cBoxPlot.objs.median.circle
.attr("cx", lineBounds.middle)
.attr("cy", sMetrics.median)
}
// --Mean
if (cBoxPlot.objs.mean) {
cBoxPlot.objs.mean.line
.attr("x1", lineBounds.left)
.attr("x2", lineBounds.right)
.attr('y1', sMetrics.mean)
.attr("y2", sMetrics.mean);
cBoxPlot.objs.mean.circle
.attr("cx", lineBounds.middle)
.attr("cy", sMetrics.mean);
}
// Outliers
var pt;
if (cBoxPlot.objs.outliers) {
for (pt in cBoxPlot.objs.outliers) {
cBoxPlot.objs.outliers[pt].point
.attr("cx", objBounds.middle + addJitter(bOpts.scatterOutliers, width))
.attr("cy", chart.yScale(cBoxPlot.objs.outliers[pt].value));
}
}
if (cBoxPlot.objs.extremes) {
for (pt in cBoxPlot.objs.extremes) {
cBoxPlot.objs.extremes[pt].point
.attr("cx", objBounds.middle + addJitter(bOpts.scatterOutliers, width))
.attr("cy", chart.yScale(cBoxPlot.objs.extremes[pt].value));
}
}
}
};
/**
* Create the svg elements for the box plot
*/
chart.boxPlots.prepareBoxPlot = function () {
var cName, cBoxPlot;
if (bOpts.colors) {
chart.boxPlots.colorFunct = getColorFunct(bOpts.colors);
} else {
chart.boxPlots.colorFunct = chart.colorFunct
}
if (bOpts.show == false) {
return
}
for (cName in chart.groupObjs) {
cBoxPlot = chart.groupObjs[cName].boxPlot;
cBoxPlot.objs.g = chart.groupObjs[cName].g.append("g").attr("class", "box-plot");
//Plot Box (default show)
if (bOpts.showBox) {
cBoxPlot.objs.box = cBoxPlot.objs.g.append("rect")
.attr("class", "box")
.style("fill", chart.boxPlots.colorFunct(cName))
.style("stroke", chart.boxPlots.colorFunct(cName));
//A stroke is added to the box with the group color, it is
// hidden by default and can be shown through css with stroke-width
}
//Plot Median (default show)
if (bOpts.showMedian) {
cBoxPlot.objs.median = {line: null, circle: null};
cBoxPlot.objs.median.line = cBoxPlot.objs.g.append("line")
.attr("class", "median");
cBoxPlot.objs.median.circle = cBoxPlot.objs.g.append("circle")
.attr("class", "median")
.attr('r', bOpts.medianCSize)
.style("fill", chart.boxPlots.colorFunct(cName));
}
// Plot Mean (default no plot)
if (bOpts.showMean) {
cBoxPlot.objs.mean = {line: null, circle: null};
cBoxPlot.objs.mean.line = cBoxPlot.objs.g.append("line")
.attr("class", "mean");
cBoxPlot.objs.mean.circle = cBoxPlot.objs.g.append("circle")
.attr("class", "mean")
.attr('r', bOpts.medianCSize)
.style("fill", chart.boxPlots.colorFunct(cName));
}
// Plot Whiskers (default show)
if (bOpts.showWhiskers) {
cBoxPlot.objs.upperWhisker = {fence: null, line: null};
cBoxPlot.objs.lowerWhisker = {fence: null, line: null};
cBoxPlot.objs.upperWhisker.fence = cBoxPlot.objs.g.append("line")
.attr("class", "upper whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
cBoxPlot.objs.upperWhisker.line = cBoxPlot.objs.g.append("line")
.attr("class", "upper whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
cBoxPlot.objs.lowerWhisker.fence = cBoxPlot.objs.g.append("line")
.attr("class", "lower whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
cBoxPlot.objs.lowerWhisker.line = cBoxPlot.objs.g.append("line")
.attr("class", "lower whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
}
// Plot outliers (default show)
if (bOpts.showOutliers) {
if (!cBoxPlot.objs.outliers) calcAllOutliers();
var pt;
if (cBoxPlot.objs.outliers.length) {
var outDiv = cBoxPlot.objs.g.append("g").attr("class", "boxplot outliers");
for (pt in cBoxPlot.objs.outliers) {
cBoxPlot.objs.outliers[pt].point = outDiv.append("circle")
.attr("class", "outlier")
.attr('r', bOpts.outlierCSize)
.style("fill", chart.boxPlots.colorFunct(cName));
}
}
if (cBoxPlot.objs.extremes.length) {
var extDiv = cBoxPlot.objs.g.append("g").attr("class", "boxplot extremes");
for (pt in cBoxPlot.objs.extremes) {
cBoxPlot.objs.extremes[pt].point = extDiv.append("circle")
.attr("class", "extreme")
.attr('r', bOpts.outlierCSize)
.style("stroke", chart.boxPlots.colorFunct(cName));
}
}
}
}
};
chart.boxPlots.prepareBoxPlot();
d3.select(window).on('resize.' + chart.selector + '.boxPlot', chart.boxPlots.update);
chart.boxPlots.update();
return chart;
};
/**
* Render a notched box on the current chart
* @param options
@ -1443,8 +1171,8 @@ export default {
.range([Math.floor(chart.yScale.range()[0] / dOpts.pointSize), 0])
.interpolate(d3.interpolateRound)
.domain(chart.yScale.domain());
var maxWidth = Math.floor(chart.xScale.rangeBand() / dOpts.pointSize);
var maxWidth = Math.ceil(chart.xScale.rangeBand() / dOpts.pointSize);
var ptsObj = {};
var cYBucket = null;
// Bucket points
@ -1560,23 +1288,18 @@ export default {
for (var pt = 0; pt < chart.groupObjs[cName].values.length; pt++) {
cPlot.objs.points.pts.push(cPlot.objs.points.g.append("circle")
.attr("class", "point")
.attr('r', function () { return chart.data[pt].size / 2; })// Options is diameter, r takes radius so divide by 2
.style("fill", chart.dataPlots.colorFunct(cName)));
.attr('r', function () {
var dataLoc = data.filter( i => cName.includes( i.Algorithm ) );
return dataLoc[pt].size;
}) // Options is diameter, r takes radius so divide by 2
.style("fill", function () {
var dataLoc = data.filter( i => cName.includes( i.Algorithm ) );
if (dataLoc[pt].sw) { return "#000000" }
else { return chart.dataPlots.colorFunct(cName) }
}));
}
}
// Bean lines
if (dOpts.showBeanLines) {
cPlot.objs.bean = {g: null, lines: []};
cPlot.objs.bean.g = cPlot.objs.g.append("g").attr("class", "bean-plot");
for (var pt = 0; pt < chart.groupObjs[cName].values.length; pt++) {
cPlot.objs.bean.lines.push(cPlot.objs.bean.g.append("line")
.attr("class", "bean line")
.style("stroke-width", '1')
.style("stroke", chart.dataPlots.colorFunct(cName)));
}
}
}
};
@ -1592,7 +1315,19 @@ export default {
}
},
mounted () {
EventBus.$on('callAlgorithhms', data => { this.ResultsLocal = data })
EventBus.$on('SendSelectedPointsUpdateIndicator', data => { this.selectedSimple = data })
EventBus.$on('SendSelectedPointsUpdateIndicatorCM', data => { this.selectedEnsem = data })
EventBus.$on('SendSelectedPointsUpdateIndicator', this.BeesFun)
EventBus.$on('SendSelectedPointsUpdateIndicatorCM', this.BeesFun)
EventBus.$on('SendStoredIDsInitial', data => { this.storedCM = data })
EventBus.$on('SendPerformanceInitialAlgs', data => {
this.PerFCM = data})
EventBus.$on('SendPerformance', data => {
this.PerF = data})
EventBus.$on('SendStoredEnsembleHist', data => { this.storedEnsem = data })
EventBus.$on('callAlgorithhms', this.BeesFun)
EventBus.$on('Responsive', data => {
@ -1670,12 +1405,6 @@ export default {
fill: white !important;
}
.chart-wrapper .box-plot .mean {
stroke: white;
stroke-dasharray: 2,1;
stroke-width: 1px;
}
@media (max-width:500px){
.chart-wrapper .box-plot circle {display: none;}
}
@ -1687,17 +1416,6 @@ export default {
opacity: 0.4;
}
.chart-wrapper .violin-plot .line {
fill: none;
stroke-width: 2px;
shape-rendering: geometricPrecision;
}
/*Notch Plot*/
.chart-wrapper .notch-plot .notch {
fill-opacity: 0.4;
stroke-width: 2;
}
.axis text {
font-size: 16px !important;

@ -120,6 +120,8 @@ export default {
}
}
EventBus.$emit('ExtractResults', classifiersInfoProcessing)
var DataGeneral, maxX, minX, maxY, minY, layout
var width = this.WH[0]*6.5 // interactive visualization

@ -0,0 +1,40 @@
<template>
<div id="ExportResults">
=======================================================
<br>
IDs of Models/Algorithms and Hyper-parameters: {{ ModelsPickled }}
<br>
=======================================================
</div>
</template>
<script>
import { EventBus } from '../main.js'
import * as Cryo from 'cryo'
export default {
name: 'Export',
data () {
return {
ModelsPickled: '',
ensModels: [],
}
},
methods: {
Pickle () {
this.ModelsPickled = Cryo.stringify(this.ensModels)
}
},
mounted () {
EventBus.$on('ExtractResults', data => {
this.ensModels = data})
EventBus.$on('ExtractResults', this.Pickle)
}
}
</script>
<style scoped>
#ExportResults {
word-break: break-all !important;
}
</style>

@ -19,7 +19,6 @@ export default {
return {
WH: [],
RandomSearLoc : 100,
SendIDLocs: [],
PerF: [],
PerFCM: [],
storedEnsem: [],
@ -28,17 +27,19 @@ export default {
values: [0,0,0,0,0,0,50,50,50,50,50,0,50,50,50,50,50,0],
valuesStage2: [0,0,0,0,0,0,50,50,50,50,50,0,50,50,50,50,50,0,25,25,25,25,25,0,25,25,25,25,25,0,25,25,25,25,25,0,25,25,25,25,25,0],
loop: 0,
storePreviousPercentage: []
storePreviousPercentage: [],
classesNumber: 9,
}
},
methods: {
reset () {
var svg = d3.select("#SankeyInter");
svg.selectAll("*").remove();
var svgLeg = d3.select("#LegendSankey");
svgLeg.selectAll("*").remove();
},
computePerformanceDiffS () {
var colorsforScatterPlot = this.PerF
console.log(this.storedCM)
var mergedStoreEnsembleLoc = [].concat.apply([], this.storedEnsem)
var mergedStoreEnsembleLocFormatted = []
for (let i = 0; i < mergedStoreEnsembleLoc.length; i++) {
@ -248,8 +249,6 @@ export default {
}
}
}
console.log(countMax)
console.log(countMin)
var percentage = []
for (let j = 0; j < countMax.length; j++) {
@ -327,7 +326,7 @@ export default {
{month:"Mutate_S2_Prime",value:125,loss:null}];
//this is the svg canvas attributes: (not buidlign abything just seeting up varaibels)
var margin = {top: 10, right: 40, bottom: 10, left: 40}, //comma is the equivalent of var :
width = 1200 - margin.left - margin.right,
width = 1250 - margin.left - margin.right,
height = 350 - margin.top - margin.bottom;
var svg = d3.select("#SankeyInter");
@ -498,6 +497,7 @@ export default {
var percentage = this.percentageOverall
console.log(percentage)
var previousPercentage = this.storePreviousPercentage
console.log(previousPercentage)
// add in the links
var link = svg.append("g").selectAll(".link")
.data(graph.links)
@ -874,7 +874,7 @@ export default {
{month:"Mutate_S2_Prime",value:125,loss:null}];
//this is the svg canvas attributes: (not buidlign abything just seeting up varaibels)
var margin = {top: 10, right: 40, bottom: 10, left: 40}, //comma is the equivalent of var :
width = 1200 - margin.left - margin.right,
width = 1230 - margin.left - margin.right,
height = 350 - margin.top - margin.bottom;
var svg = d3.select("#SankeyInter");
@ -1244,7 +1244,7 @@ export default {
{month:"Mutate_S1",value:250,loss:null}];
//this is the svg canvas attributes: (not buidlign abything just seeting up varaibels)
var margin = {top: 10, right: 40, bottom: 10, left: 40}, //comma is the equivalent of var :
width = 1200 - margin.left - margin.right,
width = 1230 - margin.left - margin.right,
height = 350 - margin.top - margin.bottom;
var svg = d3.select("#SankeyInter");
@ -1519,8 +1519,74 @@ export default {
// "translate(" + -45 + "," + 0 + ") scale(1,-1) translate(" + 0 + "," + -(height) + ")");
},
// LegendStable() {
// var viewerWidth = this.responsiveWidthHeight[0]*7
// var viewerHeight = this.responsiveWidthHeight[1]*1.6
// var viewerPosTop = viewerWidth * 0.01;
// var cellSizeHeat = 20
// var legendElementWidth = cellSizeHeat * 3;
// // http://bl.ocks.org/mbostock/5577023
// var colors = colorbrewer.PRGn[this.classesNumber];
// var svgLeg = d3.select("#LegendHeat");
// svgLeg.selectAll("*").remove();
// var svgLeg = d3.select("#LegendHeat").append("svg")
// .attr("width", viewerWidth/2)
// .attr("height", viewerHeight*0.10)
// .style("margin-top", "12px")
// var legend = svgLeg.append('g')
// .attr("class", "legend")
// .attr("transform", "translate(0,0)")
// .selectAll(".legendElement")
// .data([1.00, 0.75, 0.50, 0.25, 0.00, 0.25, 0.50, 0.75, 1.00])
// .enter().append("g")
// .attr("class", "legendElement");
// legend.append("svg:rect")
// .attr("x", viewerPosTop)
// .attr("y", function(d, i) {
// return (legendElementWidth * i) + 35;
// })
// .attr("class", "cellLegend bordered")
// .attr("width", legendElementWidth)
// .attr("height", cellSizeHeat / 2)
// .style("fill", function(d, i) {
// console.log(colors[i])
// return colors[i];
// });
// legend.append("text")
// .attr("class", "mono legendElement")
// .text(function(d, i) {
// console.log(i)
// if (i < 4) {
// return "-" + (d * 100) + "%";
// } else if (i > 4) {
// return "+" + (d * 100) + "%";
// } else {
// return "" + (d * 100) + "%";
// }
// })
// .attr("x", function(d, i) {
// if (i > 4) {
// return (legendElementWidth * i) + 45;
// } else if (i == 4) {
// return (legendElementWidth * i) + 55;
// } else {
// return (legendElementWidth * i) + 40;
// }
// })
// .attr("y", (viewerPosTop + cellSizeHeat) + 5);
// svgLeg.append("text").attr("x", 220).attr("y", 32).text("Difference in PD (solution space vs. ensemble").style("font-size", "16px").attr("alignment-baseline","top").attr('transform', 'translate(0,10) rotate(90)')
// }
},
mounted() {
//EventBus.$on('emittedEventCallingSankeyLegend', this.LegendStable)
EventBus.$on('emittedEventCallingSankeyStage2', this.SankeyViewStage2)
EventBus.$on('emittedEventCallingSankeyStage3', this.SankeyViewStage3)
@ -1540,8 +1606,6 @@ export default {
EventBus.$on('ResponsiveandChange', data => {
this.WH = data})
EventBus.$on('SendIDs', data => {
this.SendIDLocs = data})
EventBus.$on('SendPerformance', data => {
this.PerF = data})
EventBus.$on('SendPerformanceCM', data => {

@ -14,7 +14,7 @@
<font-awesome-icon icon="dna" />
{{ CrossoverMutateText }}
</button>
<button style="visibility: hidden"
<button style="display: none"
id="AddEnsemble"
v-on:click="Add">
<font-awesome-icon icon="plus-square" />
@ -45,7 +45,7 @@ export default {
ScatterPlotResults: '',
representationDef: 'mds',
FlagFinalStage: 0,
RemainingPointsIndices: []
//RemainingPointsIndices: []
}
},
methods: {
@ -70,26 +70,26 @@ export default {
ScatterPlotView () {
Plotly.purge('OverviewPlotly')
if (this.FlagFinalStage == 0) {
var modelId = JSON.parse(this.ScatterPlotResults[0])
var colorsforScatterPlot = JSON.parse(this.ScatterPlotResults[1])
var parametersLoc = JSON.parse(this.ScatterPlotResults[2])
var parameters = JSON.parse(parametersLoc)
var MDSData= JSON.parse(this.ScatterPlotResults[9])
var TSNEData = JSON.parse(this.ScatterPlotResults[10])
var UMAPData = JSON.parse(this.ScatterPlotResults[11])
} else {
console.log('mpike')
var modelId = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[0])[item])
console.log(modelId)
var colorsforScatterPlot = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[1])[item])
var parametersLoc = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[2])[item])
var parameters = JSON.parse(parametersLoc)
var MDSData = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[9])[item])
var TSNEData = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[10])[item])
var UMAPData = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[11])[item])
console.log(modelId)
}
//if (this.FlagFinalStage == 0) {
var modelId = JSON.parse(this.ScatterPlotResults[0])
var colorsforScatterPlot = JSON.parse(this.ScatterPlotResults[1])
var parametersLoc = JSON.parse(this.ScatterPlotResults[2])
var parameters = JSON.parse(parametersLoc)
var MDSData= JSON.parse(this.ScatterPlotResults[9])
var TSNEData = JSON.parse(this.ScatterPlotResults[10])
var UMAPData = JSON.parse(this.ScatterPlotResults[11])
// } else {
// console.log('mpike')
// var modelId = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[0])[item])
// console.log(modelId)
// var colorsforScatterPlot = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[1])[item])
// var parametersLoc = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[2])[item])
// var parameters = JSON.parse(parametersLoc)
// var MDSData = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[9])[item])
// var TSNEData = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[10])[item])
// var UMAPData = this.RemainingPointsIndices.map((item) => JSON.parse(this.ScatterPlotResults[11])[item])
// console.log(modelId)
// }
EventBus.$emit('sendPointsNumber', modelId.length)
@ -321,10 +321,10 @@ export default {
for (let i = 0; i < allModels.length; i++) {
if (ClassifierIDsList.indexOf((allModels[i])) < 0) {
pushModelsRemainingTemp.push(allModels[i])
indices.push(i)
//indices.push(i)
}
}
EventBus.$on('RemainingPointsIndices', indices)
//EventBus.$on('RemainingPointsIndices', indices)
EventBus.$emit('RemainingPoints', pushModelsRemainingTemp)
EventBus.$emit('SendSelectedPointsUpdateIndicator', ClassifierIDsList)
EventBus.$emit('SendSelectedPointsToServerEvent', ClassifierIDsList)
@ -342,7 +342,7 @@ export default {
var add = document.getElementById('AddEnsemble');
var remove = document.getElementById('Remove');
remove.style.display = 'none'
add.style.visibility = 'visible'
add.style.display = 'inline'
}
},
mounted() {

@ -0,0 +1,27 @@
<template>
<button style="float: right;" class="btn-outline-primary"
id="know"
v-on:click="knowClass">
<font-awesome-icon icon="file-export" />
{{ valueKnowE }}
</button>
</template>
<script>
import { EventBus } from '../main.js'
export default {
name: 'Knowledge',
data () {
return {
valueKnowE: 'Knowledge extraction'
}
},
methods: {
knowClass () {
EventBus.$emit('OpenModal')
}
}
}
</script>

@ -6,7 +6,7 @@
<b-row class="md-3">
<b-col cols="3" >
<mdb-card>
<mdb-card-header color="primary-color" tag="h5" class="text-center">Data Sets and Validation Metrics Manager</mdb-card-header>
<mdb-card-header color="primary-color" tag="h5" class="text-center">Data Sets and Performance Metrics Manager</mdb-card-header>
<mdb-card-body>
<mdb-card-text class="text-left" style="font-size: 18.5px;">
<PerformanceMetrics/>
@ -133,7 +133,7 @@
</b-col>
<b-col cols="6">
<mdb-card style="margin-top: 15px;">
<mdb-card-header color="primary-color" tag="h5" class="text-center">Majority-Voting Ensemble
<mdb-card-header color="primary-color" tag="h5" class="text-center"><small class="float-left"><Knowledge/></small>Majority-Voting Ensemble
[Sel: {{OverSelLengthCM}} / All: {{OverAllLengthCM}}]<small class="float-right"></small><span class="badge badge-info badge-pill float-right">Projection<span class="badge badge-light" style="margin-left:4px; margin-bottom:1px">2</span></span>
</mdb-card-header>
<mdb-card-body>
@ -180,6 +180,24 @@
</b-col>
</b-row>
</b-container>
<div class="w3-container">
<div id="myModal" class="w3-modal" style="position: fixed;">
<div class="w3-modal-content w3-card-4 w3-animate-zoom">
<header class="w3-container w3-blue">
<h3 style="display:inline-block; font-size: 16px; margin-top: 15px; margin-bottom:15px">Majority-Voting Ensemble Extraction (using Cryo)</h3>
</header>
<Export/>
<div class="w3-container w3-light-grey w3-padding">
<button style="float: right; margin-top: -3px; margin-bottom: -3px"
id="closeModal" class="w3-button w3-right w3-white w3-border"
v-on:click="closeModalFun">
<font-awesome-icon icon="window-close" />
{{ valuePickled }}
</button>
</div>
</div>
</div>
</div>
</body>
</template>
@ -193,6 +211,8 @@ import ValidationController from './ValidationController.vue'
import HyperParameterSpace from './HyperParameterSpace.vue'
import GlobalParamController from './GlobalParamController'
import Ensemble from './Ensemble.vue'
import Knowledge from './Knowledge.vue'
import Export from './Export.vue'
import VotingResults from './VotingResults.vue'
import History from './History.vue'
import Predictions from './Predictions.vue'
@ -202,7 +222,6 @@ import 'axios-progress-bar/dist/nprogress.css'
import 'bootstrap-css-only/css/bootstrap.min.css'
import { mdbCard, mdbCardBody, mdbCardText, mdbCardHeader } from 'mdbvue'
import { EventBus } from '../main.js'
import * as jQuery from 'jquery'
import $ from 'jquery'
import * as d3Base from 'd3'
import Papa from 'papaparse'
@ -220,6 +239,8 @@ export default Vue.extend({
HyperParameterSpace,
GlobalParamController,
Ensemble,
Knowledge,
Export,
Predictions,
VotingResults,
History,
@ -230,6 +251,7 @@ export default Vue.extend({
},
data () {
return {
valuePickled: 'Close',
sankeyCallS: true,
CMNumberofModelsOFFICIAL: [0,0,0,0,0,0,50,50,50,50,50,0,50,50,50,50,50,0],
CMNumberofModels: [0,0,0,0,0,0,5,5,5,5,5,0,5,5,5,5,5,0], // Remove that!
@ -342,19 +364,25 @@ export default Vue.extend({
this.OverviewResults = response.data.OverviewResults
console.log('Server successfully sent all the data related to visualizations!')
if (this.firstTimeExec) {
var ModelsLocalInitial = JSON.parse(this.OverviewResults[0])
EventBus.$emit('SendStoredIDsInitial', ModelsLocalInitial)
var PerformanceInitial = JSON.parse(this.OverviewResults[1])
EventBus.$emit('SendPerformanceInitialAlgs', PerformanceInitial)
EventBus.$emit('emittedEventCallingScatterPlot', this.OverviewResults)
EventBus.$emit('emittedEventCallingSankey')
EventBus.$emit('callAlgorithhms', this.OverviewResults)
EventBus.$emit('callValidation', this.OverviewResults)
//EventBus.$emit('emittedEventCallingSankeyLegend')
EventBus.$emit('callAlgorithhms')
EventBus.$emit('callValidationData', this.OverviewResults)
EventBus.$emit('callValidation')
EventBus.$emit('emittedEventCallingGrid', this.OverviewResults)
EventBus.$emit('emittedEventCallingGridSelection', this.OverviewResults)
EventBus.$emit('LegendPredict')
this.storeBothEnsCM[0] = this.OverviewResults
this.firstTimeExec = false
} else {
var IDsLocal = JSON.parse(this.OverviewResults[0])
var Performance = JSON.parse(this.OverviewResults[1])
EventBus.$emit('SendIDs', IDsLocal)
EventBus.$emit('SendStoredEnsembleHist', this.storeEnsemble)
EventBus.$emit('SendStoredEnsemble', this.storeEnsemble)
EventBus.$emit('SendPerformance', Performance)
@ -374,7 +402,11 @@ export default Vue.extend({
this.storeBothEnsCM[1] = this.OverviewResults
//EventBus.$emit('emittedEventCallingGridSelection', this.OverviewResults)
EventBus.$emit('emittedEventCallingInfo', this.OverviewResults)
EventBus.$emit('callAlgorithhms')
EventBus.$emit('emittedEventCallingGrid', this.OverviewResults)
this.getFinalResults()
EventBus.$emit('callValidationData', this.OverviewResults)
EventBus.$emit('callValidation')
}
})
.catch(error => {
@ -397,11 +429,15 @@ export default Vue.extend({
this.OverviewResultsCM = response.data.OverviewResultsCM
var ModelsLocal = JSON.parse(this.OverviewResultsCM[0])
EventBus.$emit('SendStoredCMHist', ModelsLocal)
EventBus.$emit('SendStoredIDsInitial', ModelsLocal)
var PerformanceCM = JSON.parse(this.OverviewResultsCM[1])
EventBus.$emit('SendPerformanceCM', PerformanceCM)
EventBus.$emit('SendPerformanceInitialAlgs', PerformanceCM)
console.log('Server successfully sent all the data related to visualizations for CM!')
EventBus.$emit('emittedEventCallingScatterPlot', this.OverviewResultsCM)
this.storeBothEnsCM[0] = this.OverviewResultsCM
EventBus.$emit('callAlgorithhms')
EventBus.$emit('callValidationData', this.OverviewResultsCM)
//EventBus.$emit('emittedEventCallingSankey', this.OverviewResultsCM)
//this.PredictSel = []
//EventBus.$emit('emittedEventCallingGrid', this.OverviewResultsCM)
@ -973,10 +1009,12 @@ export default Vue.extend({
changeActiveTo1 () {
this.projectionID_A = 1
this.projectionID_B = 1
EventBus.$emit('activeNow', 1)
},
changeActiveTo2 () {
this.projectionID_A = 2
this.projectionID_B = 2
EventBus.$emit('activeNow', 2)
}
},
created () {
@ -1095,6 +1133,8 @@ export default Vue.extend({
EventBus.$on('changeValues', data => { this.CMNumberofModelsOFFICIAL = data })
EventBus.$on('changeValues2', data => { this.CMNumberofModelsOFFICIALS2 = data })
EventBus.$on('OpenModal', this.openModalFun)
//Prevent double click to search for a word.
document.addEventListener('mousedown', function (event) {
if (event.detail > 1) {

@ -166,7 +166,7 @@ export default {
// === Set up canvas === //
var width = 1200,
height = 85;
height = 77;
var colourScale;
@ -183,7 +183,7 @@ export default {
var custom = d3.select(customBase); // this is our svg replacement
// settings for a grid with 40 cells in a row and 2x5 cells in a group
var groupSpacing = 40;
var groupSpacing = 42;
var cellSpacing = 2;
var cellSize = Math.floor((width - 1 * groupSpacing) / (13 * sqrtSize)) - cellSpacing;
@ -410,7 +410,7 @@ export default {
// === Set up canvas === //
var width = 1200,
height = 85;
height = 77;
var colourScale;
@ -427,7 +427,7 @@ export default {
var custom = d3.select(customBase); // this is our svg replacement
// settings for a grid with 40 cells in a row and 2x5 cells in a group
var groupSpacing = 40;
var groupSpacing = 42;
var cellSpacing = 2;
var cellSize = Math.floor((width - 1 * groupSpacing) / (13 * sqrtSize)) - cellSpacing;
@ -531,7 +531,7 @@ export default {
var svgLeg = d3.select("#LegendHeat").append("svg")
.attr("width", viewerWidth/2)
.attr("height", viewerHeight*0.10)
.style("margin-top", "12px")
.style("margin-top", "28px")
var legend = svgLeg.append('g')
.attr("class", "legend")
@ -550,14 +550,12 @@ export default {
.attr("width", legendElementWidth)
.attr("height", cellSizeHeat / 2)
.style("fill", function(d, i) {
console.log(colors[i])
return colors[i];
});
legend.append("text")
.attr("class", "mono legendElement")
.text(function(d, i) {
console.log(i)
if (i < 4) {
return "-" + (d * 100) + "%";
} else if (i > 4) {
@ -579,7 +577,7 @@ export default {
})
.attr("y", (viewerPosTop + cellSizeHeat) + 5);
svgLeg.append("text").attr("x", 220).attr("y", 32).text("Difference in predictive power").style("font-size", "16px").attr("alignment-baseline","top")
svgLeg.append("text").attr("x", 220).attr("y", 30).text("Difference in predictive power").style("font-size", "16px").attr("alignment-baseline","top")
},
},
mounted () {

@ -11,50 +11,134 @@ export default {
data () {
return {
WH: [],
ResultsValid: [],
ResultsValid: '',
factorsValid: [1, 1, 1, 1, 0, 0, 0, 0],
activeCurr: 1,
Metrics: ['Accuracy', 'Precision', 'Recall', 'F1-score', 'G-mean', 'ROC AUC', 'Log loss', 'MCC'],
selectedSimple: [],
selectedEnsem: [],
storedEnsemble: []
}
},
methods: {
reset () {
var svg = d3.select("#violin");
svg.selectAll("*").remove();
this.selectedSimple = []
this.selectedEnsem = []
this.storedEnsemble = []
this.activeCurr = 1
this.ResultsValid = ''
},
ViolinFun () {
var svg = d3.select("#violin");
svg.selectAll("*").remove();
var chart2
var IDs = JSON.parse(this.ResultsValid[0])
var valid = JSON.parse(this.ResultsValid[3])
var data = []
for (let i=0; i<400; i++){
if (i < 100){
data.push({Algorithm:"Accuracy",value:randomIntFromInterval(10,60), category:"#ff7f00"})
data.push({Algorithm:"Accuracy",value:randomIntFromInterval(10,30), category:"#fdbf6f"})
data.push({Algorithm:"Accuracy",value:randomIntFromInterval(15,25), category:"#fb9a99"})
data.push({Algorithm:"Accuracy",value:randomIntFromInterval(35,45), category:"#b15928"})
data.push({Algorithm:"Accuracy",value:randomIntFromInterval(55,70), category:"#a6cee3"})
} else if (i < 200){
data.push({Algorithm:"Precision",value:randomIntFromInterval(10,60), category:"#ff7f00"})
data.push({Algorithm:"Precision",value:randomIntFromInterval(40,70), category:"#fdbf6f"})
data.push({Algorithm:"Precision",value:randomIntFromInterval(60,100), category:"#fb9a99"})
data.push({Algorithm:"Precision",value:randomIntFromInterval(60,79), category:"#b15928"})
data.push({Algorithm:"Precision",value:randomIntFromInterval(40,45), category:"#a6cee3"})
} else if (i < 300){
data.push({Algorithm:"Recall",value:randomIntFromInterval(30,40), category:"#ff7f00"})
data.push({Algorithm:"Recall",value:randomIntFromInterval(30,40), category:"#fdbf6f"})
data.push({Algorithm:"Recall",value:randomIntFromInterval(12,30), category:"#fb9a99"})
data.push({Algorithm:"Recall",value:randomIntFromInterval(30,40), category:"#b15928"})
data.push({Algorithm:"Recall",value:randomIntFromInterval(30,70), category:"#a6cee3"})
} else {
data.push({Algorithm:"F1-score",value:randomIntFromInterval(20,80), category:"#ff7f00"})
data.push({Algorithm:"F1-score",value:randomIntFromInterval(30,40), category:"#fdbf6f"})
data.push({Algorithm:"F1-score",value:randomIntFromInterval(50,70), category:"#fb9a99"})
data.push({Algorithm:"F1-score",value:randomIntFromInterval(60,70), category:"#b15928"})
data.push({Algorithm:"F1-score",value:randomIntFromInterval(80,100), category:"#a6cee3"})
var colorsGlobal = []
var colorsGlobalBins = []
var countFactors = 0
var activeLines = []
for (let j=0; j<this.factorsValid.length; j++) {
if (this.factorsValid[j] == 1) {
countFactors = countFactors + 1
}
}
var meanGlobalSel = new Array(countFactors).fill(0)
var sumGlobalSel = new Array(countFactors).fill(0)
var countValuesSel = new Array(countFactors).fill(0)
console.log(this.activeCurr)
if (this.activeCurr == 1) {
for (let j=0; j<this.factorsValid.length; j++) {
if (this.factorsValid[j] == 1) {
for (let i=0; i<IDs.length; i++){
let tempValid = JSON.parse(valid[j])
let tempSplit = IDs[i].split(/([0-9]+)/)
if (tempSplit[0] == 'KNN' || tempSplit[0] == 'KNNC' || tempSplit[0] == 'KNNM' || tempSplit[0] == 'KNNCC' || tempSplit[0] == 'KNNCM' || tempSplit[0] == 'KNNMC' || tempSplit[0] == 'KNNMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#ff7f00"})
}
else if (tempSplit[0] == 'LR' || tempSplit[0] == 'LRC' || tempSplit[0] == 'LRM' || tempSplit[0] == 'LRCC' || tempSplit[0] == 'LRCM' || tempSplit[0] == 'LRMC' || tempSplit[0] == 'LRMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#fdbf6f"})
}
else if (tempSplit[0] == 'MLP' || tempSplit[0] == 'MLPC' || tempSplit[0] == 'MLPM' || tempSplit[0] == 'MLPCC' || tempSplit[0] == 'MLPCM' || tempSplit[0] == 'MLPMC' || tempSplit[0] == 'MLPMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#fb9a99"})
}
else if (tempSplit[0] == 'RF' || tempSplit[0] == 'RFC' || tempSplit[0] == 'RFM' || tempSplit[0] == 'RFCC' || tempSplit[0] == 'RFCM' || tempSplit[0] == 'RFMC' || tempSplit[0] == 'RFMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#b15928"})
}
else {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#a6cee3"})
}
if (this.selectedSimple.length != 0) {
if (this.selectedSimple.includes(IDs[i])) {
sumGlobalSel[j] = sumGlobalSel[j] + tempValid[i]
countValuesSel[j] = countValuesSel[j] + 1
}
}
}
colorsGlobal.push('#555')
colorsGlobalBins.push('#c0c0c0')
}
}
activeLines.push('mean')
if (this.selectedSimple.length != 0) {
activeLines.push('meanSelection')
}
} else {
var mergedStoreEnsembleLoc = [].concat.apply([], this.storedEnsemble)
console.log(mergedStoreEnsembleLoc)
for (let j=0; j<this.factorsValid.length; j++) {
if (this.factorsValid[j] == 1) {
for (let i=0; i<mergedStoreEnsembleLoc.length; i++){
let tempValid = JSON.parse(valid[j])
let tempSplit = mergedStoreEnsembleLoc[i].split(/([0-9]+)/)
console.log(tempSplit)
if (tempSplit[0] == 'KNN' || tempSplit[0] == 'KNNC' || tempSplit[0] == 'KNNM' || tempSplit[0] == 'KNNCC' || tempSplit[0] == 'KNNCM' || tempSplit[0] == 'KNNMC' || tempSplit[0] == 'KNNMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#ff7f00"})
}
else if (tempSplit[0] == 'LR' || tempSplit[0] == 'LRC' || tempSplit[0] == 'LRM' || tempSplit[0] == 'LRCC' || tempSplit[0] == 'LRCM' || tempSplit[0] == 'LRMC' || tempSplit[0] == 'LRMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#fdbf6f"})
}
else if (tempSplit[0] == 'MLP' || tempSplit[0] == 'MLPC' || tempSplit[0] == 'MLPM' || tempSplit[0] == 'MLPCC' || tempSplit[0] == 'MLPCM' || tempSplit[0] == 'MLPMC' || tempSplit[0] == 'MLPMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#fb9a99"})
}
else if (tempSplit[0] == 'RF' || tempSplit[0] == 'RFC' || tempSplit[0] == 'RFM' || tempSplit[0] == 'RFCC' || tempSplit[0] == 'RFCM' || tempSplit[0] == 'RFMC' || tempSplit[0] == 'RFMM') {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#b15928"})
}
else {
data.push({Algorithm: this.Metrics[j], value: tempValid[i], category: "#a6cee3"})
}
console.log(this.selectedEnsem.length)
if (this.selectedEnsem.length != 0) {
if (this.selectedEnsem.includes(mergedStoreEnsembleLoc[i])) {
sumGlobalSel[j] = sumGlobalSel[j] + tempValid[i]
countValuesSel[j] = countValuesSel[j] + 1
}
}
}
colorsGlobal.push('#555')
colorsGlobalBins.push('#c0c0c0')
}
}
activeLines.push('mean')
if (this.selectedEnsem.length != 0) {
activeLines.push('meanSelection')
}
}
function randomIntFromInterval(min, max) { // min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
console.log(data)
colorsGlobalBins.push('#c0c0c0')
colorsGlobalBins.push('#000')
for (let j=0; j<sumGlobalSel.length; j++) {
meanGlobalSel[j] = sumGlobalSel[j] / countValuesSel[j]
}
chart2 = makeDistroChart({
@ -65,7 +149,7 @@ export default {
selector:"#violin",
constrainExtremes:true});
chart2.renderBoxPlot({showBox:false});
chart2.renderDataPlots({showBeanLines:true,beanWidth:15,showPlot:false,showLines:['median']});
chart2.renderDataPlots({showBeanLines:true,beanWidth:15,showPlot:false,showLines:activeLines});
chart2.renderNotchBoxes({showNotchBox:false});
chart2.renderViolinPlot({reset:true, width:75, clamp:0, resolution:30, bandwidth:50});
@ -97,10 +181,10 @@ export default {
axisLables: null,
yTicks: 1,
scale: 'linear',
chartSize: {width: 800, height: 270},
margin: {top: 15, right: 60, bottom: 50, left: 50},
chartSize: {width: 820, height: 280},
margin: {top: 15, right: 40, bottom: 30, left: 40},
constrainExtremes: false,
color: ['#555','#555','#555','#555','#ffff99']
color: colorsGlobal
};
for (var setting in settings) {
chart.settings[setting] = settings[setting]
@ -152,7 +236,7 @@ export default {
return colorOptions[group];
}
} else {
return d3.scale.ordinal().range(['#c0c0c0','#c0c0c0','#c0c0c0','#c0c0c0','#ffff99'])
return d3.scale.ordinal().range(colorsGlobalBins)
}
}
@ -375,7 +459,7 @@ export default {
//Update axes
chart.objs.g.select('.x.axis').attr("transform", "translate(0," + chart.height + ")").call(chart.objs.xAxis)
.selectAll("text")
.attr("y", 5)
.attr("y", 10)
.attr("x", 30)
.attr("transform", "rotate(0)")
.style("text-anchor", "end");
@ -424,7 +508,7 @@ export default {
.append("text")
.attr("class", "label")
.attr("transform", "rotate(-90)")
.attr("y", -42)
.attr("y", -35)
.attr("x", -chart.height / 2)
.attr("dy", ".71em")
.style("text-anchor", "middle")
@ -1010,15 +1094,15 @@ export default {
cBoxPlot.objs.g = chart.groupObjs[cName].g.append("g").attr("class", "box-plot");
//Plot Box (default show)
if (bOpts.showBox) {
cBoxPlot.objs.box = cBoxPlot.objs.g.append("rect")
.attr("class", "box")
.style("fill", chart.boxPlots.colorFunct(cName))
.style("stroke", chart.boxPlots.colorFunct(cName));
//A stroke is added to the box with the group color, it is
// hidden by default and can be shown through css with stroke-width
}
// //Plot Box (default show)
// if (bOpts.showBox) {
// cBoxPlot.objs.box = cBoxPlot.objs.g.append("rect")
// .attr("class", "box")
// .style("fill", chart.boxPlots.colorFunct(cName))
// .style("stroke", chart.boxPlots.colorFunct(cName));
// //A stroke is added to the box with the group color, it is
// // hidden by default and can be shown through css with stroke-width
// }
//Plot Median (default show)
if (bOpts.showMedian) {
@ -1042,24 +1126,24 @@ export default {
.style("fill", chart.boxPlots.colorFunct(cName));
}
// Plot Whiskers (default show)
if (bOpts.showWhiskers) {
cBoxPlot.objs.upperWhisker = {fence: null, line: null};
cBoxPlot.objs.lowerWhisker = {fence: null, line: null};
cBoxPlot.objs.upperWhisker.fence = cBoxPlot.objs.g.append("line")
.attr("class", "upper whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
cBoxPlot.objs.upperWhisker.line = cBoxPlot.objs.g.append("line")
.attr("class", "upper whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
cBoxPlot.objs.lowerWhisker.fence = cBoxPlot.objs.g.append("line")
.attr("class", "lower whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
cBoxPlot.objs.lowerWhisker.line = cBoxPlot.objs.g.append("line")
.attr("class", "lower whisker")
.style("stroke", chart.boxPlots.colorFunct(cName));
}
// // Plot Whiskers (default show)
// if (bOpts.showWhiskers) {
// cBoxPlot.objs.upperWhisker = {fence: null, line: null};
// cBoxPlot.objs.lowerWhisker = {fence: null, line: null};
// cBoxPlot.objs.upperWhisker.fence = cBoxPlot.objs.g.append("line")
// .attr("class", "upper whisker")
// .style("stroke", chart.boxPlots.colorFunct(cName));
// cBoxPlot.objs.upperWhisker.line = cBoxPlot.objs.g.append("line")
// .attr("class", "upper whisker")
// .style("stroke", chart.boxPlots.colorFunct(cName));
// cBoxPlot.objs.lowerWhisker.fence = cBoxPlot.objs.g.append("line")
// .attr("class", "lower whisker")
// .style("stroke", chart.boxPlots.colorFunct(cName));
// cBoxPlot.objs.lowerWhisker.line = cBoxPlot.objs.g.append("line")
// .attr("class", "lower whisker")
// .style("stroke", chart.boxPlots.colorFunct(cName));
// }
// Plot outliers (default show)
if (bOpts.showOutliers) {
@ -1071,7 +1155,8 @@ export default {
cBoxPlot.objs.outliers[pt].point = outDiv.append("circle")
.attr("class", "outlier")
.attr('r', bOpts.outlierCSize)
.style("fill", chart.boxPlots.colorFunct(cName));
.style("fill", chart.boxPlots.colorFunct(cName))
.style("opacity", 0);
}
}
@ -1081,7 +1166,7 @@ export default {
cBoxPlot.objs.extremes[pt].point = extDiv.append("circle")
.attr("class", "extreme")
.attr('r', bOpts.outlierCSize)
.style("stroke", chart.boxPlots.colorFunct(cName));
.style("opacity", 0);
}
}
}
@ -1538,25 +1623,40 @@ export default {
chart.dataPlots.objs.lines = {};
var cMetric;
for (var line in dOpts.showLines) {
cMetric = dOpts.showLines[line];
chart.dataPlots.objs.lines[cMetric] = {};
chart.dataPlots.objs.lines[cMetric].values = [];
for (var cGroup in chart.groupObjs) {
chart.dataPlots.objs.lines[cMetric].values.push({
x: cGroup,
y: chart.groupObjs[cGroup].metrics[cMetric]
})
}
chart.dataPlots.objs.lines[cMetric].line = d3.svg.line()
.interpolate("cardinal")
.y(function (d) {
return chart.yScale(d.y)
});
chart.dataPlots.objs.lines[cMetric].g = chart.dataPlots.objs.g.append("path")
.attr("class", "line " + cMetric)
.attr("data-metric", cMetric)
.style("fill", 'none')
.style("stroke", chart.colorFunct(cMetric));
if (line == 0) {
cMetric = dOpts.showLines[line];
chart.dataPlots.objs.lines[cMetric] = {};
chart.dataPlots.objs.lines[cMetric].values = [];
for (var cGroup in chart.groupObjs) {
chart.dataPlots.objs.lines[cMetric].values.push({
x: cGroup,
y: chart.groupObjs[cGroup].metrics[cMetric]
})
}
} else {
var loop = 0;
cMetric = dOpts.showLines[line];
chart.dataPlots.objs.lines[cMetric] = {};
chart.dataPlots.objs.lines[cMetric].values = [];
for (var cGroup in chart.groupObjs) {
chart.dataPlots.objs.lines[cMetric].values.push({
x: cGroup,
y: meanGlobalSel[loop]
})
loop++
}
}
chart.dataPlots.objs.lines[cMetric].line = d3.svg.line()
.interpolate("cardinal")
.y(function (d) {
return chart.yScale(d.y)
});
chart.dataPlots.objs.lines[cMetric].g = chart.dataPlots.objs.g.append("path")
.attr("class", "line " + cMetric)
.attr("data-metric", cMetric)
.style("fill", 'none')
.style("stroke", chart.colorFunct(cMetric));
}
}
@ -1610,7 +1710,17 @@ export default {
}
},
mounted () {
EventBus.$on('callValidation', data => { this.ResultsValid = data })
EventBus.$on('SendStoredEnsemble', data => { this.storedEnsemble = data})
EventBus.$on('activeNow', data => { this.activeCurr = data })
EventBus.$on('SendSelectedPointsUpdateIndicator', data => { this.selectedSimple = data })
EventBus.$on('SendSelectedPointsUpdateIndicatorCM', data => { this.selectedEnsem = data })
EventBus.$on('SendSelectedPointsUpdateIndicator', this.ViolinFun)
EventBus.$on('SendSelectedPointsUpdateIndicatorCM', this.ViolinFun)
EventBus.$on('factorsChanged', data => { this.factorsValid = data })
EventBus.$on('callValidationData', data => { this.ResultsValid = data })
EventBus.$on('callValidation', this.ViolinFun)
EventBus.$on('Responsive', data => {
@ -1683,21 +1793,6 @@ export default {
opacity: 0.7;
}
.chart-wrapper .box-plot circle.median {
/*the script makes the circles the same color as the box, you can override this in the js*/
fill: white !important;
}
.chart-wrapper .box-plot .mean {
stroke: white;
stroke-dasharray: 2,1;
stroke-width: 1px;
}
@media (max-width:500px){
.chart-wrapper .box-plot circle {display: none;}
}
/*Violin Plot*/
.chart-wrapper .violin-plot .area {
@ -1724,7 +1819,7 @@ export default {
}
.chart-wrapper .metrics-lines {
stroke-width: 4px;
stroke-width: 3px; /* metrics lines! */
}
/* Non-Chart Styles for demo*/

@ -11,42 +11,7 @@ export default {
return {
FinalResultsforPlot: [],
Info: [],
NumberofExecutions: 0,
scoresMean: [],
scoresSTD: [],
scoresPositive: [],
scoresNegative: [],
scoresMean2: [],
scoresSTD2: [],
scoresPositive2: [],
scoresNegative2: [],
scoresMean3: [],
scoresSTD3: [],
scoresPositive3: [],
scoresNegative3: [],
scoresMean4: [],
scoresSTD4: [],
scoresPositive4: [],
scoresNegative4: [],
Stack_scoresMean: [],
Stack_scoresSTD: [],
Stack_scoresPositive: [],
Stack_scoresNegative: [],
Stack_scoresMean2: [],
Stack_scoresSTD2: [],
Stack_scoresPositive2: [],
Stack_scoresNegative2: [],
Stack_scoresMean3: [],
Stack_scoresSTD3: [],
Stack_scoresPositive3: [],
Stack_scoresNegative3: [],
Stack_scoresMean4: [],
Stack_scoresSTD4: [],
Stack_scoresPositive4: [],
Stack_scoresNegative4: [],
xaxis: [],
WH: [],
firstTime: 0
}
},
methods: {
@ -162,6 +127,13 @@ export default {
.attr("dy", ".20em")
.attr("text-anchor", "middle")
.attr('class', 'name')
.style("fill", function(d) {
if (d.countries.includes('Active')) {
return "#1f78b4"
} else {
return "#e31a1c"
}
})
.text(function(d){return d.countries;});
chart.selectAll("rect.right")
@ -199,6 +171,7 @@ export default {
}
},
mounted() {
EventBus.$on('emittedEventCallingInfo', data => { this.Info = data })
EventBus.$on('emittedEventCallingResultsPlot', data => { this.FinalResultsforPlot = data })
EventBus.$on('emittedEventCallingResultsPlot', this.VotingResultsFun)

@ -6,10 +6,10 @@ import 'bootstrap-vue/dist/bootstrap-vue.css'
import router from './router'
import { library } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { faDna, faEraser, faSearch, faTrash, faCalculator, faPlusSquare} from '@fortawesome/free-solid-svg-icons'
import { faDna, faEraser, faSearch, faTrash, faCalculator, faPlusSquare, faFileExport, faWindowClose} from '@fortawesome/free-solid-svg-icons'
import bFormSlider from 'vue-bootstrap-slider'
library.add(faDna, faEraser, faSearch, faTrash, faCalculator, faPlusSquare)
library.add(faDna, faEraser, faSearch, faTrash, faCalculator, faPlusSquare, faFileExport, faWindowClose)
Vue.component('font-awesome-icon', FontAwesomeIcon)

@ -1390,7 +1390,23 @@ def CrossoverMutateFun():
elif (CurStage == 2):
InitializeSecondStageCM(RemainingIds, setMaxLoopValue)
else:
pass
RemoveSelected(RemainingIds)
return 'Okay'
def RemoveSelected(RemainingIds):
global allParametersPerfCrossMutr
for loop in range(20):
indexes = []
for i, val in enumerate(allParametersPerfCrossMutr[loop*4]):
if (val not in RemainingIds):
indexes.append(i)
for index in sorted(indexes, reverse=True):
del allParametersPerfCrossMutr[loop*4][index]
allParametersPerfCrossMutr[loop*4+1].drop(allParametersPerfCrossMutr[loop*4+1].index[indexes], inplace=True)
allParametersPerfCrossMutr[loop*4+2].drop(allParametersPerfCrossMutr[loop*4+2].index[indexes], inplace=True)
allParametersPerfCrossMutr[loop*4+3].drop(allParametersPerfCrossMutr[loop*4+3].index[indexes], inplace=True)
return 'Okay'
def InitializeSecondStageCM (RemainingIds, setMaxLoopValue):

Loading…
Cancel
Save