Skip to content
Snippets Groups Projects
Commit 013c29b5 authored by Caroline DE POURTALES's avatar Caroline DE POURTALES
Browse files

first commit on decision tree

parent 87c31687
No related branches found
No related tags found
No related merge requests found
Showing
with 82 additions and 0 deletions
app.py 0 → 100644
# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.
from pages.layout import create_layout
import dash
import json
models_data = open('data_retriever.json')
data = json.load(models_data)
app = dash.Dash(__name__)
if __name__ == '__main__':
app.layout = create_layout(data)
app.run_server(debug=True)
\ No newline at end of file
{
"data" :
[
{
"ml_type" : "DecisionTree",
"trained_models" : "pages/application/DecisionTree/trained_models",
"instances" : "pages/application/DecisionTree/instances/",
"explicability_algorithm" : "pages/application/DecisionTree/decision_tree_explicability",
"component" : "pages.application.DecisionTree.DecisionTreeComponent"
}
]
}
\ No newline at end of file
File added
File added
import visdcc
class DecisionTree():
def __init__(self):
self.options = {
'height': '600px',
'layout': {
'hierarchical': {
'enabled': True,
'sortMethod': 'directed'
}
},
'interaction': {'hover': True},
'nodes': {'shape': 'circle', 'font': {'size': 25}},
'edges':{'arrows': {'to': {'enabled': True}},
'smooth': {'type': "cubicBezier", 'forceDirection': 'vertical'}},
'physics':{'barnesHut': {'avoidOverlap': 0.4}}
}
self.network = visdcc.Network(id = 'net',
data= {'nodes':[],
'edges':[]},
options = self.options)
def update(self, dataset) :
self.network = visdcc.Network(id = 'net',
data= {'nodes':[
{'id': 1, 'label': 'u'},
{'id': 2, 'label': 'Node 2'},
{'id': 3, 'label': 'i'},
{'id': 4, 'label': 'Node 4'}, ],
'edges':[
{'id':'1-3', 'from': 1, 'to': 3, 'color' : '#00ff0f'},
{'id':'1-2', 'from': 1, 'to': 2, 'color' : '#00ff0f'},
{'id':'2-4', 'from': 2, 'to': 4, 'color' : '#00ffff'},]},
options = self.options)
def update_with_explicability(self, instance) :
self.network = self.network
\ No newline at end of file
File added
1,77,125,5,1,11,215,1,1,19,1,1,259,31
\ No newline at end of file
1,93,207,1,23,11,159,0,0,11,1,1,119,57
\ No newline at end of file
0,19,407,1,3,1,79,1,1,41,0,1,119,107
\ No newline at end of file
1,277,205,1,11,11,39,0,1,25,1,1,109,313
\ No newline at end of file
1,693,183,1,19,9,169,0,1,25,0,1,163,127
\ No newline at end of file
1,367,397,1,1,11,67,0,0,11,1,1,27,325
\ No newline at end of file
0,601,19,5,21,13,21,0,0,11,1,1,101,459
\ No newline at end of file
1,587,407,1,23,13,131,1,1,23,0,1,119,479
\ No newline at end of file
1,559,327,1,23,11,49,1,0,11,0,1,213,325
\ No newline at end of file
1,603,47,1,21,11,35,0,0,11,1,1,59,423
\ No newline at end of file
1,403,205,5,1,11,61,0,0,11,1,1,327,325
\ No newline at end of file
0,389,205,1,25,13,239,1,1,25,0,1,239,185
\ No newline at end of file
1,501,225,1,9,11,123,1,1,41,0,1,251,51
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment