You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -32,24 +24,24 @@ This notebook will go over some of the details of the `EXGBoost.Plotting` module
32
24
33
25
There are 2 main APIs exposed to control plotting in `EXGBoost`:
34
26
35
-
* Top-level API (`EXGBoost.plot_tree/2`)
27
+
- Top-level API (`EXGBoost.plot_tree/2`)
36
28
37
-
* Using predefined styles
38
-
* Defining custom styles
39
-
* Mix of the first 2
29
+
- Using predefined styles
30
+
- Defining custom styles
31
+
- Mix of the first 2
40
32
41
-
*`EXBoost.Plotting` module API
33
+
-`EXBoost.Plotting` module API
42
34
43
-
* Use the Vega `data` spec defined in `EXGBoost.get_data_spec/2`
44
-
* Define your own Vega spec using the data from either `EXGBoost.Plotting.to_tabular/1` or some other means
35
+
- Use the Vega `data` spec defined in `EXGBoost.Plotting.get_data_spec/2`
36
+
- Define your own Vega spec using the data from either `EXGBoost.Plotting.to_tabular/1` or some other means
45
37
46
38
We will walk through each of these in detail.
47
39
48
40
Regardless of which API you choose to use, it is helpful to understand how the plotting module works (althought the higher-level API you choose to work with the less important it becomes).
49
41
50
42
## Implementation Details
51
43
52
-
The plotting functionality provided in `EXGBoost` is powered by the [Vega](https://vega.github.io/vega/) JavaScript library and the Elixir [`VegaLite`](https://hexdocs.pm/vega_lite/VegaLite.html) library which provides the piping to interop with the JavaScript libraries. **We do not actually much use the Elixir API provided by the Elixir VegaLite library. It is mainly used for the purposes of rendering.**
44
+
The plotting functionality provided in `EXGBoost` is powered by the [Vega](https://vega.github.io/vega/) JavaScript library and the Elixir [`VegaLite`](https://hexdocs.pm/vega_lite/VegaLite.html) library which provides the piping to interop with the JavaScript libraries. **We do not actually much use the Elixir API provided by the Elixir VegaLite library. It is mainly used for the purposes of rendering.**
53
45
54
46
Vega is a plotting library built on top of the very powerful [D3](https://d3js.org/) JavaScript library. Vega visualizations are defined according to the respective JSON Schema specification. Vega-Lite offers a [reduced schema](https://vega.github.io/schema/vega-lite/v5.json) compared to the [full Vega spec](https://vega.github.io/schema/vega/v5.json). `EXGBoost.Plotting` leverages several transforms which are not available in the reduced Vega-Lite schema, which is the reason for targeting the lower-level API.
55
47
@@ -77,7 +69,7 @@ y_test = Nx.tensor(y_test)
77
69
78
70
## Train Your Booster
79
71
80
-
Now go ahead and train your booster. We will use `early_stopping_rounds: 1` because we're not interested in the accuracy of the booster for this demonstration (*Note that we need to set `evals` to use early stopping*).
72
+
Now go ahead and train your booster. We will use `early_stopping_rounds: 1` because we're not interested in the accuracy of the booster for this demonstration (_Note that we need to set `evals` to use early stopping_).
81
73
82
74
You will notice that `EXGBoost` also provides an implementation for `Kino.Render` so that `EXGBoost.Booster`s are rendered as a plot by default.
83
75
@@ -120,20 +112,20 @@ This API uses [Vega `Mark`s](https://vega.github.io/vega/docs/marks/) to describ
120
112
121
113
The plot is composed of the following parts:
122
114
123
-
* Top-level keys: Options controlling parts of the plot outside of direct control of a `Mark`, such as `:padding`, `:autosize`, etc. Accepts any Vega top-level [top-level key](https://vega.github.io/vega/docs/specification/) in addition to several specific to this API (scuh as `:style` and `:depth`).
124
-
*`:leaves`: `Mark` specifying the leaf nodes of the tree
- Top-level keys: Options controlling parts of the plot outside of direct control of a `Mark`, such as `:padding`, `:autosize`, etc. Accepts any Vega top-level [top-level key](https://vega.github.io/vega/docs/specification/) in addition to several specific to this API (scuh as `:style` and `:depth`).
116
+
-`:leaves`: `Mark` specifying the leaf nodes of the tree
0 commit comments