mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-19 01:15:53 +00:00
Update format to report
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
||||
import json
|
||||
import shutil
|
||||
import xlsxwriter
|
||||
from dotenv import dotenv_values
|
||||
from benchmark.Utils import Files, Folders
|
||||
from benchmark.Arguments import EnvData
|
||||
from benchmark.ResultsBase import StubReport
|
||||
@@ -99,7 +100,7 @@ def datasets(compare):
|
||||
def showfile(file_name, compare, back=None):
|
||||
compare = compare.capitalize() == "True"
|
||||
back = request.args["url"] if back is None else back
|
||||
print(f"back [{back}]")
|
||||
app_config = dotenv_values(".env")
|
||||
with open(os.path.join(Folders.results, file_name)) as f:
|
||||
data = json.load(f)
|
||||
try:
|
||||
@@ -113,6 +114,7 @@ def showfile(file_name, compare, back=None):
|
||||
summary=summary,
|
||||
framework=current_app.config[FRAMEWORK],
|
||||
back=back,
|
||||
app_config=app_config,
|
||||
)
|
||||
|
||||
|
||||
|
@@ -1,28 +1,14 @@
|
||||
{% for item in data.results %}
|
||||
<tr>
|
||||
<td>
|
||||
{{item.dataset}}
|
||||
</td>
|
||||
<td class="{{ right }}">
|
||||
{{'{:,}'.format(item.samples)}}
|
||||
</td>
|
||||
<td class="{{ right }}">
|
||||
{{"%d" % item.features}}
|
||||
</td>
|
||||
<td class="{{ right }}">
|
||||
{{"%d" % item.classes}}
|
||||
</td>
|
||||
<td class="{{ right }}">
|
||||
{{'{:,.2f}'.format(item.nodes)}}
|
||||
</td>
|
||||
<td class="{{ right }}">
|
||||
{{"%.6f±%.4f" % (item.score, item.score_std)}} {{ item.symbol|safe }}
|
||||
</td>
|
||||
<td class="{{ right }}">
|
||||
{{"%.6f±%.4f" % (item.time, item.time_std)}}
|
||||
</td>
|
||||
<td class="{{ center }}">
|
||||
{{item.hyperparameters}}
|
||||
</td>
|
||||
<td>{{ item.dataset }}</td>
|
||||
<td class="{{ right }}">{{ '{:,}'.format(item.samples) }}</td>
|
||||
<td class="{{ right }}">{{"%d" % item.features}}</td>
|
||||
<td class="{{ right }}">{{"%d" % item.classes}}</td>
|
||||
<td class="{{ right }}">{{ '{:,.2f}'.format(item.nodes|float) }}</td>
|
||||
<td class="{{ right }}">{{ '{:,.2f}'.format(item.leaves|float) }}</td>
|
||||
<td class="{{ right }}">{{ '{:,.2f}'.format(item.depth|float) }}</td>
|
||||
<td class="{{ right }}">{{"%.6f±%.4f" % (item.score, item.score_std)}} {{ item.symbol|safe }}</td>
|
||||
<td class="{{ right }}">{{"%.6f±%.4f" % (item.time, item.time_std)}}</td>
|
||||
<td class="{{ center }}">{{ item.hyperparameters }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
@@ -2,7 +2,10 @@
|
||||
<section class="section">
|
||||
<div class="container-fluid">
|
||||
<div class="p-4 bg-primary text-white">
|
||||
<button type="button" class="btn-close" aria-label="Close" onclick="location.href = '{{back}}'"></button>
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
aria-label="Close"
|
||||
onclick="location.href = '{{ back }}'"></button>
|
||||
<h1>{{ data.title }}</h1>
|
||||
</div>
|
||||
<div>
|
||||
@@ -28,8 +31,8 @@
|
||||
<tr>
|
||||
<th class="text-center">{{ data.platform }}</th>
|
||||
<th class="text-center">{{ data.model }} {{ data.version }}</th>
|
||||
<th class="text-center">{{ data.date}}</th>
|
||||
<th class="text-center">{{ data.time}}</th>
|
||||
<th class="text-center">{{ data.date }}</th>
|
||||
<th class="text-center">{{ data.time }}</th>
|
||||
<th class="text-center">{{ "%.2f" % (data.duration/divider) }}</th>
|
||||
<th class="text-center">{{ data.stratified }}</th>
|
||||
<th class="text-center">{{ data.discretized }}</th>
|
||||
@@ -44,17 +47,22 @@
|
||||
</thead>
|
||||
</table>
|
||||
<div>
|
||||
<button class="{{ button }}" onclick="excelFile()"><i class="mdi mdi-file-excel"></i> Excel</button>
|
||||
<button class="{{ button }}" onclick="excelFile()">
|
||||
<i class="mdi mdi-file-excel"></i> Excel
|
||||
</button>
|
||||
</div>
|
||||
<table id="report-table" class="table table-striped table-hover table-bordered">
|
||||
<table id="report-table"
|
||||
class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr class="bg-primary text-white">
|
||||
<th class="text-center">Dataset</th>
|
||||
<th class="text-center">Samples</th>
|
||||
<th class="text-center">Features</th>
|
||||
<th class="text-center">Classes</th>
|
||||
<th class="text-center">Nodes</th>
|
||||
<th class="text-center">{{data.score_name|capitalize}}</th>
|
||||
<th class="text-center">{{ app_config.nodes }}</th>
|
||||
<th class="text-center">{{ app_config.leaves }}</th>
|
||||
<th class="text-center">{{ app_config.depth }}</th>
|
||||
<th class="text-center">{{ data.score_name|capitalize }}</th>
|
||||
<th class="text-center">Time</th>
|
||||
<th class="text-center">hyperparameters</th>
|
||||
</tr>
|
||||
@@ -77,11 +85,18 @@
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
<button type="button" class="btn-close" aria-label="Close" onclick="location.href = '/index/{{ compare }}'"></button>
|
||||
<h7><b>
|
||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }}
|
||||
</b></h7>
|
||||
<h7>Number of files: {{ data.results | length }}</h7>
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
aria-label="Close"
|
||||
onclick="location.href = '/index/{{ compare }}'"></button>
|
||||
<h7>
|
||||
<b>
|
||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score") ) }}
|
||||
</b>
|
||||
</h7>
|
||||
<h7>
|
||||
Number of files: {{ data.results | length }}
|
||||
</h7>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
@@ -34,8 +34,8 @@
|
||||
<tr>
|
||||
<th class="has-text-centered">{{ data.platform }}</th>
|
||||
<th class="has-text-centered">{{ data.model }} {{ data.version }}</th>
|
||||
<th class="has-text-centered">{{ data.date}}</th>
|
||||
<th class="has-text-centered">{{ data.time}}</th>
|
||||
<th class="has-text-centered">{{ data.date }}</th>
|
||||
<th class="has-text-centered">{{ data.time }}</th>
|
||||
<th class="has-text-centered">{{ "%.2f" % (data.duration/divider) }}</th>
|
||||
<th class="has-text-centered">{{ data.stratified }}</th>
|
||||
<th class="has-text-centered">{{ data.discretized }}</th>
|
||||
@@ -50,17 +50,22 @@
|
||||
</thead>
|
||||
</table>
|
||||
<div>
|
||||
<button class="{{ button }}" onclick="excelFile()"><i class="mdi mdi-file-excel"></i> Excel</button>
|
||||
<button class="{{ button }}" onclick="excelFile()">
|
||||
<i class="mdi mdi-file-excel"></i> Excel
|
||||
</button>
|
||||
</div>
|
||||
<table id="report-table" class="table is-fullwidth is-striped is-hoverable is-bordered">
|
||||
<table id="report-table"
|
||||
class="table is-fullwidth is-striped is-hoverable is-bordered">
|
||||
<thead>
|
||||
<tr class="is-selected">
|
||||
<th class="has-text-centered">Dataset</th>
|
||||
<th class="has-text-centered">Samples</th>
|
||||
<th class="has-text-centered">Features</th>
|
||||
<th class="has-text-centered">Classes</th>
|
||||
<th class="has-text-centered">Nodes</th>
|
||||
<th class="has-text-centered">{{data.score_name|capitalize}}</th>
|
||||
<th class="has-text-centered">{{ app_config.nodes }}</th>
|
||||
<th class="has-text-centered">{{ app_config.leaves }}</th>
|
||||
<th class="has-text-centered">{{ app_config.depth }}</th>
|
||||
<th class="has-text-centered">{{ data.score_name|capitalize }}</th>
|
||||
<th class="has-text-centered">Time</th>
|
||||
<th class="has-text-centered">hyperparameters</th>
|
||||
</tr>
|
||||
@@ -83,10 +88,12 @@
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h2 class="has-text-white has-background-primary"><b>
|
||||
<h2 class="has-text-white has-background-primary">
|
||||
<b>
|
||||
<button class="delete" onclick="location.href = '/index/{{ compare }}'"></button>
|
||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }}
|
||||
</b></h2>
|
||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score") ) }}
|
||||
</b>
|
||||
</h2>
|
||||
<h2>Number of files: {{ data.results | length }}</h2>
|
||||
</div>
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user