This repository was archived by the owner on Feb 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ from sklearn .gaussian_process import GaussianProcessRegressor as sk_GaussianProcessRegressor
2
+ from sklearn .gaussian_process .kernels import Matern
3
+ from sklearn .gaussian_process .kernels import WhiteKernel
4
+
5
+ class GaussianProcessRegressor (sk_GaussianProcessRegressor ):
6
+ """
7
+ GaussianProcessRegressor that allows noise tunability.
8
+ """
9
+
10
+ def fit (self , X , y ):
11
+ super (GaussianProcessRegressor , self ).fit (X , y )
12
+ for param , value in self .kernel_ .get_params ().items ():
13
+ # XXX: Should return this only in the case where a
14
+ # WhiteKernel is added.
15
+ if param .endswith ('noise_level' ):
16
+ self .noise_ = value
17
+ break
Original file line number Diff line number Diff line change 3
3
import numpy as np
4
4
5
5
from sklearn .base import clone
6
- from sklearn . gaussian_process import GaussianProcessRegressor
6
+ from skopt . learning import GaussianProcessRegressor
7
7
from sklearn .gaussian_process .kernels import Matern
8
8
from sklearn .gaussian_process .kernels import ConstantKernel
9
9
from sklearn .gaussian_process .kernels import WhiteKernel
You can’t perform that action at this time.
0 commit comments