Skip to content

Commit

Permalink
Rename dvctablehorizontals to dvctable and use across site (#3173)
Browse files Browse the repository at this point in the history
* rename dvctablehorizontals to dvctable, removing old dvctable style
* add missing dvctable styles to blog css
* use new dvctable style on all md dvctable instances
  • Loading branch information
julieg18 authored and iesahin committed Apr 11, 2022
1 parent 210edb2 commit 97c03c2
Show file tree
Hide file tree
Showing 15 changed files with 451 additions and 470 deletions.
36 changes: 1 addition & 35 deletions config/prismjs/dvctable.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* eslint-env node */
const Prism = require('prismjs')

const getTableCellBgColorRegex = color =>
new RegExp(String.raw`(?<=[│┃])\s+${color}:(?:(?![│┃]).)+(?=[│┃])`)

const getTableTextBgColorRegex = color => new RegExp(String.raw`${color}:\S+`)

const boldAndItalicConfig = {
Expand All @@ -22,39 +19,8 @@ const boldAndItalicConfig = {
}

Prism.languages.dvctable = {
'bg-white': {
pattern: getTableCellBgColorRegex('(white|neutral)'),
inside: {
hide: {
pattern: /(white|neutral):/
},
...boldAndItalicConfig
}
},
'bg-yellow': {
pattern: getTableCellBgColorRegex('(yellow|metric)'),
inside: {
hide: {
pattern: /(yellow|metric):/
},
...boldAndItalicConfig
}
},
'bg-blue': {
pattern: getTableCellBgColorRegex('(blue|param)'),
inside: {
hide: {
pattern: /(blue|param):/
},
...boldAndItalicConfig
}
},
...boldAndItalicConfig
}

Prism.languages.dvctablehorizontals = {
rows: {
pattern: /((?<=^|\n)\s[^─][\s\S]*?(:?\n|$))+/,
pattern: /((?<=^|\n)[^─]{2}[\s\S]*?(:?\n|$))+/,
inside: {
'bg-white': {
pattern: getTableTextBgColorRegex('(white|neutral)'),
Expand Down
82 changes: 41 additions & 41 deletions content/blog/2021-07-19-hyperparam-tuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ run `dvc exp show` without the options to see the entire table._
This will produce a table similar to this.

```dvctable
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ neutral:**Experiment** ┃ metric:**avg_prec** ┃ metric:**roc_auc** ┃ param:**train.min_split** ┃ param:**train.n_est** ┃
┑━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
β”‚ **workspace** β”‚ **0.51682** β”‚ **0.93819** β”‚ **175** β”‚ **64** β”‚
β”‚ **master** β”‚ **0.56447** β”‚ **0.94713** β”‚ **100** β”‚ **64** β”‚
β”‚ └── a1e8716 [exp-09074] β”‚ 0.57333 β”‚ 0.94801 β”‚ 100 β”‚ 32 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
──────────────────────────────────────────────────────────────────────────────
neutral:**Experiment** metric:**avg_prec** metric:**roc_auc** param:**train.min_split** param:**train.n_est**
──────────────────────────────────────────────────────────────────────────────
**workspace** **0.51682** **0.93819** **175** **64**
**master** **0.56447** **0.94713** **100** **64**
└── a1e8716 [exp-09074] 0.57333 0.94801 100 32
──────────────────────────────────────────────────────────────────────────────
```

### Start tuning with grid search
Expand Down Expand Up @@ -196,25 +196,25 @@ included the `--include-params` and `--no-timestamp` options to give us a table
that's easier to read.

```dvctable
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ neutral:**Experiment** ┃ metric:**avg_prec** ┃ metric:**roc_auc** ┃ param:**train.min_split** ┃ param:**train.n_est** ┃
┑━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
β”‚ **workspace** β”‚ **0.67038** β”‚ **0.96693** β”‚ **64** β”‚ **100** β”‚
β”‚ **try-large-dataset** β”‚ **0.67038** β”‚ **0.96693** β”‚ **64** β”‚ **100** β”‚
β”‚ β”œβ”€β”€ 4899d41 [exp-ae5ed] β”‚ 0.6888 β”‚ 0.97028 β”‚ 8 β”‚ 250 β”‚
β”‚ β”œβ”€β”€ bcdd8ed [exp-56613] β”‚ 0.68733 β”‚ 0.96773 β”‚ 16 β”‚ 250 β”‚
β”‚ β”œβ”€β”€ 703f20b [exp-caa84] β”‚ 0.68942 β”‚ 0.9698 β”‚ 32 β”‚ 250 β”‚
β”‚ β”œβ”€β”€ 1a882e6 [exp-c208f] β”‚ 0.681 β”‚ 0.96772 β”‚ 64 β”‚ 250 β”‚
β”‚ β”œβ”€β”€ 3ac33fb [exp-4c53e] β”‚ 0.67775 β”‚ 0.96664 β”‚ 128 β”‚ 250 β”‚
β”‚ β”œβ”€β”€ ea90ee0 [exp-fdb47] β”‚ 0.65382 β”‚ 0.96719 β”‚ 256 β”‚ 250 β”‚
β”‚ β”œβ”€β”€ b8277b1 [exp-3fb5c] β”‚ 0.68547 β”‚ 0.97011 β”‚ 8 β”‚ 300 β”‚
β”‚ β”œβ”€β”€ 7be641e [exp-3bbbc] β”‚ 0.6883 β”‚ 0.96724 β”‚ 16 β”‚ 300 β”‚
β”‚ β”œβ”€β”€ 4202757 [exp-38ca4] β”‚ 0.68808 β”‚ 0.96968 β”‚ 32 β”‚ 300 β”‚
β”‚ β”œβ”€β”€ b71ee2f [exp-5384b] β”‚ 0.68111 β”‚ 0.96848 β”‚ 64 β”‚ 300 β”‚
β”‚ β”œβ”€β”€ 1bbb0f4 [exp-f5d54] β”‚ 0.67707 β”‚ 0.96753 β”‚ 128 β”‚ 300 β”‚
β”‚ β”œβ”€β”€ 71ba159 [exp-31749] β”‚ 0.65282 β”‚ 0.96752 β”‚ 256 β”‚ 300 β”‚
β”‚ β”œβ”€β”€ 836c1c5 [exp-2ce0a] β”‚ 0.68758 β”‚ 0.96998 β”‚ 8 β”‚ 350 β”‚
β”‚ β”œβ”€β”€ dac9e22 [exp-5c799] β”‚ 0.68778 β”‚ 0.96779 β”‚ 16 β”‚ 350 β”‚
──────────────────────────────────────────────────────────────────────────────
neutral:**Experiment** metric:**avg_prec** metric:**roc_auc** param:**train.min_split** param:**train.n_est**
──────────────────────────────────────────────────────────────────────────────
**workspace** **0.67038** **0.96693** **64** **100**
**try-large-dataset** **0.67038** **0.96693** **64** **100**
β”œβ”€β”€ 4899d41 [exp-ae5ed] 0.6888 0.97028 8 250
β”œβ”€β”€ bcdd8ed [exp-56613] 0.68733 0.96773 16 250
β”œβ”€β”€ 703f20b [exp-caa84] 0.68942 0.9698 32 250
β”œβ”€β”€ 1a882e6 [exp-c208f] 0.681 0.96772 64 250
β”œβ”€β”€ 3ac33fb [exp-4c53e] 0.67775 0.96664 128 250
β”œβ”€β”€ ea90ee0 [exp-fdb47] 0.65382 0.96719 256 250
β”œβ”€β”€ b8277b1 [exp-3fb5c] 0.68547 0.97011 8 300
β”œβ”€β”€ 7be641e [exp-3bbbc] 0.6883 0.96724 16 300
β”œβ”€β”€ 4202757 [exp-38ca4] 0.68808 0.96968 32 300
β”œβ”€β”€ b71ee2f [exp-5384b] 0.68111 0.96848 64 300
β”œβ”€β”€ 1bbb0f4 [exp-f5d54] 0.67707 0.96753 128 300
β”œβ”€β”€ 71ba159 [exp-31749] 0.65282 0.96752 256 300
β”œβ”€β”€ 836c1c5 [exp-2ce0a] 0.68758 0.96998 8 350
β”œβ”€β”€ dac9e22 [exp-5c799] 0.68778 0.96779 16 350
```

Now you can see how your precision changed with each hyperparameter value
Expand Down Expand Up @@ -265,21 +265,21 @@ look at the results with
table should look something like this.

```dvctable
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ neutral:**Experiment** ┃ metric:**avg_prec** ┃ metric:**roc_auc** ┃ param:**train.min_split** ┃ param:**train.n_est** ┃
┑━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
β”‚ **workspace** β”‚ **0.67038** β”‚ **0.96693** β”‚ **64** β”‚ **100** β”‚
β”‚ **try-large-dataset** β”‚ **0.67038** β”‚ **0.96693** β”‚ **64** β”‚ **100** β”‚
β”‚ β”œβ”€β”€ fc28c0c [exp-45902] β”‚ 0.68358 β”‚ 0.96956 β”‚ 64 β”‚ 466 β”‚
β”‚ β”œβ”€β”€ f13ac72 [exp-b9dfa] β”‚ 0.68275 β”‚ 0.96914 β”‚ 64 β”‚ 444 β”‚
β”‚ β”œβ”€β”€ a8cbc8f [exp-b0aeb] β”‚ 0.68989 β”‚ 0.97003 β”‚ 32 β”‚ 260 β”‚
β”‚ β”œβ”€β”€ 4791c52 [exp-5f2b5] β”‚ 0.67711 β”‚ 0.96809 β”‚ 128 β”‚ 497 β”‚
β”‚ β”œβ”€β”€ c5398e0 [exp-86c74] β”‚ 0.6811 β”‚ 0.96829 β”‚ 64 β”‚ 374 β”‚
β”‚ β”œβ”€β”€ db16c91 [exp-db50f] β”‚ 0.68986 β”‚ 0.97073 β”‚ 32 β”‚ 485 β”‚
β”‚ β”œβ”€β”€ 2dd08fa [exp-fee4f] β”‚ 0.68262 β”‚ 0.96941 β”‚ 64 β”‚ 497 β”‚
β”‚ β”œβ”€β”€ 18d2ec5 [exp-d73c7] β”‚ 0.67696 β”‚ 0.96726 β”‚ 128 β”‚ 341 β”‚
β”‚ β”œβ”€β”€ 1710032 [exp-dd198] β”‚ 0.68756 β”‚ 0.9687 β”‚ 16 β”‚ 478 β”‚
β”‚ β”œβ”€β”€ 4f0b80a [exp-746c1] β”‚ 0.68724 β”‚ 0.96811 β”‚ 16 β”‚ 379 β”‚
──────────────────────────────────────────────────────────────────────────────
neutral:**Experiment** metric:**avg_prec** metric:**roc_auc** param:**train.min_split** param:**train.n_est**
──────────────────────────────────────────────────────────────────────────────
**workspace** **0.67038** **0.96693** **64** **100**
**try-large-dataset** **0.67038** **0.96693** **64** **100**
β”œβ”€β”€ fc28c0c [exp-45902] 0.68358 0.96956 64 466
β”œβ”€β”€ f13ac72 [exp-b9dfa] 0.68275 0.96914 64 444
β”œβ”€β”€ a8cbc8f [exp-b0aeb] 0.68989 0.97003 32 260
β”œβ”€β”€ 4791c52 [exp-5f2b5] 0.67711 0.96809 128 497
β”œβ”€β”€ c5398e0 [exp-86c74] 0.6811 0.96829 64 374
β”œβ”€β”€ db16c91 [exp-db50f] 0.68986 0.97073 32 485
β”œβ”€β”€ 2dd08fa [exp-fee4f] 0.68262 0.96941 64 497
β”œβ”€β”€ 18d2ec5 [exp-d73c7] 0.67696 0.96726 128 341
β”œβ”€β”€ 1710032 [exp-dd198] 0.68756 0.9687 16 478
β”œβ”€β”€ 4f0b80a [exp-746c1] 0.68724 0.96811 16 379
```

This shows the difference in the randomly selected values and the values from
Expand Down
Loading

0 comments on commit 97c03c2

Please sign in to comment.