File size: 1,354 Bytes
c19aed5
 
 
 
 
 
 
 
 
 
 
 
 
8396dce
c19aed5
 
 
 
 
 
8396dce
c19aed5
8396dce
c19aed5
 
 
 
8396dce
c19aed5
 
 
 
 
8396dce
c19aed5
 
 
 
 
8396dce
c19aed5
 
 
 
 
 
 
 
 
 
3a1f221
c19aed5
 
 
 
 
 
 
 
 
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

import pandas as pd
import streamlit as st

from mlip_arena import PKG_DIR

DATA_DIR = PKG_DIR / "tasks" / "thermal-conductivity"

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

table.rename(
    columns={
        "method": "Model",
        "srme": "SRME[𝜅]",
    },
    inplace=True,
)

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

table.sort_values(["SRME[𝜅]"], ascending=True, inplace=True)

table["Rank"] = table["SRME[𝜅]"].rank(method='min').astype(int)

table = table.reindex(
    columns=[
        "Rank",
        "SRME[𝜅]",
    ]
)

s = (
    table.style.background_gradient(
        cmap="Reds", subset=["SRME[𝜅]"]
    )
    .background_gradient(
        cmap="Blues",
        subset=["Rank"],
    )
    .format("{:.3f}", subset=["SRME[𝜅]"])
)


def render():

    st.dataframe(
        s,
        use_container_width=True
    )

    with st.expander("Explanation", icon=":material/info:"):
        st.caption(
            """
            - **SRME**: symmetric relative mean error of single-phonon conductivity:

            $$
            \\text{SRME}[\\left\lbrace\\mathcal{K}({\\mathbf{q},s)}\\right\\rbrace] = \\frac{2}{N_qV}\\frac{\\sum_{\\mathbf{q}s}|\\mathcal{K}_{\\text{MLIP}}(\\mathbf{q},s) - \\mathcal{K}_{\\text{DFT}}(\\mathbf{q},s)|}{\\kappa_{\\text{MLIP}} + \\kappa_{\\text{DFT}}}
            $$
            """
        )