Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chamathpali committed Dec 5, 2022
1 parent b64f3b0 commit 06eef3d
Showing 1 changed file with 56 additions and 53 deletions.
109 changes: 56 additions & 53 deletions src/controllers/cbr_cycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports.query = async (req, res) => {

var config = {
method: 'post',
url: CBRAPI_URL+'retrieve',
url: CBRAPI_URL + 'retrieve',
headers: {
'Accept': 'application/json'
},
Expand All @@ -161,66 +161,69 @@ module.exports.query = async (req, res) => {

// let data = new Tree(strategy.Solution)
const temp = {
"version": "0.1.0",
"name": "Tree",
"scope": "project",
"selectedTree": "23bb1a7b-a4b3-449e-8c82-4e6f3e0cb327",
"trees": [
{
"version": "0.1.0",
"scope": "tree",
"id": "23bb1a7b-a4b3-449e-8c82-4e6f3e0cb327",
"Instance": "Explanation Experience",
"description": "",
"root": "ff978c28-7448-49af-acb0-bed28400292f",
"properties": {},
"nodes": {
"ff978c28-7448-49af-acb0-bed28400292f": {
"id": "ff978c28-7448-49af-acb0-bed28400292f",
"Concept": "Sequence",
"Instance": "Sequence",
"description": "",
"properties": {},
"display": {
"x": 0,
"y": 96
"description":"",
"data": {
"version": "0.1.0",
"scope": "project",
"selectedTree": "23bb1a7b-a4b3-449e-8c82-4e6f3e0cb327",
"trees": [
{
"version": "0.1.0",
"scope": "tree",
"id": "23bb1a7b-a4b3-449e-8c82-4e6f3e0cb327",
"Instance": "Explanation Experience",
"description": "",
"root": "ff978c28-7448-49af-acb0-bed28400292f",
"properties": {},
"nodes": {
"ff978c28-7448-49af-acb0-bed28400292f": {
"id": "ff978c28-7448-49af-acb0-bed28400292f",
"Concept": "Sequence",
"Instance": "Sequence",
"description": "",
"properties": {},
"display": {
"x": 0,
"y": 96
},
"firstChild": {
"Id": "66dd0924-7b59-41c2-b690-a2f613840c68",
"Next": null
}
},
"firstChild": {
"Id": "66dd0924-7b59-41c2-b690-a2f613840c68",
"Next": null
"66dd0924-7b59-41c2-b690-a2f613840c68": {
"id": "66dd0924-7b59-41c2-b690-a2f613840c68",
"Concept": "Explanation Method",
"Instance": "/Tabular/DisCERN",
"description": "",
"properties": {},
"display": {
"x": 0,
"y": 216
},
"params": {
"desired_class": "",
"feature_attribution_method": "",
"attributed_instance": ""
}
}
},
"66dd0924-7b59-41c2-b690-a2f613840c68": {
"id": "66dd0924-7b59-41c2-b690-a2f613840c68",
"Concept": "Explanation Method",
"Instance": "/Tabular/DisCERN",
"description": "",
"properties": {},
"display": {
"x": 0,
"y": 216
},
"params": {
"desired_class": "",
"feature_attribution_method": "",
"attributed_instance": ""
}
"display": {
"camera_x": 720,
"camera_y": 394.5,
"camera_z": 1,
"x": 0,
"y": 0
}
},
"display": {
"camera_x": 720,
"camera_y": 394.5,
"camera_z": 1,
"x": 0,
"y": 0
}
}
],
"custom_nodes": []
],
"custom_nodes": []
}
}
let methods = []
temp.trees.forEach(t => {
for (var n in t.nodes){
for (var n in t.nodes) {
if (t.nodes[n].Concept == "Explanation Method") {
methods.push(t.nodes[n].Instance)
}
Expand All @@ -232,7 +235,7 @@ module.exports.query = async (req, res) => {
let s = {
name: strategy.Name,
score__: strategy.score__,
percentage:( (strategy.score__) / NUM_QYERY_FIELDS * 100).toFixed(2),
percentage: ((strategy.score__) / NUM_QYERY_FIELDS * 100).toFixed(2),
match_explanation: strategy.match_explanation,
tree: dataToSave._id,
selected: false,
Expand Down

0 comments on commit 06eef3d

Please sign in to comment.