I am using the GPML code found here. The key function in the aforementioned library is the
gp function described below:
Two modes are possible: training or prediction: if no test cases are supplied, then the negative log marginal likelihood and its partial derivatives w.r.t. the hyper-parameters is computed; this mode is used to fit the hyper-parameters. If test cases are given, then the test set predictive probabilities are returned.
A typical call to the
gp function utilising the prediction mode would be as follows:
[ymu, ys2, fmu, fs2, lp] = gp(hyp, @infEP, meanfunc, covfunc, likfunc, x, y, t, ys);
My first question is regarding the test set targets,
ys. I found it quite weird that, in the file demoClassification.m, the author didn't use the real labels for his target dataset, but instead used a
ones(n, 1). Even weirder, if I follow through with this convention, I obtain reasonable predictions for my test points. If, however, I choose to input the real test labels instead, the predictions output by the model are amiss. I should add that as opposed to the
meshgrid method used by the author to generate the test data, I chose to use a method similar to that he followed to generate his training data:
% Generate the test dataset the same way as the training % dataset, only changing the seed for the random number % generator as well as the size of the test dataset t1 = bsxfun(@plus, chol(S1)'*gpml_randn(0.5, 2, 20), m1); t2 = bsxfun(@plus, chol(S2)'*gpml_randn(0.6, 2, 20), m2); % Concatenate the generated test points into a test dataset t = [t1 t2]'; ys = [-ones(1,20) ones(1,20)]';
Secondly, it is my understanding that the predictions that I should consider are the ones residing in the vecotr
ymu i.e. the predictive output means. If so, what is the use of
fmu i.e. the predictive latent mean, which as far as I understand, better captures the underlying function since it accounts for the presence of noise.