8000 DOC Ensures that GaussianProcessRegressor passes numpydoc validation by baam25simo · Pull Request #20981 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Ensures that GaussianProcessRegressor passes numpydoc validation #20981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

# List of modules ignored when checking for numpydoc validation.
DOCSTRING_IGNORE_LIST = [
"GaussianProcessRegressor",
"GaussianRandomProjection",
"GridSearchCV",
"HalvingGridSearchCV",
Expand Down
16 changes: 11 additions & 5 deletions sklearn/gaussian_process/_gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def optimizer(obj_func, initial_theta, bounds):

Per default, the L-BFGS-B algorithm from `scipy.optimize.minimize`
is used. If None is passed, the kernel's parameters are kept fixed.
Available internal optimizers are: `{'fmin_l_bfgs_b'}`
Available internal optimizers are: `{'fmin_l_bfgs_b'}`.

n_restarts_optimizer : int, default=0
The number of restarts of the optimizer for finding the kernel's
Expand Down Expand Up @@ -146,6 +146,11 @@ def optimizer(obj_func, initial_theta, bounds):

.. versionadded:: 1.0

See Also
--------
GaussianProcessClassifier : Gaussian process classification (GPC)
based on Laplace approximation.

References
----------
.. [1] `Rasmussen, Carl Edward.
Expand Down Expand Up @@ -200,7 +205,8 @@ def fit(self, X, y):

Returns
-------
self : returns an instance of self.
self : object
GaussianProcessRegressor class instance.
"""
if self.kernel is None: # Use an RBF kernel as default
self.kernel_ = C(1.0, constant_value_bounds="fixed") * RBF(
Expand Down Expand Up @@ -318,7 +324,7 @@ def obj_func(theta, eval_gradient=True):
return self

def predict(self, X, return_std=False, return_cov=False):
"""Predict using the Gaussian process regression model
"""Predict using the Gaussian process regression model.

We can also predict based on an unfitted model by using the GP prior.
In addition to the mean of the predictive distribution, optionally also
Expand Down Expand Up @@ -433,7 +439,7 @@ def sample_y(self, X, n_samples=1, random_state=0):
Query points where the GP is evaluated.

n_samples : int, default=1
Number of samples drawn from the Gaussian process per query point
Number of samples drawn from the Gaussian process per query point.

random_state : int, RandomState instance or None, default=0
Determines random number generation to randomly draw samples.
Expand Down Expand Up @@ -464,7 +470,7 @@ def sample_y(self, X, n_samples=1, random_state=0):
def log_marginal_likelihood(
self, theta=None, eval_gradient=False, clone_kernel=True
):
"""Returns log-marginal likelihood of theta for training data.
"""Return log-marginal likelihood of theta for training data.

Parameters
----------
Expand Down
0