Skip to content

Commit

Permalink
fix metrics tables regression/classification dotted divider line
Browse files Browse the repository at this point in the history
and make it dynamic based on MAE col idx ti prevent future errors
  • Loading branch information
janosh committed Aug 16, 2023
1 parent 62b701c commit b4e9da3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions scripts/model_figs/make_metrics_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@
styler.set_uuid("")

# export model metrics as styled HTML table and Svelte component
# draw dotted line between classification and regression metrics
# get index of MAE column
mae_col_idx = styler.columns.get_loc("MAE")
css_col_selector = f"#T_ :is(td, th):nth-child({mae_col_idx + 2})"
df_to_svelte_table(
styler,
f"{SITE_FIGS}/metrics-table{label}.svelte",
inline_props="class='roomy'",
styles="#T_ :is(td, th):nth-last-child(4) { border-left: 1px dotted white; }",
# draw dotted line between classification and regression metrics
styles=f"{css_col_selector} {{ border-left: 1px dotted white; }}",
)
try:
df_to_pdf(styler, f"{PDF_FIGS}/metrics-table{label}.pdf")
Expand Down
2 changes: 1 addition & 1 deletion site/src/figs/metrics-table-first-10k.svelte

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site/src/figs/metrics-table.svelte

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b4e9da3

Please sign in to comment.