Skip to content

Commit

Permalink
deploy: cb90e76
Browse files Browse the repository at this point in the history
  • Loading branch information
reidjohnson committed Aug 30, 2024
1 parent 778350e commit ef9dd85
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions _sources/gallery/plot_quantile_extrapolation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ adapted from `"Extrapolation-Aware Nonparametric Statistical Inference"
qrf_params = {"min_samples_leaf": 4, "max_samples_leaf": None, "random_state": random_state}


def make_func_Xy(func, bounds, n_samples, add_noise=True, random_state=0):
def make_func_Xy(func, n_samples, bounds, add_noise=True, random_state=0):
"""Make a dataset from a specified function."""
random_state = check_random_state(random_state)

Expand Down Expand Up @@ -159,7 +159,7 @@ adapted from `"Extrapolation-Aware Nonparametric Statistical Inference"
tree.fit(X[split1, :], Y[split1].flatten())

# Extract tree weight matrix.
y_train_leaves = tree._get_y_train_leaves(X[split2, :], Y)
y_train_leaves = tree._get_y_train_leaves(X[split2, :], Y.reshape(-1, 1))
nrows = X[split2, :].shape[0]
matrix = np.zeros((nrows, nrows))
for leaf in y_train_leaves[0]:
Expand Down Expand Up @@ -381,7 +381,7 @@ adapted from `"Extrapolation-Aware Nonparametric Statistical Inference"

# Create a dataset that requires extrapolation.
X, y = make_func_Xy(func, bounds, n_samples, add_noise=True, random_state=0)
X, y = make_func_Xy(func, n_samples, bounds, add_noise=True, random_state=0)

# Fit and extrapolate based on train-test split (depending on X).
extrap_min_idx = int(n_samples * (extrap_frac / 2))
Expand Down Expand Up @@ -603,7 +603,7 @@ adapted from `"Extrapolation-Aware Nonparametric Statistical Inference"
qrf_params = {"min_samples_leaf": 4, "max_samples_leaf": None, "random_state": random_state}
def make_func_Xy(func, bounds, n_samples, add_noise=True, random_state=0):
def make_func_Xy(func, n_samples, bounds, add_noise=True, random_state=0):
"""Make a dataset from a specified function."""
random_state = check_random_state(random_state)
Expand Down Expand Up @@ -716,7 +716,7 @@ adapted from `"Extrapolation-Aware Nonparametric Statistical Inference"
tree.fit(X[split1, :], Y[split1].flatten())
# Extract tree weight matrix.
y_train_leaves = tree._get_y_train_leaves(X[split2, :], Y)
y_train_leaves = tree._get_y_train_leaves(X[split2, :], Y.reshape(-1, 1))
nrows = X[split2, :].shape[0]
matrix = np.zeros((nrows, nrows))
for leaf in y_train_leaves[0]:
Expand Down Expand Up @@ -938,7 +938,7 @@ adapted from `"Extrapolation-Aware Nonparametric Statistical Inference"
# Create a dataset that requires extrapolation.
X, y = make_func_Xy(func, bounds, n_samples, add_noise=True, random_state=0)
X, y = make_func_Xy(func, n_samples, bounds, add_noise=True, random_state=0)
# Fit and extrapolate based on train-test split (depending on X).
extrap_min_idx = int(n_samples * (extrap_frac / 2))
Expand Down
12 changes: 6 additions & 6 deletions _sources/gallery/plot_quantile_multioutput.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ for each target: the median line and the area defined by the interval points.
legend = {k: v for f in funcs for k, v in f["legend"].items()}


def make_func_Xy(funcs, bounds, n_samples):
"""Make a dataset from specified function(s)."""
def make_funcs_Xy(funcs, bounds, n_samples):
"""Make a dataset from specified function(s) with signal and noise."""
x = np.linspace(*bounds, n_samples)
y = np.empty((len(x), len(funcs)))
for i, func in enumerate(funcs):
Expand All @@ -62,7 +62,7 @@ for each target: the median line and the area defined by the interval points.

# Create a dataset with multiple target variables.
X, y = make_func_Xy(funcs, bounds, n_samples)
X, y = make_funcs_Xy(funcs, bounds, n_samples)

X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=random_state)

Expand Down Expand Up @@ -202,8 +202,8 @@ for each target: the median line and the area defined by the interval points.
legend = {k: v for f in funcs for k, v in f["legend"].items()}
def make_func_Xy(funcs, bounds, n_samples):
"""Make a dataset from specified function(s)."""
def make_funcs_Xy(funcs, bounds, n_samples):
"""Make a dataset from specified function(s) with signal and noise."""
x = np.linspace(*bounds, n_samples)
y = np.empty((len(x), len(funcs)))
for i, func in enumerate(funcs):
Expand All @@ -212,7 +212,7 @@ for each target: the median line and the area defined by the interval points.
# Create a dataset with multiple target variables.
X, y = make_func_Xy(funcs, bounds, n_samples)
X, y = make_funcs_Xy(funcs, bounds, n_samples)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=random_state)
Expand Down
8 changes: 4 additions & 4 deletions _sources/gallery/plot_quantile_vs_standard.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ distributions.
quantiles = np.linspace(0, 1, num=101, endpoint=True).round(2).tolist()


def make_skewed_dataset(a=7, loc=-1, scale=1, random_state=0):
def make_skewed_dataset(n_samples, a=7, loc=-1, scale=1, random_state=0):
"""Make a skewed dataset."""
random_state = check_random_state(random_state)
skewnorm_rv = sp.stats.skewnorm(a, loc, scale)
Expand All @@ -50,7 +50,7 @@ distributions.


# Create a right-skewed toy dataset.
X, y = make_skewed_dataset(a=7, loc=-1, scale=1, random_state=0)
X, y = make_skewed_dataset(n_samples, a=7, loc=-1, scale=1, random_state=0)

regr_rf = RandomForestRegressor(random_state=random_state)
regr_qrf = RandomForestQuantileRegressor(random_state=random_state)
Expand Down Expand Up @@ -156,7 +156,7 @@ distributions.
quantiles = np.linspace(0, 1, num=101, endpoint=True).round(2).tolist()
def make_skewed_dataset(a=7, loc=-1, scale=1, random_state=0):
def make_skewed_dataset(n_samples, a=7, loc=-1, scale=1, random_state=0):
"""Make a skewed dataset."""
random_state = check_random_state(random_state)
skewnorm_rv = sp.stats.skewnorm(a, loc, scale)
Expand All @@ -167,7 +167,7 @@ distributions.
# Create a right-skewed toy dataset.
X, y = make_skewed_dataset(a=7, loc=-1, scale=1, random_state=0)
X, y = make_skewed_dataset(n_samples, a=7, loc=-1, scale=1, random_state=0)
regr_rf = RandomForestRegressor(random_state=random_state)
regr_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": "64403bde568aefd4126ce9afd13bdf18", "plot_predict_custom.png": "d93bb87e4412de61511ec04e7cfc57cc", "plot_quantile_extrapolation.png": "df5cd201a56427aecdd2b0fb67383b1e", "plot_quantile_multioutput.png": "a7db7a29994b823fbd5a7a3ea89e31b2", "plot_quantile_example.png": "56f2d452901be0aaa61cae8fdd382677", "plot_quantile_conformalized.png": "25fb11140f72b784df7c81538d28b4bc", "plot_quantile_intervals.png": "31f06cdda63b101d5d4cd7bb5c7242d1", "plot_quantile_vs_standard.png": "a7e09a7c286249020edb212a8c8964e5", "plot_treeshap_example.png": "390c464d8dd7b212f8bfe64e9e5bbf62", "plot_proximity_counts.png": "c3014295e7d995861eb4e1c2653dd9e4", "plot_quantile_ranks.png": "2dc7135b0065af3b72770ab39ce0aa6a", "plot_huggingface_model.png": "c87554d2fada2c6debe8c18c118efff8"}
{"plot_quantile_interpolation.png": "64403bde568aefd4126ce9afd13bdf18", "plot_predict_custom.png": "d93bb87e4412de61511ec04e7cfc57cc", "plot_quantile_extrapolation.png": "8261d15d01301703a25a18a46543ec4a", "plot_quantile_multioutput.png": "f8f257b263ba6a69317db691760aa030", "plot_quantile_example.png": "56f2d452901be0aaa61cae8fdd382677", "plot_quantile_conformalized.png": "25fb11140f72b784df7c81538d28b4bc", "plot_quantile_intervals.png": "31f06cdda63b101d5d4cd7bb5c7242d1", "plot_quantile_vs_standard.png": "a258d56f0dcabbaf4ec2080897f4e503", "plot_treeshap_example.png": "390c464d8dd7b212f8bfe64e9e5bbf62", "plot_proximity_counts.png": "c3014295e7d995861eb4e1c2653dd9e4", "plot_quantile_ranks.png": "2dc7135b0065af3b72770ab39ce0aa6a", "plot_huggingface_model.png": "c87554d2fada2c6debe8c18c118efff8"}
Binary file modified _static/plot_proximity_counts-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_proximity_counts.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_quantile_multioutput-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_quantile_multioutput.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gallery/plot_proximity_counts.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions gallery/plot_quantile_extrapolation.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
<span class="n">qrf_params</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;min_samples_leaf&quot;</span><span class="p">:</span> <span class="mi">4</span><span class="p">,</span> <span class="s2">&quot;max_samples_leaf&quot;</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="s2">&quot;random_state&quot;</span><span class="p">:</span> <span class="n">random_state</span><span class="p">}</span>


<span class="k">def</span> <span class="nf">make_func_Xy</span><span class="p">(</span><span class="n">func</span><span class="p">,</span> <span class="n">bounds</span><span class="p">,</span> <span class="n">n_samples</span><span class="p">,</span> <span class="n">add_noise</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">make_func_Xy</span><span class="p">(</span><span class="n">func</span><span class="p">,</span> <span class="n">n_samples</span><span class="p">,</span> <span class="n">bounds</span><span class="p">,</span> <span class="n">add_noise</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Make a dataset from a specified function.&quot;&quot;&quot;</span>
<span class="n">random_state</span> <span class="o">=</span> <span class="n">check_random_state</span><span class="p">(</span><span class="n">random_state</span><span class="p">)</span>

Expand Down Expand Up @@ -563,7 +563,7 @@
<span class="n">tree</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="n">split1</span><span class="p">,</span> <span class="p">:],</span> <span class="n">Y</span><span class="p">[</span><span class="n">split1</span><span class="p">]</span><span class="o">.</span><span class="n">flatten</span><span class="p">())</span>

<span class="c1"># Extract tree weight matrix.</span>
<span class="n">y_train_leaves</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">_get_y_train_leaves</span><span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="n">split2</span><span class="p">,</span> <span class="p">:],</span> <span class="n">Y</span><span class="p">)</span>
<span class="n">y_train_leaves</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">_get_y_train_leaves</span><span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="n">split2</span><span class="p">,</span> <span class="p">:],</span> <span class="n">Y</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="n">nrows</span> <span class="o">=</span> <span class="n">X</span><span class="p">[</span><span class="n">split2</span><span class="p">,</span> <span class="p">:]</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">matrix</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="n">nrows</span><span class="p">,</span> <span class="n">nrows</span><span class="p">))</span>
<span class="k">for</span> <span class="n">leaf</span> <span class="ow">in</span> <span class="n">y_train_leaves</span><span class="p">[</span><span class="mi">0</span><span class="p">]:</span>
Expand Down Expand Up @@ -785,7 +785,7 @@


<span class="c1"># Create a dataset that requires extrapolation.</span>
<span class="n">X</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">make_func_Xy</span><span class="p">(</span><span class="n">func</span><span class="p">,</span> <span class="n">bounds</span><span class="p">,</span> <span class="n">n_samples</span><span class="p">,</span> <span class="n">add_noise</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
<span class="n">X</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">make_func_Xy</span><span class="p">(</span><span class="n">func</span><span class="p">,</span> <span class="n">n_samples</span><span class="p">,</span> <span class="n">bounds</span><span class="p">,</span> <span class="n">add_noise</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>

<span class="c1"># Fit and extrapolate based on train-test split (depending on X).</span>
<span class="n">extrap_min_idx</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">n_samples</span> <span class="o">*</span> <span class="p">(</span><span class="n">extrap_frac</span> <span class="o">/</span> <span class="mi">2</span><span class="p">))</span>
Expand Down
8 changes: 4 additions & 4 deletions gallery/plot_quantile_multioutput.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions gallery/plot_quantile_vs_standard.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
<span class="n">quantiles</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="mi">101</span><span class="p">,</span> <span class="n">endpoint</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span><span class="o">.</span><span class="n">round</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>


<span class="k">def</span> <span class="nf">make_skewed_dataset</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">loc</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">make_skewed_dataset</span><span class="p">(</span><span class="n">n_samples</span><span class="p">,</span> <span class="n">a</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">loc</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Make a skewed dataset.&quot;&quot;&quot;</span>
<span class="n">random_state</span> <span class="o">=</span> <span class="n">check_random_state</span><span class="p">(</span><span class="n">random_state</span><span class="p">)</span>
<span class="n">skewnorm_rv</span> <span class="o">=</span> <span class="n">sp</span><span class="o">.</span><span class="n">stats</span><span class="o">.</span><span class="n">skewnorm</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">loc</span><span class="p">,</span> <span class="n">scale</span><span class="p">)</span>
Expand All @@ -455,7 +455,7 @@


<span class="c1"># Create a right-skewed toy dataset.</span>
<span class="n">X</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">make_skewed_dataset</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">loc</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
<span class="n">X</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">make_skewed_dataset</span><span class="p">(</span><span class="n">n_samples</span><span class="p">,</span> <span class="n">a</span><span class="o">=</span><span class="mi">7</span><span class="p">,</span> <span class="n">loc</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">random_state</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>

<span class="n">regr_rf</span> <span class="o">=</span> <span class="n">RandomForestRegressor</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">regr_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 ef9dd85

Please sign in to comment.