Skip to content

Commit 8bf397d

Browse files
committed
Pushing the docs to dev/ for branch: main, commit 79afe9987cda921bb81c00381198217e9a32fac5
1 parent 79275b5 commit 8bf397d

File tree

1,258 files changed

+6059
-6089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,258 files changed

+6059
-6089
lines changed
Binary file not shown.

dev/_downloads/1bcb2039afa126da41f1cea42b4a5866/plot_gpr_prior_posterior.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ def plot_gpr_samples(gpr_model, n_samples, ax):
126126
)
127127

128128
# %%
129-
# Rational Quadradtic kernel
130-
# ..........................
129+
# Rational Quadratic kernel
130+
# .........................
131131
from sklearn.gaussian_process.kernels import RationalQuadratic
132132

133133
kernel = 1.0 * RationalQuadratic(length_scale=1.0, alpha=0.1, alpha_bounds=(1e-5, 1e15))
@@ -200,7 +200,7 @@ def plot_gpr_samples(gpr_model, n_samples, ax):
200200
kernel = ConstantKernel(0.1, (0.01, 10.0)) * (
201201
DotProduct(sigma_0=1.0, sigma_0_bounds=(0.1, 10.0)) ** 2
202202
)
203-
gpr = GaussianProcessRegressor(kernel=kernel, random_state=0)
203+
gpr = GaussianProcessRegressor(kernel=kernel, random_state=0, normalize_y=True)
204204

205205
fig, axs = plt.subplots(nrows=2, sharex=True, sharey=True, figsize=(10, 8))
206206

Binary file not shown.

dev/_downloads/75a08bb798ae7156529a808a0e08e7b4/plot_gpr_prior_posterior.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"cell_type": "markdown",
8888
"metadata": {},
8989
"source": [
90-
"### Rational Quadradtic kernel\n\n"
90+
"### Rational Quadratic kernel\n\n"
9191
]
9292
},
9393
{
@@ -156,7 +156,7 @@
156156
},
157157
"outputs": [],
158158
"source": [
159-
"from sklearn.gaussian_process.kernels import ConstantKernel, DotProduct\n\nkernel = ConstantKernel(0.1, (0.01, 10.0)) * (\n DotProduct(sigma_0=1.0, sigma_0_bounds=(0.1, 10.0)) ** 2\n)\ngpr = GaussianProcessRegressor(kernel=kernel, random_state=0)\n\nfig, axs = plt.subplots(nrows=2, sharex=True, sharey=True, figsize=(10, 8))\n\n# plot prior\nplot_gpr_samples(gpr, n_samples=n_samples, ax=axs[0])\naxs[0].set_title(\"Samples from prior distribution\")\n\n# plot posterior\ngpr.fit(X_train, y_train)\nplot_gpr_samples(gpr, n_samples=n_samples, ax=axs[1])\naxs[1].scatter(X_train[:, 0], y_train, color=\"red\", zorder=10, label=\"Observations\")\naxs[1].legend(bbox_to_anchor=(1.05, 1.5), loc=\"upper left\")\naxs[1].set_title(\"Samples from posterior distribution\")\n\nfig.suptitle(\"Dot-product kernel\", fontsize=18)\nplt.tight_layout()"
159+
"from sklearn.gaussian_process.kernels import ConstantKernel, DotProduct\n\nkernel = ConstantKernel(0.1, (0.01, 10.0)) * (\n DotProduct(sigma_0=1.0, sigma_0_bounds=(0.1, 10.0)) ** 2\n)\ngpr = GaussianProcessRegressor(kernel=kernel, random_state=0, normalize_y=True)\n\nfig, axs = plt.subplots(nrows=2, sharex=True, sharey=True, figsize=(10, 8))\n\n# plot prior\nplot_gpr_samples(gpr, n_samples=n_samples, ax=axs[0])\naxs[0].set_title(\"Samples from prior distribution\")\n\n# plot posterior\ngpr.fit(X_train, y_train)\nplot_gpr_samples(gpr, n_samples=n_samples, ax=axs[1])\naxs[1].scatter(X_train[:, 0], y_train, color=\"red\", zorder=10, label=\"Observations\")\naxs[1].legend(bbox_to_anchor=(1.05, 1.5), loc=\"upper left\")\naxs[1].set_title(\"Samples from posterior distribution\")\n\nfig.suptitle(\"Dot-product kernel\", fontsize=18)\nplt.tight_layout()"
160160
]
161161
},
162162
{

dev/_downloads/scikit-learn-docs.zip

-9.48 KB
Binary file not shown.
-212 Bytes
-5 Bytes
351 Bytes
127 Bytes
-66 Bytes

0 commit comments

Comments
 (0)