コード例 #1
0
ファイル: main.py プロジェクト: Andrempp/COVIDCalculator
    'Pregnant 1st quarter':'PREG1',
    'Pregnant 2nd quarter':'PREG2',
    'Pregnant 3rd quarter':'PREG3',
    'Post-pregancy':'PREGPOST'
}

result = [html.Br(),html.B('Result:'),html.Div('Input the patient profile...')]

parameters = [
    ("Patient profile",[
        ('stage',stage,gui_utils.Button.radio,'positive test'), 
        ('age','67',gui_utils.Button.input,None), 
        ('gender',['male','female'],gui_utils.Button.radio,'male')]),
    ("Clinical history",[('comorbidities',comorbidities.keys(),gui_utils.Button.multidrop,['Cancer','Diabetes','Hepatic disease'])])]

layout = gui_utils.get_layout(pagetitle,parameters,[('result',result,gui_utils.Button.html)])

models_path = "./calc_models/"
files = ["calc_hosp_recall", "calc_hosp_f1", "calc_ic1_recall", "calc_ic1_f1", "calc_ic2_recall", "calc_ic2_f1",
         "calc_out1_recall", "calc_out1_f1", "calc_out2_recall", "calc_out2_f1", "calc_out3_recall", "calc_out3_f1",
         "calc_rs_recall", "calc_rs_f1"]

classifiers = []

for file in files:
    filename = models_path + file + ".sav"
    clf = pickle.load(open(filename, 'rb'))
    classifiers.append(clf)

target_dict = {"Hosp": {"phrase": ("need hospitalization","needing"), "classifiers": (classifiers[0], classifiers[1])},
               "IC1": {"phrase": ("need intensive care","needing"), "classifiers": (classifiers[2], classifiers[3])},
コード例 #2
0
    'humidade',
    'intensidade_vento',
    'prec_acumulada',
    'pressao',
    'radiacao'
]
parameters = [
    ('nan', '10', gui_utils.Button.input_hidden),
    ('csv_file_upload', '', gui_utils.Button.upload),
    ('csv_file_path', '', gui_utils.Button.input_hidden)
]
charts = [
    ('results_container', gui_utils.get_null_label(), gui_utils.Button.html, True)
]

layout = gui_utils.get_layout(pagetitle, [('parameters', 55, parameters)], charts, prefix=prefix)


def get_graph(fig, title=None):
    children = []

    if title is not None:
        children.append(html.Div([html.H3(title, style={'marginBottom': 0})], style={'textAlign': "center"}))

    children.append(dcc.Graph(figure=fig))

    return html.Div(children)


def get_state_field(field: str, accessor: str = 'value', prefix: str = '', type=None):
    states = dash.callback_context.states
コード例 #3
0
pagetitle = 'Biclustering'
prefix = 'padroes_rodovia_from_file'

parameters = [('nan', '10', gui_utils.Button.input_hidden),
              ('csv_file_upload', '', gui_utils.Button.upload),
              ('csv_file_path', '', gui_utils.Button.input_hidden),
              ('method', 'biclustering', gui_utils.Button.input_hidden),
              ('dataset', ['waze', 'espiras',
                           'integrative'], gui_utils.Button.radio),
              ('attributes', [''], gui_utils.Button.multidrop)]
charts = [('results_container', gui_utils.get_null_label(),
           gui_utils.Button.html, True)]

layout = gui_utils.get_layout(
    pagetitle,
    [('parameters', 27, parameters),
     ('method_parameters', 27, get_all_method_params(), 'empty_box')],
    charts,
    prefix=prefix)


def get_graph(fig, title=None):
    children = []

    if title is not None:
        children.append(
            html.Div([html.H3(title, style={'marginBottom': 0})],
                     style={'textAlign': "center"}))

    children.append(dcc.Graph(figure=fig))

    return html.Div(children)
コード例 #4
0
    'real_chart', 'discrete_chart', 'real_heatmap', 'discrete_heatmap'
]
method_parameters = {
    'biclustering_main':
    parameters_to_iluapp_layout(bicpams_parameters['main']) +
    [('biclusters_plot', bics_plot_types, gui_utils.Button.radio),
     ('biclusters', default_biclusters_options, gui_utils.Button.multidrop),
     ('biclusters_cache', '', gui_utils.Button.input_hidden)],
    'biclustering_optional':
    parameters_to_iluapp_layout(bicpams_parameters['optional'])
}

layout = gui_utils.get_layout(pagetitle, [
    ('parameters', 27, parameters),
    ('selection_map', 27, [('lisbon_map', embed_map(
        get_map(), prefix), gui_utils.Button.html)]),
    ('method_parameters', 27, get_all_method_params(), 'empty_box'),
],
                              charts,
                              prefix=prefix)


def get_state_field(field: str,
                    accessor: str = 'value',
                    prefix: str = '',
                    type=None):
    states = dash.callback_context.states
    value = states['{}{}.{}'.format(prefix, field, accessor)]
    if type:
        if type == dict:
            try:
                value = eval(value)
コード例 #5
0
    ('end_hour', '23:59', gui_utils.Button.input),
    ('dataset', ['waze', 'espiras', 'integrative'], gui_utils.Button.radio),
    ('method', ['two_step_regression'], gui_utils.Button.radio),
    ('attributes', ['all'], gui_utils.Button.multidrop),
    ('geo_json', '', gui_utils.Button.input_hidden),
    ('series_cache', '', gui_utils.Button.input_hidden),
    ('meteo_series_cache', '', gui_utils.Button.input_hidden)
]
charts = [
    ('speed_series', gui_utils.get_null_label(), gui_utils.Button.html, True),
    ('time_point_series', gui_utils.get_null_label(), gui_utils.Button.html, True),
    ('prediction', gui_utils.get_null_label(), gui_utils.Button.html, True)
]

layout = gui_utils.get_layout(pagetitle, [('parameters', 27, parameters),
                                          ('selection_map', 27, [('lisbon_map', embed_map(get_map(), prefix),
                                                                  gui_utils.Button.html)])], charts, prefix=prefix)


def get_state_field(field: str, accessor: str = 'value', prefix: str = '', type=None):
    states = dash.callback_context.states
    value = states['{}{}.{}'.format(prefix, field, accessor)]
    if type:
        if type == dict:
            try:
                value = eval(value)
            except:
                return None
        else:
            value = type(value)
    return value