3

I calcualted a Gaussian Process model in Python using GPy:

ker0 = GPy.kern.Bias(input_dim=1,variance=1e-2)
...
m = GPy.models.GPRegression(x, y, ker0+ker2)

I can plot it with

m.plot()
plt.show

and it visualizes the points, the spline and the confidence limits. Now I want to extract the parameters and the confidence limits to use the data in another plot. My question is, how can I access these data.

if I print m I get

Name : GP regression
Objective : 31.9566881665
Number of Parameters : 4
Number of Optimization Parameters : 4
Updates : True
Parameters:
  GP_regression.           |              value  |  constraints  |  priors
  sum.bias.variance        |  7.48802926977e-61  |      +ve      |
  sum.spline.variance      |     -2.99999065833  |   -3.0,-1.0   |
  sum.spline.c             |      19.8308670902  |   0.0,300.0   |
  Gaussian_noise.variance  |      50.2314402955  |      +ve      |

thx!

gehbiszumeis
  • 3,525
  • 4
  • 24
  • 41
horseshoe
  • 1,437
  • 14
  • 42

1 Answers1

1

Try

m.sum.bias.variance

notice the m. at the beginning.

skrat
  • 648
  • 2
  • 10
  • 27
  • 1
    This answer is no longer up to date, as GPy now returns an error stating `'GPRegression' object has no attribute 'sum'`. – Coolio2654 Apr 30 '19 at 19:10
  • @Coolio2654 agreed. I have searched through `m.__dict__` and the best replacement I can find is `m._param_array_`, which gives an array of parameters (it seems to be the same order as it appears if you use `print(m)`) – TimH Jul 04 '22 at 14:11