Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GaussianProcessRegressor doesn't work with multidemensional output when normalize_y=True #18065

Copy link
Copy link
Closed
@kilojoules

Description

@kilojoules
Issue body actions

The GaussianProcessRegressor doesn't work with multidemensional output when normalize_y=True. In this example, the code runs fine when normalize_y is False, but breaks when it is true:

    import numpy as np
    from sklearn.gaussian_process import GaussianProcessRegressor
    from sklearn.gaussian_process.kernels import RBF
    
    def f(x): return(np.array([np.sin(7 * x), x ** 4]))
    
    kernel = RBF()
    gp = GaussianProcessRegressor(kernel=RBF(length_scale=15.7), n_restarts_optimizer=50,
                             normalize_y=True) # (works when normalize_y is False)
    
    X = np.linspace(0, 5, 5)
    gp.fit(np.atleast_2d(X).T, f(X).T)
    
    newx = np.atleast_2d([1, 2, 3, 4]).T
    gp.predict(newx, return_std=False)
    gp.predict(newx, return_std=True)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.