-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayouts.py
More file actions
132 lines (125 loc) · 5.96 KB
/
layouts.py
File metadata and controls
132 lines (125 loc) · 5.96 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import plotly.express as px
from dash import dcc, html, dash_table
import dash_bootstrap_components as dbc
base_layout = html.Div(className="container", children=[
html.P(id='none'), # Dummy component, used to update model
dcc.Location(id="url"),
dcc.Store(id='fig-store'),
dcc.Store(id='data-store'),
dcc.Store(id='model-store'),
dcc.Store(id='results-store'),
html.Div(className="Title center", children=[
html.H1("Machine Learning from Scratch", className="title-text")
]),
html.Div(className="Options center", style={"width": "80%"}, children=[
dcc.Dropdown(['Classification', 'Regression', 'Clustering', 'Dimensionality Reduction'], id='dataset_dropdown', placeholder='Dataset', className="dropdown"),
dcc.Dropdown([''], id='classification_dropdown', placeholder='Dataset', className="dropdown"),
dcc.Dropdown([''], id='algorithm_dropdown', placeholder='Algorithm', className="dropdown"),
dcc.Dropdown([''], id='regression_method_dropdown', placeholder='Method', className="dropdown"),
dcc.Dropdown([''], id='optimizer_dropdown', placeholder='Optimizer', className="dropdown"),
html.Div([
dcc.Dropdown([''], id='regularization_dropdown', placeholder='Regularization Type', className="inline dropdown"),
dcc.Input('0.01', id="regularization_input", className="regularization_input"),
],
className="input-group-append",
id="regularization_group"
),
html.Div(id="step", children=[
html.Button(id='step_button', className="inline", children="Step"),
dcc.Input(id='step_input', value=1, className="inline", style={"width":"5em", "text-align":"right"}),
],
className="input-group-append",
style={'display':'none'}
),
html.Br(),
html.Button('Reset', id='reset_button', style={'display':'none'})
]),
html.Div(className="Graphs", children=[
dcc.Tabs(id="graph-tabs", children=[
dcc.Tab(label="Primary Data", id="data-tab", className="tabs", children=[
dcc.Graph(id='main-graph', figure=px.scatter().update_layout(template="plotly_dark", margin=dict(l=50, r=30, t=30, b=50), xaxis=dict(showgrid=False, zeroline=False), yaxis=dict(showgrid=False, zeroline=False))),
]),
dcc.Tab(label="Residuals", id="residuals-tab", className="tabs hidden", children=[
dcc.Graph(id='residual-graph', figure=px.scatter().update_layout(template="plotly_dark")),
]),
dcc.Tab(label="Distribution", id="residual-distribution-tab", className="tabs hidden", children=[
dcc.Graph(id='residual-distribution-graph', figure=px.scatter().update_layout(template="plotly_dark")),
]),
]),
]),
html.Div(className="Info", children=[
html.Div(children=[
dbc.Accordion(
[
dbc.AccordionItem(
[
html.P("Please choose an algorithm.", id="summary-text", className='accordion-text')
],
title="Summary",
),
dbc.AccordionItem(
id="objective",
children=[
html.P("Please choose an algorithm.", id="objective-text", className='accordion-text')
],
title="Objective",
),
dbc.AccordionItem(
id="complexity",
children=[
html.P("Please choose an algorithm.", id="complexity-text", className='accordion-text')
],
title="Complexity",
),
dbc.AccordionItem(
[
html.P("Please choose an algorithm.", id="assumptions-text", className='accordion-text')
],
title="Assumptions",
),
dbc.AccordionItem(
[
html.A(id="info-text", className='accordion-text'),
],
title="More Information",
)
],
start_collapsed=True,
id='info-accordion' # Add this line
),
],
className=""
),
]),
html.Div(className="Data", children=[
html.H4("Data", id="data-text", className="text-center"),
dcc.Tabs(id="train-test-tabs", children=[
dcc.Tab(label="Train", className="tabs", children=[
dash_table.DataTable(
id="train_table",
style_table={'height': '200px', 'overflowY': 'auto'},
style_header={'backgroundColor': '#343a40', 'fontWeight': 'bold', 'color': 'white'},
style_cell={'backgroundColor': '#343a40', 'color': 'white'},
),
]),
dcc.Tab(label="Test", className="tabs", children=[
dash_table.DataTable(
id="test_table",
style_table={'height': '120px', 'overflowY': 'auto'},
style_header={'backgroundColor': '#343a40', 'fontWeight': 'bold', 'color': 'white'},
style_cell={'backgroundColor': '#343a40', 'color': 'white'},
),
]),
]),
]),
html.Div(className="Results", children=[
html.H4("Results", id="results-text", className=""),
dash_table.DataTable(
id="results-table",
style_table={'width': '80%', 'max-width': '80%'},
style_header={'backgroundColor': '#343a40', 'fontWeight': 'bold', 'color': 'white'},
style_cell={'backgroundColor': '#343a40', 'color': 'white'},
data=[{'metric': '', 'values': ''}]
)
]),
])