コード例 #1
0
def get_statistics_card_ghsom():
    return dbc.CardBody(children=[
        html.Div(id='grafo_ghsom_estadisticas',
                 children='',
                 style=pu.get_css_style_center()),
        html.Div(id='div_estadisticas_ghsom',
                 children='',
                 style=pu.get_css_style_center())
    ],
                        style=pu.get_css_style_inline_flex())
コード例 #2
0
def get_freqmap_card_ghsom():
    return dbc.CardBody(children=[
        html.Div(
            children=[
                html.Div(id='grafo_ghsom_freq',
                         children='',
                         style=pu.get_css_style_center()),
                html.Div(
                    id='div_freq_map_ghsom',
                    children=None
                    #,style={'margin': '0 auto','width': '100%', 'display': 'flex','align-items': 'center', 'justify-content': 'center','flex-wrap': 'wrap', 'flex-direction': 'column ' }
                ),
            ],
            style=pu.get_css_style_inline_flex()),
        html.Div(children=[
            dbc.FormGroup([
                dbc.RadioItems(
                    options=[
                        {
                            "label": "Linear Scale",
                            "value": 0
                        },
                        {
                            "label": "Logarithmic Scale",
                            "value": 1
                        },
                    ],
                    value=0,
                    id="radioscale_freq_ghsom",
                    inline=True,
                ),
            ],
                          style=pu.get_css_style_center())
        ]),
        html.Div(style=pu.get_css_style_inline_flex(),
                 children=[
                     html.H6(
                         dbc.Badge('Minimum hits to plot a neuron   ',
                                   pill=True,
                                   color="light",
                                   className="mr-1")),
                     html.H6(
                         dbc.Badge('0',
                                   pill=True,
                                   color="warning",
                                   className="mr-1",
                                   id='badge_min_hits_slider_ghsom')),
                 ]),
        dcc.Slider(id='min_hits_slider_ghsom', min=0, max=0, value=0, step=1),
    ])
コード例 #3
0
def get_statistics_card_gsom():

    return dbc.CardBody(children=[
        html.Div(id='div_estadisticas_gsom',
                 children='',
                 style=pu.get_css_style_center()),
        html.Div([
            dbc.Button("Calculate",
                       id="ver_estadisticas_gsom_button",
                       className="mr-2",
                       color="primary")
        ],
                 style=pu.get_css_style_center())
    ])
コード例 #4
0
def get_freqmap_card_gsom():

    return dbc.CardBody(children=[
        html.Div(id='div_freq_map_gsom',
                 children='',
                 style=pu.get_single_heatmap_css_style()),
        dbc.FormGroup([
            dbc.RadioItems(
                options=[
                    {
                        "label": "Linear Scale",
                        "value": 0
                    },
                    {
                        "label": "Logarithmic Scale",
                        "value": 1
                    },
                ],
                value=0,
                id="radioscale_freq_gsom",
                inline=True,
            ),
        ],
                      style=pu.get_css_style_center()),
        html.Div(style=pu.get_css_style_inline_flex(),
                 children=[
                     html.H6(
                         dbc.Badge('Minimum hits to plot a neuron   ',
                                   pill=True,
                                   color="light",
                                   className="mr-1")),
                     html.H6(
                         dbc.Badge('0',
                                   pill=True,
                                   color="warning",
                                   className="mr-1",
                                   id='badge_min_hits_slider_gsom')),
                 ]),
        dcc.Slider(id='min_hits_slider_gsom', min=0, max=0, value=0, step=1),
        html.Div([
            dbc.Button("Plot",
                       id="ver_freq_map_gsom_button",
                       className="mr-2",
                       color="primary")
        ],
                 style=pu.get_css_style_center())
    ])
コード例 #5
0
def get_umatrix_card_ghsom():

    return dbc.CardBody(children=[
        html.Div(
            children=[
                html.Div(
                    id='grafo_ghsom_umatrix',
                    children='',
                    #style=pu.get_css_style_inline_flex()
                ),
                html.Div(
                    id='umatrix_div_fig_ghsom',
                    children='',
                    #style= pu.get_single_heatmap_css_style()
                ),
            ],
            style=pu.get_css_style_inline_flex()),
        html.Div(dbc.Checklist(options=[{
            "label": "Label Neurons",
            "value": 1
        }],
                               value=[],
                               id="check_annotations_um_ghsom"),
                 style=pu.get_css_style_center()),
        dbc.FormGroup([
            dbc.RadioItems(
                options=[
                    {
                        "label": "Linear Scale",
                        "value": 0
                    },
                    {
                        "label": "Logarithmic Scale",
                        "value": 1
                    },
                ],
                value=0,
                id="radioscale_umatrix_ghsom",
                inline=True,
            ),
        ],
                      style=pu.get_css_style_center()),
    ])
コード例 #6
0
def get_componentplans_card_gsom():

    #Card: Component plans

    return dbc.CardBody(children=[
        html.H5("Select Features"),
        dcc.Dropdown(
            id='dropdown_atrib_names_gsom',
            options=session_data.get_data_features_names_dcc_dropdown_format(),
            multi=True),
        html.Div([
            dbc.Checklist(options=[{
                "label": "Select All",
                "value": 1
            }],
                          value=[],
                          id="check_seleccionar_todos_mapas_gsom"),
            dbc.Checklist(options=[{
                "label": "Label Neurons",
                "value": 1
            }],
                          value=[],
                          id="check_annotations_comp_gsom"),
            dbc.FormGroup([
                dbc.RadioItems(
                    options=[
                        {
                            "label": "Linear Scale",
                            "value": 0
                        },
                        {
                            "label": "Logarithmic Scale",
                            "value": 1
                        },
                    ],
                    value=0,
                    id="radioscale_cplans_gsom",
                    inline=True,
                ),
            ]),
            dbc.Button("Plot Selected Components Map",
                       id="ver_mapas_componentes_button_gsom",
                       className="mr-2",
                       color="primary")
        ],
                 style=pu.get_css_style_center()),
        html.Div(id='component_plans_figures_gsom_div',
                 children=[''],
                 style=pu.get_css_style_inline_flex())
    ])
コード例 #7
0
def get_savemodel_card_ghsom():

    return dbc.CardBody(children=[
        html.Div(children=[
            html.H5("Nombre del fichero"),
            dbc.Input(id='nombre_de_fichero_a_guardar_ghsom',
                      placeholder="Nombre del archivo",
                      className="mb-3"),
            dbc.Button("Guardar modelo",
                       id="save_model_ghsom",
                       className="mr-2",
                       color="primary"),
            html.P('', id="check_correctly_saved_ghsom")
        ],
                 style=pu.get_css_style_center()),
    ])
コード例 #8
0
def analyze_gsom_data():

    # Body
    body = html.Div(children=[
        html.H4('Data Analysis', className="card-title"),
        html.H6('Train Parameters', className="card-title"),
        html.Div(id='info_table_gsom',
                 children=info_trained_params_gsom_table(),
                 style=pu.get_css_style_center()),
        html.Div(children=[
            dbc.Tabs(
                id='tabs_gsom',
                active_tab='statistics',
                style=pu.get_css_style_inline_flex(),
                children=[
                    dbc.Tab(get_select_splitted_option_card(),
                            label='Select Splitted Dataset Part',
                            tab_id='splitted_part',
                            disabled=(not session_data.data_splitted)),
                    dbc.Tab(get_statistics_card_gsom(),
                            label='Statistics',
                            tab_id='statistics'),
                    dbc.Tab(get_winnersmaps_card_gsom(),
                            label='Winners Map',
                            tab_id='winners_map'),
                    #dbc.Tab( get_freqmap_card_gsom() ,label = 'Freq Map',tab_id='freq_map'),
                    #dbc.Tab( get_componentplans_card_gsom() ,label = 'Component Plans',tab_id='component_plans'),
                    dbc.Tab(get_freq_and_cplans_cards_gsom(),
                            label=' Freq. Map + Component Plans',
                            tab_id='freq_and_cplans_gsom'),
                    dbc.Tab(get_umatrix_card_gsom(),
                            label=' U Matrix',
                            tab_id='umatrix'),
                    dbc.Tab(get_savemodel_card_gsom(),
                            label='Save Model',
                            tab_id='save_model'),
                ]),
        ])
    ])

    ###############################   LAYOUT     ##############################
    layout = html.Div(children=[
        elements.navigation_bar,
        body,
    ])

    return layout
コード例 #9
0
def get_ghsom_graph_div(fig, dcc_graph_id):
    children = [
        dcc.Graph(id=dcc_graph_id, figure=fig),
        html.P('Double click on a node to plot his map',
               className="text-secondary",
               style=pu.get_css_style_center())
    ]
    div = html.Div(children=children,
                   style={
                       'margin': '0 auto',
                       'width': '100%',
                       'display': 'flex',
                       'align-items': 'center',
                       'justify-content': 'center',
                       'flex-wrap': 'wrap',
                       'flex-direction': 'column '
                   })
    return div
コード例 #10
0
def get_select_splitted_option_card():
    return dbc.CardBody(
        children=[
            html.Div(
                children=[
                    #dbc.Label("Select dataset portion"),
                    html.H5(
                        dbc.Badge('Select Dataset Portion',
                                  color="info",
                                  className="mr-1")),
                    html.Br(),
                    dbc.RadioItems(
                        options=[
                            {
                                "label": "Train Data",
                                "value": 1
                            },
                            {
                                "label": "Test Data",
                                "value": 2
                            },
                            {
                                "label": "Train + Test Data",
                                "value": 3
                            },
                        ],
                        value=2,
                        id="dataset_portion_radio_analyze_ghsom",
                    ),
                    html.Br(),
                    html.P('Replot Graps after select a new option',
                           className="text-secondary"),
                ],
                style={
                    'display': 'inline-block',
                    'text-align': 'left'
                },
            ),
        ],
        style=pu.get_css_style_center(),
    )
コード例 #11
0
def get_umatrix_card_gsom():

    return dbc.CardBody(children=[
        html.Div(id='umatrix_div_fig_gsom',
                 children='',
                 style=pu.get_single_heatmap_css_style()),
        html.Div([
            dbc.Checklist(options=[{
                "label": "Label Neurons",
                "value": 1
            }],
                          value=[],
                          id="check_annotations_umax_gsom"),
            dbc.FormGroup([
                dbc.RadioItems(
                    options=[
                        {
                            "label": "Linear Scale",
                            "value": 0
                        },
                        {
                            "label": "Logarithmic Scale",
                            "value": 1
                        },
                    ],
                    value=0,
                    id="radioscale_umatrix_gsom",
                    inline=True,
                ),
            ]),
            dbc.Button("Plot",
                       id="ver_umatrix_gsom_button",
                       className="mr-2",
                       color="primary")
        ],
                 style=pu.get_css_style_center())
    ])
コード例 #12
0
                         dbc.Badge(
                             'adriwitek',
                             pill=True,
                             color="info",
                             className="mr-1",
                             id='badge_info_percentage_test_slider'))
                 ]),
             dbc.Button('https://github.com/adriwitek',
                        color="link",
                        href='https://github.com/adriwitek'),
             html.Br(),
             html.Br(),
             dbc.Button(
                 "Close", id="button_close_about", className="ml-auto"),
         ],
                       style=pu.get_css_style_center()),
     ],
     id="modal_about",
     centered=True,
     is_open=False,
 ),
 dbc.Row(
     [
         dbc.Col(
             dbc.Button("About", id='button_about', color="link"),
             width="auto",
         ),
     ],
     no_gutters=True,
     className="ml-auto flex-nowrap mt-3 mt-md-0",
     align="center",
コード例 #13
0
def Training_animation():

    session_data.reset_progressbar_value()
    layout = html.Div(children=[
        html.Div(id="hidden_div_for_redirect_callback"),
        elements.navigation_bar,
        dbc.Card(
            color='light',
            children=[
                dbc.CardBody(
                    dbc.ListGroup(
                        [

                            # Modelos guardados en la app
                            dbc.ListGroupItem([
                                html.H4('Training...',
                                        id='status_string',
                                        className="card-title",
                                        style=pu.get_css_style_center()),
                                html.Div(children=dbc.Badge(
                                    "Elapsed Time:",
                                    id='badge_t_transcurrido',
                                    color="warning",
                                    className="mr-1"),
                                         style={'textAlign': 'center'}),
                                html.P(id='timer_training',
                                       children="00 h 00 m 00 s",
                                       className="text-muted",
                                       style={
                                           'font-family': 'Courier New',
                                           'font-size': '2vw',
                                           'textAlign': 'center'
                                       }),
                                html.Div(children=get_plot_qe_evolution(),
                                         style={'textAlign': 'center'}),
                                dcc.Interval(id="progress_interval",
                                             n_intervals=0,
                                             interval=1000,
                                             disabled=False),
                                dbc.Progress(id="progressbar",
                                             value=0,
                                             color="warning"),
                                dbc.Collapse(
                                    id='collapse_multiple_trainings',
                                    is_open=False,
                                    children=[
                                        html.Div(
                                            children=[
                                                dbc.Label('Training model '),
                                                dbc.Badge(
                                                    '0',
                                                    id=
                                                    'badge_current_model_training',
                                                    pill=True,
                                                    color="light",
                                                    className="mr-1"),
                                                dbc.Label('of '),
                                                dbc.Badge(session_data.
                                                          get_n_of_models(),
                                                          pill=True,
                                                          color="info",
                                                          className="mr-1"),
                                            ],
                                            style=pu.get_css_style_inline_flex(
                                            ),
                                        ),
                                        dbc.Progress(
                                            id="progressbar_total_trainings",
                                            value=0),
                                    ]),
                                html.Br(),
                                html.Div([
                                    dbc.Button("Analyze Model(s)",
                                               id="analyze_model_button",
                                               href='',
                                               disabled=True,
                                               className="mr-2",
                                               color="primary")
                                ],
                                         style={'textAlign': 'center'}),
                            ]),
                        ],
                        flush=True,
                    ), )
            ]),
    ])

    return layout
コード例 #14
0
def get_winnersmap_card_ghsom():
    return dbc.CardBody(children=[
        dbc.Alert([
            html.H4("Target not selected yet!", className="alert-heading"),
            html.P("Please select a target below to print winners map. ")
        ],
                  color='danger',
                  id='alert_target_not_selected_ghsom',
                  is_open=True),
        dbc.Alert([
            html.H4("Too many different categorial targets !",
                    className="alert-heading"),
            html.
            P("Since there are more than 269(max. diferenciable discrete colors) unique targets, color representation will be ambiguous for some of them. "
              )
        ],
                  color='danger',
                  id='output_alert_too_categorical_targets_ghsom',
                  is_open=False),
        dcc.Dropdown(
            id='dropdown_target_selection_ghsom',
            options=session_data.get_targets_options_dcc_dropdown_format(),
            multi=False,
            value=session_data.get_target_name()),
        html.Br(),
        dbc.Collapse(
            id='collapse_winnersmap_ghsom',
            is_open=False,
            children=[
                html.Div(
                    children=[
                        html.Div(id='grafo_ghsom_winners',
                                 children='',
                                 style=pu.get_css_style_center()),
                        html.Div(
                            id='winners_map_ghsom',
                            children='',
                            #style= pu.get_single_heatmap_css_style()
                        ),
                    ],
                    style=pu.get_css_style_inline_flex()),
                html.Div(dbc.Checklist(options=[{
                    "label": "Label Neurons",
                    "value": 1
                }],
                                       value=[],
                                       id="check_annotations_winmap_ghsom"),
                         style=pu.get_css_style_center()),
                dbc.Collapse(
                    id='collapse_logscale_winners_ghsom',
                    is_open=session_data.is_preselected_target_numerical(),
                    children=[
                        dbc.FormGroup([
                            dbc.RadioItems(
                                options=[
                                    {
                                        "label": "Linear Scale",
                                        "value": 0
                                    },
                                    {
                                        "label": "Logarithmic Scale",
                                        "value": 1
                                    },
                                ],
                                value=0,
                                id="radioscale_winners_ghsom",
                                inline=True,
                            ),
                        ],
                                      style=pu.get_css_style_center()),
                    ])
            ])
    ])
コード例 #15
0
def get_componentplans_card_ghsom():

    return dbc.CardBody(children=[
        html.H5("Seleccionar atributos para mostar:"),
        dcc.Dropdown(
            id='dropdown_atrib_names_ghsom',
            options=session_data.get_data_features_names_dcc_dropdown_format(),
            multi=True),
        html.Div([
            dbc.Checklist(options=[{
                "label": "Check All",
                "value": 1
            }],
                          value=[],
                          id="check_seleccionar_todos_mapas_ghsom")
        ],
                 style=pu.get_css_style_center()),
        dbc.Alert([
            html.H4("Feature(s) not selected yet!", className="alert-heading"),
            html.
            P("Please select at least one feature below to plot his Component Plan. "
              )
        ],
                  color='danger',
                  id='alert_cplans_not_selected_ghsom',
                  is_open=True),
        dbc.Collapse(
            id='collapse_cplan_ghsom',
            is_open=False,
            children=[

                #html.Div(id = 'grafo_ghsom_cplans',children = '',
                #    style=pu.get_css_style_inline_flex()
                #),
                html.Div(id='component_plans_figures_ghsom_div',
                         children=[''],
                         style=pu.get_single_heatmap_css_style()),
                html.Div(dbc.Checklist(options=[{
                    "label": "Label Neurons",
                    "value": 1
                }],
                                       value=[],
                                       id="check_annotations_comp_ghsom"),
                         style=pu.get_css_style_center()),
                dbc.FormGroup([
                    dbc.RadioItems(
                        options=[
                            {
                                "label": "Linear Scale",
                                "value": 0
                            },
                            {
                                "label": "Logarithmic Scale",
                                "value": 1
                            },
                        ],
                        value=0,
                        id="radioscale_cplans_ghsom",
                        inline=True,
                    ),
                ],
                              style=pu.get_css_style_center()),
            ])
    ])