parent f476157f9c
commit 26cdbf3f84
  1. BIN
      __pycache__/run.cpython-38.pyc
  2. 3
      frontend/src/components/FeatureSpaceDetail.vue
  3. 8
      frontend/src/components/FeatureSpaceOverview.vue
  4. 63
      run.py

Binary file not shown.

@ -832,7 +832,8 @@ export default {
var VIFVar = JSON.parse(this.dataFS[23+this.quadrantNumber])
var MIVar = JSON.parse(this.dataFS[28+this.quadrantNumber])
MIVar = MIVar.concat(this.MIRemaining)
var colorCateg = d3.scaleOrdinal(d3.schemeDark2)
//var colorCateg = d3.scaleOrdinal(d3.schemeDark2)
var colorCateg = d3.scaleOrdinal().domain([0, 1, 2, 4]).range(['#808000','#7570b3','#1b9e77','#d95f02'])
var corrTargetFormatted = []
for (let i = 0; i < Object.keys(corrTarget).length; i++) {

@ -1185,8 +1185,8 @@ export default {
var legendRectSize = 14;
var legendSpacing = 3;
var color = d3v5.scaleOrdinal(d3v5.schemeDark2)
var labelsData = JSON.parse(this.overallData[1])
var color = d3v5.scaleOrdinal().domain(labelsData).range(['#808000','#7570b3','#1b9e77','#d95f02'])
var svgLegend = d3v5.select('#legendTarget').append('svg')
.attr('width', 130)
@ -1199,7 +1199,7 @@ export default {
.attr('class', 'legend') // NEW
.attr('transform', function(d, i) { // NEW
var height = legendRectSize + legendSpacing; // NEW
var offset = height * color.domain().length / 2;
var offset = height * 0 / 2;
var horz = 25 // NEW
var vert = i * height - offset; // NEW
return 'translate(' + horz + ',' + vert + ')'; // NEW
@ -1208,14 +1208,14 @@ export default {
legend.append('rect')
.attr('width', legendRectSize)
.attr('height', legendRectSize)
.style('fill', function (d) { return color(d) })
.style('fill', function (d) { var d_string = String(d); return color(d_string) })
.style('opacity', "0.5");
legend.append('text')
.attr('class', 'legendLab')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing)
.text(function(d) { return d; });
.text(function(d) { return d; });
}
},
mounted () {

@ -470,9 +470,11 @@ def dataSetSelection():
XData, yData = ArrayDataResults, AllTargetsFloatValues
global keepOriginalFeatures
global OrignList
keepOriginalFeatures = XData.copy()
keepOriginalFeatures.columns = [str(col) + ' F'+str(idx+1)+'' for idx, col in enumerate(keepOriginalFeatures.columns)]
columnsNewGen = keepOriginalFeatures.columns.values.tolist()
OrignList = keepOriginalFeatures.columns.values.tolist()
XData.columns = ['F'+str(idx+1) for idx, col in enumerate(XData.columns)]
@ -526,6 +528,7 @@ def executeModel(exeCall, flagEx, nodeTransfName):
global listofTransformations
global XDataStoredOriginal
global finalResultsData
global OrignList
global tracker
global XDataNoRemoval
@ -539,11 +542,12 @@ def executeModel(exeCall, flagEx, nodeTransfName):
if (flagEx == 3):
XDataStored = XData.copy()
XDataNoRemovalOrig = XDataNoRemoval.copy()
OrignList = columnsNewGen
elif (flagEx == 2):
XData = XDataStored.copy()
XDataStoredOriginal = XDataStored.copy()
XDataNoRemoval = XDataNoRemovalOrig.copy()
columnsNewGen = keepOriginalFeatures.columns.values.tolist()
columnsNewGen = OrignList
else:
XData = XDataStored.copy()
XDataNoRemoval = XDataNoRemovalOrig.copy()
@ -552,13 +556,12 @@ def executeModel(exeCall, flagEx, nodeTransfName):
if (flagEx == 4):
XDataStored = XData.copy()
XDataNoRemovalOrig = XDataNoRemoval.copy()
print('edw!')
#XDataStoredOriginal = XDataStored.copy()
elif (flagEx == 2):
XData = XDataStored.copy()
XDataStoredOriginal = XDataStored.copy()
XDataNoRemoval = XDataNoRemovalOrig.copy()
columnsNewGen = keepOriginalFeatures.columns.values.tolist()
columnsNewGen = OrignList
else:
XData = XDataStored.copy()
#XDataNoRemoval = XDataNoRemovalOrig.copy()
@ -572,12 +575,20 @@ def executeModel(exeCall, flagEx, nodeTransfName):
bayesopt.maximize(init_points=10, n_iter=5, acq='ucb') # 35 and 15
bestParams = bayesopt.max['params']
estimator = XGBClassifier(n_estimators=int(bestParams.get('n_estimators')), eta=bestParams.get('eta'), max_depth=int(bestParams.get('max_depth')), probability=True, random_state=RANDOM_SEED, silent=True, verbosity = 0, use_label_encoder=False)
columnsNewGen = keepOriginalFeatures.columns.values.tolist()
columnsNewGen = OrignList
print(columnsNewGen)
if (len(exeCall) != 0):
if (flagEx == 1):
XData = XData.drop(XData.columns[exeCall], axis=1)
XDataStoredOriginal = XDataStoredOriginal.drop(XDataStoredOriginal.columns[exeCall], axis=1)
currentColumnsDeleted = []
for uniqueValue in exeCall:
currentColumnsDeleted.append(tracker[uniqueValue])
for column in XData.columns:
if (column in currentColumnsDeleted):
XData = XData.drop(column, axis=1)
XDataStoredOriginal = XDataStoredOriginal.drop(column, axis=1)
elif (flagEx == 2):
columnsKeepNew = []
columns = XDataGen.columns.values.tolist()
@ -665,29 +676,6 @@ def executeModel(exeCall, flagEx, nodeTransfName):
columnsNamesLoc = XData.columns.values.tolist()
tracker = []
for value in columnsNewGen:
value = value.split(' ')
if (len(value) > 1):
tracker.append(value[1])
else:
tracker.append(value[0])
storeIndices = []
valuesStore = []
for ind, col in enumerate(tracker):
for value in XDataStoredOriginal.columns.values.tolist():
if col in value:
storeIndices.append(ind)
valuesStore.append(valuesStore)
tracker[ind] = tracker[ind].replace(col, value)
else:
break
# FIX THAT!
#for el in storeIndices:
# columnsNewGen[el] = columnsNewGen[el].replace(columnsNewGen[el],valuesStore[el])
#print(columnsNewGen)
for col in columnsNamesLoc:
splittedCol = col.split('_')
if (len(splittedCol) == 1):
@ -704,6 +692,23 @@ def executeModel(exeCall, flagEx, nodeTransfName):
print(XDataStored)
print(XDataStoredOriginal.columns)
print(XDataNoRemoval)
tracker = []
for value in columnsNewGen:
value = value.split(' ')
if (len(value) > 1):
tracker.append(value[1])
else:
tracker.append(value[0])
print(tracker)
# for ind, col in enumerate(tracker):
# for value in XDataStoredOriginal.columns.values.tolist():
# if col in value:
# tracker[ind] = tracker[ind].replace(col, value)
# else:
# break
estimator.fit(XData, yData)
yPredict = estimator.predict(XData)
yPredictProb = cross_val_predict(estimator, XData, yData, cv=crossValidation, method='predict_proba')

Loading…
Cancel
Save