def _contour_data(data, length_scales, log_SNRs, kernel_call=GPy.kern.RBF):
lls = []<EOL>total_var = np.var(data['<STR_LIT:Y>'])<EOL>kernel = kernel_call(<NUM_LIT:1>, variance=<NUM_LIT:1.>, lengthscale=<NUM_LIT:1.>)<EOL>model = GPy.models.GPRegression(data['<STR_LIT:X>'], data['<STR_LIT:Y>'], kernel=kernel)<EOL>for log_SNR in log_SNRs:<EOL><INDENT>SNR = <NUM_LIT>**log_SNR<EOL>noise_var = total_var / (<NUM_LIT:1.> + SNR)<EOL>signal_var = total_var - noise_var<EOL>model.kern['<STR_LIT>'] = signal_var<EOL>model.likelihood.variance = noise_var<EOL>length_scale_lls = []<EOL>for length_scale in length_scales:<EOL><INDENT>model['<STR_LIT>'] = length_scale<EOL>length_scale_lls.append(model.log_likelihood())<EOL><DEDENT>lls.append(length_scale_lls)<EOL><DEDENT>return np.array(lls)<EOL>
Evaluate the GP objective function for a given data set for a range of
signal to noise ratios and a range of lengthscales.

:data_set: A data set from the utils.datasets director.
:length_scales: a list of length scales to explore for the contour plot.
:log_SNRs: a list of base 10 logarithm signal to noise ratios to explore for the contour plot.
:kernel: a kernel to use for the 'signal' portion of the data.