10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 13:53:48 +01:00

Improve statistics table

This commit is contained in:
Mickaël Véril 2020-02-20 14:42:40 +01:00
parent c5208d13b5
commit 0714161047

View File

@ -268,28 +268,24 @@ draft: false
key.shift() key.shift()
Reflect.setPrototypeOf(key[0], method.prototype) Reflect.setPrototypeOf(key[0], method.prototype)
//Reflect.setPrototypeOf(key[1], DOI.prototype) //Reflect.setPrototypeOf(key[1], DOI.prototype)
for (const [i, el] of key.entries()) { th = $("<th/>", { scope: "column" })
var td = $("<th/>",{scope:"column"}) const [meth, doi] = key
if (i === 1) { th.clone().text(meth.toString("\n").split('-').join('\u2011')).appendTo(row)
var publi = doiCache.get(el, true) var thdoi = th.clone()
var publi = doiCache.get(doi, true)
const sets = await getSets() const sets = await getSets()
if (sets.has(el)) { if (sets.has(doi)) {
var str = sets.get(el) var str = sets.get(doi)
$(td).append(str+ " ") $(thdoi).append(str + " ")
} }
$("<a/>", { $("<a/>", {
href: new DOI(el).url, href: new DOI(doi).url,
target: "_blank" target: "_blank"
}).html(publi.format('citation', { }).html(publi.format('citation', {
format: 'html', format: 'html',
lang: 'en-US' lang: 'en-US'
})).appendTo(td) })).appendTo(thdoi)
} $(row).append(thdoi)
else {
$(td).text(el)
}
$(row).append(td)
}
const noNanVals = (vals.every((v) => Number.isNaN(v))) ? vals : (vals.filter((v) => !Number.isNaN(v))) const noNanVals = (vals.every((v) => Number.isNaN(v))) ? vals : (vals.filter((v) => !Number.isNaN(v)))
const avals = noNanVals.map(v => Math.abs(v)) const avals = noNanVals.map(v => Math.abs(v))
for (const val of [ss.min(noNanVals), ss.max(noNanVals), ss.mean(noNanVals), ss.mean(avals), ss.median(noNanVals), ss.median(avals), ss.rootMeanSquare(noNanVals), ss.variance(noNanVals), ss.standardDeviation(noNanVals)]) { for (const val of [ss.min(noNanVals), ss.max(noNanVals), ss.mean(noNanVals), ss.mean(avals), ss.median(noNanVals), ss.median(avals), ss.rootMeanSquare(noNanVals), ss.variance(noNanVals), ss.standardDeviation(noNanVals)]) {
@ -587,17 +583,17 @@ draft: false
<section> <section>
<table id="stat_table" class="datatable"> <table id="stat_table" class="datatable">
<thead class="sticky"> <thead class="sticky">
<th>Method</th> <th scope="col">Method</th>
<th>Set</th> <th scope="col">Set</th>
<th>Min</th> <th scope="col">Min</th>
<th>Max</th> <th scope="col">Max</th>
<th>Mean</th> <th scope="col">MSE</th>
<th>Absolute Mean</th> <th scope="col">MAE</th>
<th>Median</th> <th scope="col">Median</th>
<th>Absolute Median</th> <th scope="col">Absolute Median</th>
<th>RMS</th> <th scope="col">RMS</th>
<th>Variance</th> <th scope="col">Variance</th>
<th>Standard deviation</th> <th scope="col">Standard deviation</th>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>