Skip to content

Commit

Permalink
deploy: ecceee5
Browse files Browse the repository at this point in the history
  • Loading branch information
reidjohnson committed Aug 16, 2024
1 parent 860b529 commit deafa73
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 15 deletions.
46 changes: 40 additions & 6 deletions _sources/gallery/plot_predict_custom.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,19 @@ this scenario, we compute the empirical cumulative distribution function

# Slider for determining the sample index for which the custom function is being visualized.
slider = alt.binding_range(min=min_idx, max=max_idx, step=1, name="Test Sample Index: ")
index_selection = alt.selection_point(value=0, bind=slider, fields=["index"])
index_selection = alt.selection_point(
value=0,
bind=slider,
empty=False,
fields=["index"],
on="click",
nearest=True,
)

color = alt.condition(index_selection, alt.value("#006aff"), alt.value("lightgray"))
opacity = alt.condition(index_selection, alt.value(1), alt.value(0.2))
tooltip = [
alt.Tooltip("index:Q", title="Sample Index"),
alt.Tooltip("y_val:Q", title="Response Value"),
alt.Tooltip("proba:Q", title="Probability"),
]
Expand All @@ -132,6 +142,8 @@ this scenario, we compute the empirical cumulative distribution function
.encode(
x=alt.X("y_val:Q", title="Response Value"),
y=alt.Y("proba:Q", title="Probability"),
color=color,
opacity=opacity,
tooltip=tooltip,
)
)
Expand All @@ -143,14 +155,19 @@ this scenario, we compute the empirical cumulative distribution function
x=alt.X("y_val:Q", title="Response Value"),
x2=alt.X2("y_val2:Q"),
y=alt.Y("proba:Q", title="Probability"),
color=color,
opacity=opacity,
tooltip=tooltip,
)
)

# Ensure the selected sample index values overlay the unselected values.
chart_base = circles + lines
chart_selected = (circles + lines).transform_filter(index_selection)

chart = (
(circles + lines)
(chart_base + chart_selected)
.add_params(index_selection)
.transform_filter(index_selection)
.properties(
title="Empirical Cumulative Distribution Function (ECDF) Plot",
height=400,
Expand Down Expand Up @@ -263,9 +280,19 @@ this scenario, we compute the empirical cumulative distribution function
# Slider for determining the sample index for which the custom function is being visualized.
slider = alt.binding_range(min=min_idx, max=max_idx, step=1, name="Test Sample Index: ")
index_selection = alt.selection_point(value=0, bind=slider, fields=["index"])
index_selection = alt.selection_point(
value=0,
bind=slider,
empty=False,
fields=["index"],
on="click",
nearest=True,
)
color = alt.condition(index_selection, alt.value("#006aff"), alt.value("lightgray"))
opacity = alt.condition(index_selection, alt.value(1), alt.value(0.2))
tooltip = [
alt.Tooltip("index:Q", title="Sample Index"),
alt.Tooltip("y_val:Q", title="Response Value"),
alt.Tooltip("proba:Q", title="Probability"),
]
Expand All @@ -276,6 +303,8 @@ this scenario, we compute the empirical cumulative distribution function
.encode(
x=alt.X("y_val:Q", title="Response Value"),
y=alt.Y("proba:Q", title="Probability"),
color=color,
opacity=opacity,
tooltip=tooltip,
)
)
Expand All @@ -287,14 +316,19 @@ this scenario, we compute the empirical cumulative distribution function
x=alt.X("y_val:Q", title="Response Value"),
x2=alt.X2("y_val2:Q"),
y=alt.Y("proba:Q", title="Probability"),
color=color,
opacity=opacity,
tooltip=tooltip,
)
)
# Ensure the selected sample index values overlay the unselected values.
chart_base = circles + lines
chart_selected = (circles + lines).transform_filter(index_selection)
chart = (
(circles + lines)
(chart_base + chart_selected)
.add_params(index_selection)
.transform_filter(index_selection)
.properties(
title="Empirical Cumulative Distribution Function (ECDF) Plot",
height=400,
Expand Down
4 changes: 2 additions & 2 deletions _sources/gallery/plot_quantile_multioutput.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ for each target: the median line and the area defined by the interval points.
.add_params(interval_val, click)
.configure_range(category=alt.RangeScheme(list(legend.values())))
.properties(
title="Multi-target Predictions and Prediction Intervals on Toy Dataset",
height=400,
width=650,
title="Multi-target Predictions and Prediction Intervals on Toy Dataset",
)
)

Expand Down Expand Up @@ -315,9 +315,9 @@ for each target: the median line and the area defined by the interval points.
.add_params(interval_val, click)
.configure_range(category=alt.RangeScheme(list(legend.values())))
.properties(
title="Multi-target Predictions and Prediction Intervals on Toy Dataset",
height=400,
width=650,
title="Multi-target Predictions and Prediction Intervals on Toy Dataset",
)
)
Expand Down
2 changes: 2 additions & 0 deletions _sources/gallery/plot_treeshap_example.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ how the SHAP explanations vary with different quantile choices.
X = X.iloc[perm]
y = y.iloc[perm]
y *= 100_000 # convert to dollars
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1, random_state=random_state)

qrf = RandomForestQuantileRegressor(random_state=random_state)
Expand Down Expand Up @@ -410,6 +411,7 @@ how the SHAP explanations vary with different quantile choices.
X = X.iloc[perm]
y = y.iloc[perm]
y *= 100_000 # convert to dollars
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.1, random_state=random_state)
qrf = RandomForestQuantileRegressor(random_state=random_state)
Expand Down
2 changes: 1 addition & 1 deletion _static/_image_hashes.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"plot_quantile_interpolation.png": "e490d90e837fe8ab6cd368dc5af69c39", "plot_predict_custom.png": "337ddedec1648e46bc1a1831d7d4e07c", "plot_quantile_extrapolation.png": "79982e108d80c6b9a29dffb7fb761fa2", "plot_quantile_multioutput.png": "814b6b00bfe0ee6f39c91fe1c5da3dc8", "plot_quantile_example.png": "37b7aa1346e4418c4e23f424a891dd1f", "plot_quantile_conformalized.png": "b0a13f4c4f5c4357e037f0bb87809124", "plot_quantile_intervals.png": "0c2ccc83500678ca048240bc1eaed3c9", "plot_quantile_vs_standard.png": "7d705af48c41c27e7e8b712d3404c80b", "plot_treeshap_example.png": "3c6268285ebf715aeba9c21e4d4161c1", "plot_proximity_counts.png": "506fe1fe5d9cab22dde4d26df44d4dca", "plot_quantile_ranks.png": "9148bdf85c4e3e27c9f8dd295c0bf49d", "plot_huggingface_model.png": "5e60b72cd961ba7a3909203bb3a28083"}
{"plot_quantile_interpolation.png": "e490d90e837fe8ab6cd368dc5af69c39", "plot_predict_custom.png": "60ec2b76ada2addd7e96a742f02c5464", "plot_quantile_extrapolation.png": "79982e108d80c6b9a29dffb7fb761fa2", "plot_quantile_multioutput.png": "9281997371c80f5ae412c0cc8d71842b", "plot_quantile_example.png": "37b7aa1346e4418c4e23f424a891dd1f", "plot_quantile_conformalized.png": "b0a13f4c4f5c4357e037f0bb87809124", "plot_quantile_intervals.png": "0c2ccc83500678ca048240bc1eaed3c9", "plot_quantile_vs_standard.png": "7d705af48c41c27e7e8b712d3404c80b", "plot_treeshap_example.png": "370a91ac8caaa9d64cef36f0d226e577", "plot_proximity_counts.png": "506fe1fe5d9cab22dde4d26df44d4dca", "plot_quantile_ranks.png": "9148bdf85c4e3e27c9f8dd295c0bf49d", "plot_huggingface_model.png": "5e60b72cd961ba7a3909203bb3a28083"}
Binary file modified _static/plot_predict_custom-thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/plot_predict_custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 21 additions & 4 deletions gallery/plot_predict_custom.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gallery/plot_quantile_multioutput.html
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@
<span class="o">.</span><span class="n">add_params</span><span class="p">(</span><span class="n">interval_val</span><span class="p">,</span> <span class="n">click</span><span class="p">)</span>
<span class="o">.</span><span class="n">configure_range</span><span class="p">(</span><span class="n">category</span><span class="o">=</span><span class="n">alt</span><span class="o">.</span><span class="n">RangeScheme</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">legend</span><span class="o">.</span><span class="n">values</span><span class="p">())))</span>
<span class="o">.</span><span class="n">properties</span><span class="p">(</span>
<span class="n">title</span><span class="o">=</span><span class="s2">&quot;Multi-target Predictions and Prediction Intervals on Toy Dataset&quot;</span><span class="p">,</span>
<span class="n">height</span><span class="o">=</span><span class="mi">400</span><span class="p">,</span>
<span class="n">width</span><span class="o">=</span><span class="mi">650</span><span class="p">,</span>
<span class="n">title</span><span class="o">=</span><span class="s2">&quot;Multi-target Predictions and Prediction Intervals on Toy Dataset&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="p">)</span>

Expand Down
1 change: 1 addition & 0 deletions gallery/plot_treeshap_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@
<span class="n">X</span> <span class="o">=</span> <span class="n">X</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="n">perm</span><span class="p">]</span>
<span class="n">y</span> <span class="o">=</span> <span class="n">y</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="n">perm</span><span class="p">]</span>
<span class="n">y</span> <span class="o">*=</span> <span class="mi">100_000</span> <span class="c1"># convert to dollars</span>

<span class="n">X_train</span><span class="p">,</span> <span class="n">X_test</span><span class="p">,</span> <span class="n">y_train</span><span class="p">,</span> <span class="n">y_test</span> <span class="o">=</span> <span class="n">train_test_split</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">test_size</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="n">random_state</span><span class="p">)</span>

<span class="n">qrf</span> <span class="o">=</span> <span class="n">RandomForestQuantileRegressor</span><span class="p">(</span><span class="n">random_state</span><span class="o">=</span><span class="n">random_state</span><span class="p">)</span>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit deafa73

Please sign in to comment.