Skip to content

Conversation

hadsed
Copy link

@hadsed hadsed commented Oct 25, 2013

Hello.

I made some simple changes to the gaussian process module. Previously, the hyperparameters theta (parameters to optimize from the kernel function) were limited to one, though that one hyperparam could be multifeatured. This is no good if you want to combine kernels (like in Rasmussen & Williams' book) because each part of the new kernel will have its own hyperparams, so I modified the code to allow this.

Theta can now be a matrix, where columns are features / dimensions (just as before), but rows now correspond to different hyperparameters.

I also added a test for it and added a check in the built-in correlation functions to make sure they aren't taking in bad parameters. All the tests seemed to pass for me.

P.S. I hope I'm following the right procedure, I've never contributed before so please let me know if I'm missing anything.

…hyperparams and columns are different features (as opposed to a list corresponding to only one [multidimensional] hyperparm). fmin_cobyla is the only optimizer that handles a matrix theta (if Welch, forces fmin_cobyla). Verbose setting outputs optimal theta.
…in checking theta for builtin correlation functions.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 4e6c472 on hadsed:gp-exten into 03259da on scikit-learn:master.

y2_pred, MSE2 = gp.predict(X2, eval_MSE=True)

assert_true(np.allclose(y_pred, y) and np.allclose(MSE, 0.)
and np.allclose(MSE2, 0., atol=10))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use assert_array_almost_equal instead of assert_true(np.allclose()) to get meaningful failure messages.

@ogrisel
Copy link
Member

ogrisel commented Nov 18, 2013

Maybe one of the example should be updated or extended to demonstrate this new capability too (in a similar way as done in the test).

@glouppe
Copy link
Contributor

glouppe commented Oct 19, 2015

Closing. We now have a new implementation of gaussian processes (see #4270).

Thanks for you contribution.

@glouppe glouppe closed this Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants