mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-15 23:45:54 +00:00
Add format to report_best
This commit is contained in:
@@ -183,4 +183,9 @@ def best_results(file, compare):
|
||||
data = json.load(f)
|
||||
except Exception as e:
|
||||
return render_template("error.html", message=str(e), compare=compare)
|
||||
return render_template("report_best.html", data=data, compare=compare)
|
||||
return render_template(
|
||||
"report_best.html",
|
||||
data=data,
|
||||
compare=compare,
|
||||
framework=current_app.config[FRAMEWORK],
|
||||
)
|
||||
|
@@ -1,5 +1,8 @@
|
||||
{%- macro header(title) -%}
|
||||
{%- macro header(title, close=False, url="") -%}
|
||||
<div class="p-4 bg-primary text-white">
|
||||
{%- if close -%}
|
||||
<button type="button" class="btn-close" aria-label="Close" onclick="location.href = '{{url}}'"></button>
|
||||
{%- endif -%}
|
||||
<h1 class="alternate-font">{{ title }}</h1>
|
||||
</div>
|
||||
{%- endmacro -%}
|
||||
@@ -44,4 +47,10 @@ float-left
|
||||
{%- endmacro -%}
|
||||
{%- macro get_right_position() -%}
|
||||
float-right
|
||||
{%- endmacro -%}
|
||||
{%- macro get_row_head_class() -%}
|
||||
bg-primary text-white
|
||||
{%- endmacro -%}
|
||||
{%- macro get_align_center() -%}
|
||||
text-center
|
||||
{%- endmacro -%}
|
@@ -1,6 +1,9 @@
|
||||
{%- macro header(title) -%}
|
||||
{%- macro header(title, close=False, url="") -%}
|
||||
<div class="hero is-info is-bold">
|
||||
<div class="hero-body">
|
||||
{%- if close -%}
|
||||
<button class="delete is-large" onclick="location.href = '{{ url }}'"></button>
|
||||
{%- endif -%}
|
||||
<h1 class="is-size-3 alternate-font">{{ title }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,9 +41,18 @@ level
|
||||
{%- macro get_align_right() -%}
|
||||
has-text-right
|
||||
{%- endmacro -%}
|
||||
{%- macro get_align_center() -%}
|
||||
has-text-center
|
||||
{%- endmacro -%}
|
||||
{%- macro get_left_position() -%}
|
||||
float-left
|
||||
{%- endmacro -%}
|
||||
{%- macro get_right_position() -%}
|
||||
float-right
|
||||
{%- endmacro -%}
|
||||
{%- macro get_row_head_class() -%}
|
||||
is-selected
|
||||
{%- endmacro -%}
|
||||
{%- macro get_align_center() -%}
|
||||
has-text-center
|
||||
{%- endmacro -%}
|
@@ -26,7 +26,7 @@
|
||||
<td>{{ "%s" % data["title"] }}</td>
|
||||
<td class="{{ select.get_align_right() }}">{{ "%.6f" % data["score"] }}</td>
|
||||
<td>
|
||||
{{ select.get_button_tag("eye", "showFile('" ~ file ~ "')") | safe }}
|
||||
{{ select.get_button_tag("table-eye", "showFile('" ~ file ~ "')") | safe }}
|
||||
{% set file_best = "best_results_" ~ parts[1] ~ "_" ~ parts[2] ~ ".json" %}
|
||||
{{ select.get_button_tag("star-circle-outline", "redirectDouble('best_results', '" ~ file_best ~ "')", visible=False, name="best_buttons") | safe }}
|
||||
<input
|
||||
|
@@ -1,23 +1,47 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Dataset</th>
|
||||
<th>Score</th>
|
||||
<th>Hyperparameters</th>
|
||||
<th>File</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dataset, info in data.items() %}
|
||||
<tr>
|
||||
<td>{{ dataset }}</td>
|
||||
<td>{{ '%9.7f' % info[0] }}</td>
|
||||
<td>{{ info[1] }}</td>
|
||||
<td>
|
||||
{% set url = url_for(request.endpoint, **request.view_args)|urlencode %}
|
||||
<a href="{{ url_for('main.showfile', file_name = info[2], compare = compare) }}?url={{ url }}">{{ info[2] }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% set title = "Best Results" %}
|
||||
{% extends "base_" ~ framework ~ ".html" %}
|
||||
{% import "partials/cfg_select_" ~ framework ~ ".jinja" as select %}
|
||||
{% block content %}
|
||||
{{ select.header(title, True, url_for("main.index", compare=compare)) }}
|
||||
<container class="{{select.get_container_class() }}">
|
||||
<table id="file-table" class="{{ select.get_table_class() }}">
|
||||
<thead>
|
||||
<tr class="{{ select.get_row_head_class() }}">
|
||||
<th class="{{ select.get_align_center() }}">Dataset</th>
|
||||
<th class="{{ select.get_align_center() }}">Score</th>
|
||||
<th class="{{ select.get_align_center() }}">Hyperparameters</th>
|
||||
<th class="{{ select.get_align_center() }}">File</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dataset, info in data.items() %}
|
||||
<tr>
|
||||
<td>{{ dataset }}</td>
|
||||
<td class="{{ select.get_align_right() }}">{{ '%9.7f' % info[0] }}</td>
|
||||
<td class="{{ select.get_align_center() }}">{{ info[1] }}</td>
|
||||
<td>
|
||||
{% set url = url_for(request.endpoint, **request.view_args)|urlencode %}
|
||||
<a href="{{ url_for('main.showfile', file_name = info[2], compare = compare) }}?url={{ url }}">{{ info[2] }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</container>
|
||||
{% endblock %}
|
||||
{% block jscript %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Check if row is selected
|
||||
$('#file-table tbody').on('click', 'tr', function () {
|
||||
if ($(this).hasClass('{{ select.selected() }}')) {
|
||||
$(this).removeClass('{{ select.selected() }}');
|
||||
} else {
|
||||
$('#file-table tbody tr.{{ select.selected() }}').removeClass("{{ select.selected() }}")
|
||||
$(this).addClass('{{ select.selected() }}');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
Reference in New Issue
Block a user