File size: 1,546 Bytes
75ac94f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from pathlib import Path

import pandas as pd
import streamlit as st

DATA_DIR = Path("examples/wbm_ev")


table = pd.read_csv(DATA_DIR / "summary.csv")



table = table.rename(
    columns={
        "model": "Model",
        "rank": "Rank",
        "rank-aggregation": "Rank aggr.",
        "energy-diff-flip-times": "Derivative flips",
        "tortuosity": "Tortuosity",
        "spearman-compression-energy": "Spearman's coeff. (compression)",
        "spearman-tension-energy": "Spearman's coeff. (tension)",
        "spearman-compression-derivative": "Spearman's coeff. (compression derivative)",
        "missing": "Missing",
    },
)

table.set_index("Model", inplace=True)

s = (
    table.style.background_gradient(
        cmap="Blues",
        subset=["Rank", "Rank aggr."],
    ).background_gradient(
        cmap="Reds",
        subset=[
            "Spearman's coeff. (compression)",
        ],
    ).background_gradient(
        cmap="Reds_r",
        subset=[
            "Spearman's coeff. (tension)",
            "Spearman's coeff. (compression derivative)",
        ],
    ).background_gradient(
        cmap="RdPu",
        subset=["Tortuosity", "Derivative flips"],
    ).format(
        "{:.5f}",
        subset=[
            "Spearman's coeff. (compression)",
            "Spearman's coeff. (tension)",
            "Spearman's coeff. (compression derivative)",
            "Tortuosity",
            "Derivative flips",
        ],
    )
)

def render():
    st.dataframe(
        s,
        use_container_width=True,
    )